Revert r245501
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2019 05:31:25 +0000 (05:31 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2019 05:31:25 +0000 (05:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198007

That change did not fix <rdar://problem/49808949> but it caused <rdar://problem/50967271> so out it goes.

* Shared/API/Cocoa/WKMain.h: Added.
* Shared/API/Cocoa/WKMain.mm: Added.
(WKXPCServiceMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
(main):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(main): Deleted.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* WebKit.xcodeproj/project.pbxproj:

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

Source/WebKit/ChangeLog
Source/WebKit/Shared/API/Cocoa/WKMain.h [new file with mode: 0644]
Source/WebKit/Shared/API/Cocoa/WKMain.mm [new file with mode: 0644]
Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp [new file with mode: 0644]
Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj

index 7c78b8b..12ec5a7 100644 (file)
@@ -1,3 +1,21 @@
+2019-05-20  Alex Christensen  <achristensen@webkit.org>
+
+        Revert r245501
+        https://bugs.webkit.org/show_bug.cgi?id=198007
+
+        That change did not fix <rdar://problem/49808949> but it caused <rdar://problem/50967271> so out it goes.
+
+        * Shared/API/Cocoa/WKMain.h: Added.
+        * Shared/API/Cocoa/WKMain.mm: Added.
+        (WKXPCServiceMain):
+        * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
+        (main):
+        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
+        (main): Deleted.
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::ProcessLauncher::launchProcess):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2019-05-20  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS] Layout viewport size on google.com increases after rotating to landscape and back
diff --git a/Source/WebKit/Shared/API/Cocoa/WKMain.h b/Source/WebKit/Shared/API/Cocoa/WKMain.h
new file mode 100644 (file)
index 0000000..14efba2
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2019 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>
+#include <WebKit/WKFoundation.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT int WKXPCServiceMain(int argc, const char** argv) WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Source/WebKit/Shared/API/Cocoa/WKMain.mm b/Source/WebKit/Shared/API/Cocoa/WKMain.mm
new file mode 100644 (file)
index 0000000..eed8f94
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include "config.h"
+#include "WKMain.h"
+
+#include "XPCServiceEntryPoint.h"
+
+int WKXPCServiceMain(int argc, const char** argv)
+{
+    return WebKit::XPCServiceMain(argc, argv);
+}
diff --git a/Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp b/Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp
new file mode 100644 (file)
index 0000000..fe6b367
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#include <WebKit/WKMain.h>
+
+int main(int argc, const char** argv)
+{
+    return WKXPCServiceMain(argc, argv);
+}
index 1722b0d..2b0967a 100644 (file)
@@ -149,8 +149,3 @@ int XPCServiceMain(int, const char**)
 }
 
 } // namespace WebKit
-
-int main(int argc, const char** argv)
-{
-    return WebKit::XPCServiceMain(argc, argv);
-}
index 6cbac25..824e387 100644 (file)
@@ -200,7 +200,7 @@ void ProcessLauncher::launchProcess()
 
     auto errorHandlerImpl = [weakProcessLauncher = makeWeakPtr(*this), listeningPort] (xpc_object_t event) {
         ASSERT(!event || xpc_get_type(event) == XPC_TYPE_ERROR);
-
+        
         auto processLauncher = weakProcessLauncher.get();
         if (!processLauncher)
             return;
index 2bf1040..7624564 100644 (file)
                5CD286571E7235C90094FDC8 /* WKContentRuleListStoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CD2864F1E722F440094FDC8 /* WKContentRuleListStoreInternal.h */; };
                5CD286581E7235D10094FDC8 /* WKContentRuleListStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CD286501E722F440094FDC8 /* WKContentRuleListStorePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5CE85B201C88E64B0070BFCE /* PingLoad.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE85B1F1C88E6430070BFCE /* PingLoad.h */; };
+               5CE9120D2293C219005BEC78 /* WKMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE9120C2293C1E0005BEC78 /* WKMain.mm */; };
+               5CE912102293C277005BEC78 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */; };
+               5CE912112293C278005BEC78 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */; };
+               5CE912122293C278005BEC78 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */; };
+               5CE912132293C279005BEC78 /* AuxiliaryProcessMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */; };
+               5CE912142293C280005BEC78 /* WKMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE9120B2293C1E0005BEC78 /* WKMain.h */; settings = {ATTRIBUTES = (Private, ); }; };
                617A52D81F43A9DA00DCDC0A /* ServiceWorkerClientFetchMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 617A52D71F43A9B600DCDC0A /* ServiceWorkerClientFetchMessageReceiver.cpp */; };
                63108F961F96719C00A0DB84 /* _WKApplicationManifest.h in Headers */ = {isa = PBXBuildFile; fileRef = 63108F941F96719C00A0DB84 /* _WKApplicationManifest.h */; settings = {ATTRIBUTES = (Private, ); }; };
                63108F991F9671F700A0DB84 /* _WKApplicationManifestInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 63108F981F9671F700A0DB84 /* _WKApplicationManifestInternal.h */; };
                5CD2864F1E722F440094FDC8 /* WKContentRuleListStoreInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentRuleListStoreInternal.h; sourceTree = "<group>"; };
                5CD286501E722F440094FDC8 /* WKContentRuleListStorePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentRuleListStorePrivate.h; sourceTree = "<group>"; };
                5CE85B1F1C88E6430070BFCE /* PingLoad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PingLoad.h; sourceTree = "<group>"; };
+               5CE9120B2293C1E0005BEC78 /* WKMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMain.h; sourceTree = "<group>"; };
+               5CE9120C2293C1E0005BEC78 /* WKMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKMain.mm; sourceTree = "<group>"; };
+               5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AuxiliaryProcessMain.cpp; path = Cocoa/AuxiliaryProcessMain.cpp; sourceTree = "<group>"; };
                5CFECB031E1ED1C800F88504 /* LegacyCustomProtocolManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyCustomProtocolManager.cpp; sourceTree = "<group>"; };
                5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
                617A52D71F43A9B600DCDC0A /* ServiceWorkerClientFetchMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ServiceWorkerClientFetchMessageReceiver.cpp; path = DerivedSources/WebKit2/ServiceWorkerClientFetchMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
                                37A709A81E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h */,
                                F409BA171E6E64B3009DA28E /* WKDragDestinationAction.h */,
                                37DFA6FF1810BB92001F4A9F /* WKFoundation.h */,
+                               5CE9120B2293C1E0005BEC78 /* WKMain.h */,
+                               5CE9120C2293C1E0005BEC78 /* WKMain.mm */,
                                1A9E32991822E1CC00F5D04C /* WKRemoteObject.h */,
                                1A9E32981822E1CC00F5D04C /* WKRemoteObject.mm */,
                                1A9E329D1822FEDD00F5D04C /* WKRemoteObjectCoder.h */,
                        isa = PBXGroup;
                        children = (
                                BC82836B16B3587900A278FE /* XPCService */,
+                               5CE9120F2293C25F005BEC78 /* AuxiliaryProcessMain.cpp */,
                        );
                        path = EntryPointUtilities;
                        sourceTree = "<group>";
                                2DD5E129210ADC7B00DB6012 /* WKKeyboardScrollingAnimator.h in Headers */,
                                51A9E10B1315CD18009E7031 /* WKKeyValueStorageManager.h in Headers */,
                                2D790A9F1AD7164900AB90B3 /* WKLayoutMode.h in Headers */,
+                               5CE912142293C280005BEC78 /* WKMain.h in Headers */,
                                C98C48AA1B6FD5B500145103 /* WKMediaSessionFocusManager.h in Headers */,
                                C9CD439D1B4B024F00239E33 /* WKMediaSessionMetadata.h in Headers */,
                                1AB40EE61BF677E300BA81BE /* WKMenuItemIdentifiersPrivate.h in Headers */,
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               5CE912112293C278005BEC78 /* AuxiliaryProcessMain.cpp in Sources */,
                                5C9A9112228F69CC005C5B17 /* XPCServiceMain.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                2D931169212F61B200044BFE /* WKContentView.mm in Sources */,
                                2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */,
                                637281A321ADC744009E0DE6 /* WKDownloadProgress.mm in Sources */,
+                               5CE9120D2293C219005BEC78 /* WKMain.mm in Sources */,
                                4657D88A22664A2F005DE823 /* WKOrientationAccessAlert.mm in Sources */,
                                5CA26D83217AD1B800F97A35 /* WKSafeBrowsingWarning.mm in Sources */,
                                1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */,
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               5CE912102293C277005BEC78 /* AuxiliaryProcessMain.cpp in Sources */,
                                5C9A9111228F69CC005C5B17 /* XPCServiceMain.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               5CE912122293C278005BEC78 /* AuxiliaryProcessMain.cpp in Sources */,
                                5C9A9113228F69CD005C5B17 /* XPCServiceMain.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               5CE912132293C279005BEC78 /* AuxiliaryProcessMain.cpp in Sources */,
                                5C9A9114228F69CE005C5B17 /* XPCServiceMain.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;