Changeset 252065 in webkit


Ignore:
Timestamp:
Nov 5, 2019 11:36:12 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=203803

Patch by Tuomas Karkkainen <tuomas.webkit@apple.com> on 2019-11-05
Reviewed by Saam Barati.

Source/WebKit:

No new tests added because functionality is not changing, code is only
moved from WebKit to WTF.

  • Platform/cocoa/WKCrashReporter.mm:

(WebKit::setCrashReportApplicationSpecificInformation):
(WebKit::setCrashLogMessage): Deleted.

  • WebKit.xcodeproj/project.pbxproj:

Source/WTF:

  • WTF.xcodeproj/project.pbxproj:
  • wtf/PlatformMac.cmake:
  • wtf/cocoa/CrashReporter.cpp: Added.

(WTF::setCrashLogMessage):

  • wtf/cocoa/CrashReporter.h: Added.
  • wtf/spi/cocoa/CrashReporterClientSPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/CrashReporterClientSPI.h.
Location:
trunk/Source
Files:
2 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r251963 r252065  
     12019-11-05  Tuomas Karkkainen  <tuomas.webkit@apple.com>
     2
     3        move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=203803
     5
     6        Reviewed by Saam Barati.
     7
     8        * WTF.xcodeproj/project.pbxproj:
     9        * wtf/PlatformMac.cmake:
     10        * wtf/cocoa/CrashReporter.cpp: Added.
     11        (WTF::setCrashLogMessage):
     12        * wtf/cocoa/CrashReporter.h: Added.
     13        * wtf/spi/cocoa/CrashReporterClientSPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/CrashReporterClientSPI.h.
     14
    1152019-11-02  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r249808 r252065  
    159159                C805EF39E5F14481A96D39FC /* ASCIILiteral.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F050790D9C432A99085E75 /* ASCIILiteral.cpp */; };
    160160                CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; };
     161                CEA072AA236FFBF70018839C /* CrashReporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA072A9236FFBF70018839C /* CrashReporter.cpp */; };
    161162                DCEE22011CEA7551000C2396 /* BlockObjCExceptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */; };
    162163                E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */; };
     
    653654                CDCC9BC422382FCE00FFB51C /* AggregateLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AggregateLogger.h; path = wtf/AggregateLogger.h; sourceTree = SOURCE_ROOT; };
    654655                CE73E02419DCB7AB00580D5C /* XPCSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCSPI.h; sourceTree = "<group>"; };
     656                CEA072A7236FFA160018839C /* CrashReporterClientSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashReporterClientSPI.h; sourceTree = "<group>"; };
     657                CEA072A8236FFBF70018839C /* CrashReporter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CrashReporter.h; sourceTree = "<group>"; };
     658                CEA072A9236FFBF70018839C /* CrashReporter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CrashReporter.cpp; sourceTree = "<group>"; };
    655659                DCEE21FA1CEA7538000C2396 /* CFBundleSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFBundleSPI.h; sourceTree = "<group>"; };
    656660                DCEE21FC1CEA7551000C2396 /* BlockObjCExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockObjCExceptions.h; sourceTree = "<group>"; };
     
    13651369                        isa = PBXGroup;
    13661370                        children = (
     1371                                CEA072A7236FFA160018839C /* CrashReporterClientSPI.h */,
    13671372                                9384B73E20DEA284005B73B2 /* CFXPCBridgeSPI.h */,
    13681373                                E31BDE2822E913CC0029B105 /* MachVMSPI.h */,
     
    14381443                                5CC0EE862162BC2200A1A842 /* URLCocoa.mm */,
    14391444                                E4A0AD3C1A96253C00536DF6 /* WorkQueueCocoa.cpp */,
     1445                                CEA072A8236FFBF70018839C /* CrashReporter.h */,
     1446                                CEA072A9236FFBF70018839C /* CrashReporter.cpp */,
    14401447                        );
    14411448                        path = cocoa;
     
    15771584                                7A6EBA3420746C34004F9C44 /* MachSendRight.cpp in Sources */,
    15781585                                A8A473E5151A825B004123FF /* MainThread.cpp in Sources */,
     1586                                CEA072AA236FFBF70018839C /* CrashReporter.cpp in Sources */,
    15791587                                A8A473E4151A825B004123FF /* MainThreadCocoa.mm in Sources */,
    15801588                                A8A473E9151A825B004123FF /* MD5.cpp in Sources */,
  • trunk/Source/WTF/wtf/PlatformMac.cmake

    r251831 r252065  
    1414    cf/TypeCastsCF.h
    1515
     16    cocoa/CrashReporter.h
    1617    cocoa/Entitlements.h
    1718    cocoa/NSURLExtras.h
     
    2425
    2526    spi/cocoa/CFXPCBridgeSPI.h
     27    spi/cocoa/CrashReporterClientSPI.h
    2628    spi/cocoa/MachVMSPI.h
    2729    spi/cocoa/SecuritySPI.h
     
    5254    cocoa/AutodrainedPool.cpp
    5355    cocoa/CPUTimeCocoa.cpp
     56    cocoa/CrashReporter.cpp
    5457    cocoa/Entitlements.mm
    5558    cocoa/FileSystemCocoa.mm
  • trunk/Source/WTF/wtf/spi/cocoa/CrashReporterClientSPI.h

    r252064 r252065  
    2323 * THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25
     26#pragma once
    2527
    2628#if USE(APPLE_INTERNAL_SDK)
  • trunk/Source/WebKit/ChangeLog

    r252062 r252065  
     12019-11-05  Tuomas Karkkainen  <tuomas.webkit@apple.com>
     2
     3        move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore
     4        https://bugs.webkit.org/show_bug.cgi?id=203803
     5
     6        Reviewed by Saam Barati.
     7
     8        No new tests added because functionality is not changing, code is only
     9        moved from WebKit to WTF.
     10
     11        * Platform/cocoa/WKCrashReporter.mm:
     12        (WebKit::setCrashReportApplicationSpecificInformation):
     13        (WebKit::setCrashLogMessage): Deleted.
     14        * WebKit.xcodeproj/project.pbxproj:
     15
    1162019-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
    217
  • trunk/Source/WebKit/Platform/cocoa/WKCrashReporter.mm

    r239294 r252065  
    2626#import "config.h"
    2727#import "WKCrashReporter.h"
     28#import <wtf/cocoa/CrashReporter.h>
    2829
    2930#import <cstdlib>
    30 #import "CrashReporterClientSPI.h"
    31 
    32 // Avoid having to link with libCrashReporterClient.a
    33 CRASH_REPORTER_CLIENT_HIDDEN
    34 struct crashreporter_annotations_t gCRAnnotations
    35 __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION)))
    36     = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0, 0 };
    3731
    3832namespace WebKit {
    3933
    40 static void setCrashLogMessage(const char* message)
    41 {
    42     // We have to copy the string because CRSetCrashLogMessage doesn't.
    43     char* copiedMessage = message ? strdup(message) : nullptr;
    44 
    45     CRSetCrashLogMessage(copiedMessage);
    46 
    47     // Delete the message from last time, so we don't keep leaking messages.
    48     static char* previousCopiedCrashLogMessage;
    49     std::free(std::exchange(previousCopiedCrashLogMessage, copiedMessage));
    50 }
    51 
    5234void setCrashReportApplicationSpecificInformation(CFStringRef infoString)
    5335{
    54     setCrashLogMessage([(__bridge NSString *)infoString UTF8String]);
     36    WTF::setCrashLogMessage([(__bridge NSString *)infoString UTF8String]);
    5537}
    5638
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r251952 r252065  
    13691369                A1EA02401DAC31DB0096021F /* WebContextMenuListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A1EA023E1DAC31DB0096021F /* WebContextMenuListenerProxy.h */; };
    13701370                A1FB68241F6E518200C43F9F /* WKCrashReporter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1FB68221F6E518200C43F9F /* WKCrashReporter.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1371                 A1FB68271F6E51C100C43F9F /* CrashReporterClientSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1FB68261F6E51C100C43F9F /* CrashReporterClientSPI.h */; };
    13721371                A513F5402154A5D700662841 /* WebPageInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = A513F53E2154A5CC00662841 /* WebPageInspectorController.h */; };
    13731372                A518B5D21FE1D55B00F9FA28 /* WKInspectorWKWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = A518B5D01FE1D55B00F9FA28 /* WKInspectorWKWebView.h */; };
     
    41264125                A1FB68221F6E518200C43F9F /* WKCrashReporter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKCrashReporter.h; sourceTree = "<group>"; };
    41274126                A1FB68231F6E518200C43F9F /* WKCrashReporter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKCrashReporter.mm; sourceTree = "<group>"; };
    4128                 A1FB68261F6E51C100C43F9F /* CrashReporterClientSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CrashReporterClientSPI.h; sourceTree = "<group>"; };
    41294127                A513F53E2154A5CC00662841 /* WebPageInspectorController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebPageInspectorController.h; sourceTree = "<group>"; };
    41304128                A513F53F2154A5CD00662841 /* WebPageInspectorController.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageInspectorController.cpp; sourceTree = "<group>"; };
     
    62806278                                1A5705101BE410E500874AF1 /* BlockSPI.h */,
    62816279                                37C21CAD1E994C0C0029D5F9 /* CorePredictionSPI.h */,
    6282                                 A1FB68261F6E51C100C43F9F /* CrashReporterClientSPI.h */,
    62836280                                57DCEDAA214B9B430016B847 /* DeviceIdentitySPI.h */,
    62846281                                2DAADA8E2298C21000E36B0C /* DeviceManagementSPI.h */,
     
    95009497                                37C21CAE1E994C0C0029D5F9 /* CorePredictionSPI.h in Headers */,
    95019498                                B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
    9502                                 A1FB68271F6E51C100C43F9F /* CrashReporterClientSPI.h in Headers */,
    95039499                                57597EBD218184900037F924 /* CtapAuthenticator.h in Headers */,
    95049500                                57597EB921811D9A0037F924 /* CtapHidDriver.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.