[Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemIn...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2017 18:17:18 +0000 (18:17 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2017 18:17:18 +0000 (18:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177048

Reviewed by Alex Christensen.

Source/WebKit:

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
(IPC::readFromMachPort):
* Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
* Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
(WebKit::setCrashReportApplicationSpecificInformation):
* Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
* Shared/Cocoa/ChildProcessCocoa.mm:
(WebKit::ChildProcess::didReceiveInvalidMessage):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::_WKSetCrashReportApplicationSpecificInformation):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::setCrashReportApplicationSpecificInformationToURL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/mac/ConnectionMac.mm
Source/WebKit/Platform/cocoa/WKCrashReporter.h [new file with mode: 0644]
Source/WebKit/Platform/cocoa/WKCrashReporter.mm [new file with mode: 0644]
Source/WebKit/Platform/spi/Cocoa/CrashReporterClientSPI.h [new file with mode: 0644]
Source/WebKit/PlatformMac.cmake
Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm

index 6b2f079..a48a25a 100644 (file)
@@ -1,5 +1,25 @@
 2017-09-18  Andy Estes  <aestes@apple.com>
 
+        [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
+        https://bugs.webkit.org/show_bug.cgi?id=177048
+
+        Reviewed by Alex Christensen.
+
+        * Platform/IPC/mac/ConnectionMac.mm:
+        (IPC::Connection::sendMessage):
+        (IPC::readFromMachPort):
+        * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
+        * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
+        (WebKit::setCrashReportApplicationSpecificInformation):
+        * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
+        * Shared/Cocoa/ChildProcessCocoa.mm:
+        (WebKit::ChildProcess::didReceiveInvalidMessage):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::_WKSetCrashReportApplicationSpecificInformation):
+
+2017-09-18  Andy Estes  <aestes@apple.com>
+
         [Mac] Upstream miscellaneous WebKitSystemInterface functions
         https://bugs.webkit.org/show_bug.cgi?id=177029
 
index fe875b4..706d392 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "Connection.h"
-
-#include "DataReference.h"
-#include "ImportanceAssertion.h"
-#include "MachMessage.h"
-#include "MachPort.h"
-#include "MachUtilities.h"
-#include <WebCore/AXObjectCache.h>
-#include <WebKitSystemInterface.h>
-#include <mach/mach_error.h>
-#include <mach/vm_map.h>
-#include <sys/mman.h>
-#include <wtf/RunLoop.h>
-#include <wtf/spi/darwin/XPCSPI.h>
+#import "config.h"
+#import "Connection.h"
+
+#import "DataReference.h"
+#import "ImportanceAssertion.h"
+#import "MachMessage.h"
+#import "MachPort.h"
+#import "MachUtilities.h"
+#import "WKCrashReporter.h"
+#import <WebCore/AXObjectCache.h>
+#import <WebKitSystemInterface.h>
+#import <mach/mach_error.h>
+#import <mach/vm_map.h>
+#import <sys/mman.h>
+#import <wtf/RunLoop.h>
+#import <wtf/spi/darwin/XPCSPI.h>
 
 #if PLATFORM(IOS)
-#include "ProcessAssertion.h"
-#include <UIKit/UIAccessibility.h>
+#import "ProcessAssertion.h"
+#import <UIKit/UIAccessibility.h>
 
 #if USE(APPLE_INTERNAL_SDK)
-#include <AXRuntime/AXDefines.h>
-#include <AXRuntime/AXNotificationConstants.h>
+#import <AXRuntime/AXDefines.h>
+#import <AXRuntime/AXNotificationConstants.h>
 #else
 #define kAXPidStatusChangedNotification 0
 #endif
@@ -55,7 +56,7 @@
 #if PLATFORM(MAC)
 
 #if USE(APPLE_INTERNAL_SDK)
-#include <HIServices/AccessibilityPriv.h>
+#import <HIServices/AccessibilityPriv.h>
 #else
 typedef enum {
     AXSuspendStatusRunning = 0,
@@ -247,7 +248,7 @@ bool Connection::sendMessage(std::unique_ptr<MachMessage> message)
         return false;
 
     default:
-        WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x, message '%@'", kr, message->messageName()]);
+        WebKit::setCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x, message '%@'", kr, message->messageName()]);
         CRASH();
     }
 }
@@ -461,7 +462,7 @@ static mach_msg_header_t* readFromMachPort(mach_port_t machPort, ReceiveBuffer&
 
     if (kr != MACH_MSG_SUCCESS) {
 #if !ASSERT_DISABLED
-        WKSetCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg, receive port is %x", kr, machPort]);
+        WebKit::setCrashReportApplicationSpecificInformation((CFStringRef)[NSString stringWithFormat:@"Unhandled error code %x from mach_msg, receive port is %x", kr, machPort]);
 #endif
         ASSERT_NOT_REACHED();
         return 0;
diff --git a/Source/WebKit/Platform/cocoa/WKCrashReporter.h b/Source/WebKit/Platform/cocoa/WKCrashReporter.h
new file mode 100644 (file)
index 0000000..94d8c7a
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebKit/WKBase.h>
+
+namespace WebKit {
+
+WK_EXPORT void setCrashReportApplicationSpecificInformation(CFStringRef);
+
+}
diff --git a/Source/WebKit/Platform/cocoa/WKCrashReporter.mm b/Source/WebKit/Platform/cocoa/WKCrashReporter.mm
new file mode 100644 (file)
index 0000000..f2ac34c
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKCrashReporter.h"
+
+#import "CrashReporterClientSPI.h"
+
+// Avoid having to link with libCrashReporterClient.a
+CRASH_REPORTER_CLIENT_HIDDEN
+struct crashreporter_annotations_t gCRAnnotations
+__attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION)))
+    = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0, 0 };
+
+namespace WebKit {
+
+void setCrashReportApplicationSpecificInformation(CFStringRef infoString)
+{
+    if (!infoString) {
+        CRSetCrashLogMessage(nullptr);
+        return;
+    }
+
+    char* oldMessage = (char*)CRGetCrashLogMessage();
+    if (oldMessage)
+        free(oldMessage);
+
+    // We have to copy the string, because CRSetCrashLogMessage doesn't copy the data.
+    char* lastInfoChars = strdup([(NSString *)infoString UTF8String]);
+    CRSetCrashLogMessage(lastInfoChars);
+}
+
+}
diff --git a/Source/WebKit/Platform/spi/Cocoa/CrashReporterClientSPI.h b/Source/WebKit/Platform/spi/Cocoa/CrashReporterClientSPI.h
new file mode 100644 (file)
index 0000000..1b4dadd
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <CrashReporterClient.h>
+
+#else
+
+#define CRASHREPORTER_ANNOTATIONS_SECTION "__crash_info"
+#define CRASHREPORTER_ANNOTATIONS_VERSION 5
+#define CRASH_REPORTER_CLIENT_HIDDEN __attribute__((visibility("hidden")))
+
+#define _crc_make_getter(attr) ((const char *)(unsigned long)gCRAnnotations.attr)
+#define _crc_make_setter(attr, arg) (gCRAnnotations.attr = (uint64_t)(unsigned long)(arg))
+#define CRGetCrashLogMessage() _crc_make_getter(message)
+#define CRSetCrashLogMessage(m) _crc_make_setter(message, m)
+
+struct crashreporter_annotations_t {
+    uint64_t version;
+    uint64_t message;
+    uint64_t signature_string;
+    uint64_t backtrace;
+    uint64_t message2;
+    uint64_t thread;
+    uint64_t dialog_mode;
+    uint64_t abort_cause;
+};
+
+CRASH_REPORTER_CLIENT_HIDDEN
+extern struct crashreporter_annotations_t gCRAnnotations;
+
+#endif
index d8b5235..866fc07 100644 (file)
@@ -46,6 +46,8 @@ list(APPEND WebKit2_SOURCES
 
     Platform/cg/CGUtilities.cpp
 
+    Platform/cocoa/WKCrashReporter.mm
+
     Platform/classifier/ResourceLoadStatisticsClassifier.cpp
 
     Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp
index e889367..4410b20 100644 (file)
 #import "config.h"
 #import "ChildProcess.h"
 
-#import <WebKitSystemInterface.h>
+#import "WKCrashReporter.h"
 
 namespace WebKit {
 
 void ChildProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName)
 {
-    WKSetCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Received invalid message: '%s::%s'", messageReceiverName.toString().data(), messageName.toString().data()]);
+    setCrashReportApplicationSpecificInformation((__bridge CFStringRef)[NSString stringWithFormat:@"Received invalid message: '%s::%s'", messageReceiverName.toString().data(), messageName.toString().data()]);
     CRASH();
 }
 
index fd199d9..c122610 100644 (file)
@@ -89,8 +89,8 @@
                0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */; };
                0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */; };
                0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */; };
-               0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; };
                0F931C1C18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h */; };
+               0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; };
                0F931C1D18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.mm */; };
                0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB659221208B4DB0044816C /* DrawingAreaInfo.h */; };
                0FCB4E4618BBE044000FCFC9 /* PageClientImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E3618BBE044000FCFC9 /* PageClientImplIOS.h */; };
                A1EA02381DABFF7E0096021F /* WKContextMenuListener.h in Headers */ = {isa = PBXBuildFile; fileRef = A1EA02361DABFF7E0096021F /* WKContextMenuListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1EA023F1DAC31DB0096021F /* WebContextMenuListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1EA023D1DAC31DB0096021F /* WebContextMenuListenerProxy.cpp */; };
                A1EA02401DAC31DB0096021F /* WebContextMenuListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A1EA023E1DAC31DB0096021F /* WebContextMenuListenerProxy.h */; };
+               A1FB68241F6E518200C43F9F /* WKCrashReporter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1FB68221F6E518200C43F9F /* WKCrashReporter.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A1FB68251F6E518200C43F9F /* WKCrashReporter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1FB68231F6E518200C43F9F /* WKCrashReporter.mm */; };
+               A1FB68271F6E51C100C43F9F /* CrashReporterClientSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1FB68261F6E51C100C43F9F /* CrashReporterClientSPI.h */; };
                A54293A4195A43DA002782C7 /* WKInspectorNodeSearchGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A54293A2195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.h */; };
                A54293A5195A43DD002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm in Sources */ = {isa = PBXBuildFile; fileRef = A54293A3195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm */; };
                A55BA8101BA1317E007CD33D /* _WKRemoteWebInspectorViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA80C1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPerformanceLoggingClient.cpp; sourceTree = "<group>"; };
                0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPerformanceLoggingClient.h; sourceTree = "<group>"; };
                0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; };
-               0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; };
                0F931C1A18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeScrollingNodeDelegateIOS.h; sourceTree = "<group>"; };
+               0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; };
                0F931C1B18C5711900DBB8D4 /* ScrollingTreeScrollingNodeDelegateIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreeScrollingNodeDelegateIOS.mm; sourceTree = "<group>"; };
                0FB659221208B4DB0044816C /* DrawingAreaInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaInfo.h; sourceTree = "<group>"; };
                0FC0856E187CE0A900780D86 /* __init__.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = __init__.py; path = webkit/__init__.py; sourceTree = "<group>"; };
                41FAF5F41E3C0641001AE678 /* WebRTCResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebRTCResolver.h; path = Network/webrtc/WebRTCResolver.h; sourceTree = "<group>"; };
                41FAF5F61E3C0B47001AE678 /* LibWebRTCResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCResolver.h; path = Network/webrtc/LibWebRTCResolver.h; sourceTree = "<group>"; };
                41FAF5F71E3C0B47001AE678 /* LibWebRTCResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibWebRTCResolver.cpp; path = Network/webrtc/LibWebRTCResolver.cpp; sourceTree = "<group>"; };
-               4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharedMemoryCocoa.cpp; path = cocoa/SharedMemoryCocoa.cpp; sourceTree = "<group>"; };
+               4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedMemoryCocoa.cpp; sourceTree = "<group>"; };
                462107D71F38DBD300DD7810 /* PingLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PingLoad.cpp; path = NetworkProcess/PingLoad.cpp; sourceTree = "<group>"; };
                463FD47F1EB9458400A2982C /* WKProcessTerminationReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessTerminationReason.h; sourceTree = "<group>"; };
                463FD4811EB94EAD00A2982C /* ProcessTerminationReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessTerminationReason.h; sourceTree = "<group>"; };
                A1EDD2DB1884B96400BBFE98 /* PluginProcessShim.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = PluginProcessShim.xcconfig; sourceTree = "<group>"; };
                A1EDD2DC1884B9B500BBFE98 /* SecItemShim.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SecItemShim.xcconfig; sourceTree = "<group>"; };
                A1EDD2DD1884B9E300BBFE98 /* WebProcessShim.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebProcessShim.xcconfig; sourceTree = "<group>"; };
+               A1FB68221F6E518200C43F9F /* WKCrashReporter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKCrashReporter.h; sourceTree = "<group>"; };
+               A1FB68231F6E518200C43F9F /* WKCrashReporter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKCrashReporter.mm; sourceTree = "<group>"; };
+               A1FB68261F6E51C100C43F9F /* CrashReporterClientSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CrashReporterClientSPI.h; sourceTree = "<group>"; };
                A54293A2195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKInspectorNodeSearchGestureRecognizer.h; path = ios/WKInspectorNodeSearchGestureRecognizer.h; sourceTree = "<group>"; };
                A54293A3195A43C6002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKInspectorNodeSearchGestureRecognizer.mm; path = ios/WKInspectorNodeSearchGestureRecognizer.mm; sourceTree = "<group>"; };
                A55BA80C1BA12BE1007CD33D /* _WKRemoteWebInspectorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKRemoteWebInspectorViewController.h; sourceTree = "<group>"; };
                        children = (
                                1A5705101BE410E500874AF1 /* BlockSPI.h */,
                                37C21CAD1E994C0C0029D5F9 /* CorePredictionSPI.h */,
+                               A1FB68261F6E51C100C43F9F /* CrashReporterClientSPI.h */,
                                3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */,
                                37B47E2C1D64DB76005F4EFF /* objcSPI.h */,
                        );
                        isa = PBXGroup;
                        children = (
                                4450AEBF1DC3FAE5009943F2 /* SharedMemoryCocoa.cpp */,
+                               A1FB68221F6E518200C43F9F /* WKCrashReporter.h */,
+                               A1FB68231F6E518200C43F9F /* WKCrashReporter.mm */,
                        );
-                       name = cocoa;
+                       path = cocoa;
                        sourceTree = "<group>";
                };
                4A410F4119AF7B27002EBAB5 /* MediaStream */ = {
                                CE1A0BD31A48E6C60054EF74 /* CorePDFSPI.h in Headers */,
                                37C21CAE1E994C0C0029D5F9 /* CorePredictionSPI.h in Headers */,
                                B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
+                               A1FB68271F6E51C100C43F9F /* CrashReporterClientSPI.h in Headers */,
                                C55F91711C59676E0029E92D /* DataDetectionResult.h in Headers */,
                                1AC75380183BE50F0072CB15 /* DataReference.h in Headers */,
                                BC032DA610F437D10058C15A /* Decoder.h in Headers */,
                                BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */,
                                9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */,
                                3309345B1315B9980097A7BC /* WKCookieManager.h in Headers */,
+                               A1FB68241F6E518200C43F9F /* WKCrashReporter.h in Headers */,
                                512F58FA12A88A5400629530 /* WKCredential.h in Headers */,
                                518ACF1112B015F800B04B83 /* WKCredentialTypes.h in Headers */,
                                BC4075F8124FF0270068F20A /* WKData.h in Headers */,
                                A1D420471DB5578500BB6B0D /* WKContextMenuListener.cpp in Sources */,
                                9FB5F394169E6A80002C25BF /* WKContextPrivateMac.mm in Sources */,
                                3309345A1315B9980097A7BC /* WKCookieManager.cpp in Sources */,
+                               A1FB68251F6E518200C43F9F /* WKCrashReporter.mm in Sources */,
                                512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
                                BC4075F7124FF0270068F20A /* WKData.cpp in Sources */,
                                1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */,
index 2a3f38e..8f04539 100644 (file)
@@ -36,6 +36,7 @@
 #import "SessionTracker.h"
 #import "WKAPICast.h"
 #import "WKBrowsingContextHandleInternal.h"
+#import "WKCrashReporter.h"
 #import "WKFullKeyboardAccessWatcher.h"
 #import "WKTypeRefWrapper.h"
 #import "WKWebProcessPlugInBrowserContextControllerInternal.h"
@@ -538,7 +539,7 @@ void WebProcess::destroyRenderingResources()
 // FIXME: This should live somewhere else, and it should have the implementation in line instead of calling out to WKSI.
 void _WKSetCrashReportApplicationSpecificInformation(NSString *infoString)
 {
-    return WKSetCrashReportApplicationSpecificInformation((__bridge CFStringRef)infoString);
+    return setCrashReportApplicationSpecificInformation((__bridge CFStringRef)infoString);
 }
 
 } // namespace WebKit
index 48c99bf..7ca5183 100644 (file)
@@ -1,3 +1,15 @@
+2017-09-18  Andy Estes  <aestes@apple.com>
+
+        [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
+        https://bugs.webkit.org/show_bug.cgi?id=177048
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (runTest):
+        * WebKitTestRunner/cocoa/CrashReporterInfo.mm:
+        (WTR::setCrashReportApplicationSpecificInformationToURL):
+
 2017-09-18  Tim Horton  <timothy_horton@apple.com>
 
         build-webkit spawns fewer subprocesses than ninja uses by default
index 989aa46..b9cacfa 100644 (file)
@@ -62,6 +62,7 @@
 #import <WebKit/DOMElement.h>
 #import <WebKit/DOMExtensions.h>
 #import <WebKit/DOMRange.h>
+#import <WebKit/WKCrashReporter.h>
 #import <WebKit/WKRetainPtr.h>
 #import <WebKit/WKString.h>
 #import <WebKit/WKStringCF.h>
@@ -1941,7 +1942,7 @@ static void runTest(const string& inputLine)
         testPath = [url absoluteString];
 
     NSString *informationString = [@"CRASHING TEST: " stringByAppendingString:testPath];
-    WKSetCrashReportApplicationSpecificInformation((CFStringRef)informationString);
+    WebKit::setCrashReportApplicationSpecificInformation((CFStringRef)informationString);
 
     TestOptions options(url, command);
     if (!mainFrameTestOptions || !options.webViewIsCompatibleWithOptions(mainFrameTestOptions.value())) {
index c640323..e22d11d 100644 (file)
@@ -27,8 +27,8 @@
 #import "CrashReporterInfo.h"
 
 #import "StringFunctions.h"
+#import <WebKit/WKCrashReporter.h>
 #import <WebKit/WKURLCF.h>
-#import <WebKitSystemInterface.h>
 #import <wtf/RetainPtr.h>
 
 namespace WTR {
@@ -71,7 +71,7 @@ void setCrashReportApplicationSpecificInformationToURL(WKURLRef url)
     if (!testPath.isNull()) {
         String message("CRASHING TEST: ");
         message = message + testPath;
-        WKSetCrashReportApplicationSpecificInformation(message.createCFString().get());
+        WebKit::setCrashReportApplicationSpecificInformation(message.createCFString().get());
     }
 }