Title: [240973] trunk/Source/WebKit
Revision
240973
Author
[email protected]
Date
2019-02-05 07:36:02 -0800 (Tue, 05 Feb 2019)

Log Message

Add Networking Daemon skeleton
https://bugs.webkit.org/show_bug.cgi?id=194278

Reviewed by Zalan Bujtas.

Daemon skeletons? This is spooky stuff.

* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
* NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
(WebKit::DaemonMain):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
* Shared/API/Cocoa/WKMain.h:
* Shared/API/Cocoa/WKMain.mm:
(WKDaemonMain):
* Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
(main):
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240972 => 240973)


--- trunk/Source/WebKit/ChangeLog	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/ChangeLog	2019-02-05 15:36:02 UTC (rev 240973)
@@ -1,3 +1,27 @@
+2019-02-04  Alex Christensen  <[email protected]>
+
+        Add Networking Daemon skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=194278
+
+        Reviewed by Zalan Bujtas.
+
+        Daemon skeletons? This is spooky stuff.
+
+        * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added.
+        * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added.
+        (WebKit::DaemonMain):
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded):
+        * Shared/API/Cocoa/WKMain.h:
+        * Shared/API/Cocoa/WKMain.mm:
+        (WKDaemonMain):
+        * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp:
+        (main):
+        * SourcesCocoa.txt:
+        * UnifiedSources-input.xcfilelist:
+        * WebKit.xcodeproj/project.pbxproj:
+
 2019-02-04  Yusuke Suzuki  <[email protected]>
 
         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types

Added: trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h (0 => 240973)


--- trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h	                        (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h	2019-02-05 15:36:02 UTC (rev 240973)
@@ -0,0 +1,32 @@
+/*
+ * 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
+
+namespace WebKit {
+
+int DaemonMain(int, const char**);
+
+}

Added: trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm (0 => 240973)


--- trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm	                        (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm	2019-02-05 15:36:02 UTC (rev 240973)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+#import "config.h"
+#import "DaemonEntryPoint.h"
+
+namespace WebKit {
+
+int DaemonMain(int, const char**)
+{
+    return 0;
+}
+
+}

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h (240972 => 240973)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h	2019-02-05 15:36:02 UTC (rev 240973)
@@ -37,6 +37,7 @@
 
 namespace WebKit {
 
+class Download;
 class NetworkSessionCocoa;
 
 class NetworkDataTaskCocoa final : public NetworkDataTask {

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (240972 => 240973)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2019-02-05 15:36:02 UTC (rev 240973)
@@ -263,7 +263,7 @@
     }
 }
 
-void NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded(ResourceRequest& request, bool shouldBlockCookies)
+void NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded(WebCore::ResourceRequest& request, bool shouldBlockCookies)
 {
     if (shouldBlockCookies || (m_session->sessionID().isEphemeral() && isThirdPartyRequest(request)))
         request.setExistingHTTPReferrerToOriginString();

Modified: trunk/Source/WebKit/Shared/API/Cocoa/WKMain.h (240972 => 240973)


--- trunk/Source/WebKit/Shared/API/Cocoa/WKMain.h	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/Shared/API/Cocoa/WKMain.h	2019-02-05 15:36:02 UTC (rev 240973)
@@ -33,6 +33,7 @@
 #endif
 
 WK_EXPORT int WKXPCServiceMain(int argc, const char** argv) WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+WK_EXPORT int WKDaemonMain(int argc, const char** argv) WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 #ifdef __cplusplus
 }

Modified: trunk/Source/WebKit/Shared/API/Cocoa/WKMain.mm (240972 => 240973)


--- trunk/Source/WebKit/Shared/API/Cocoa/WKMain.mm	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/Shared/API/Cocoa/WKMain.mm	2019-02-05 15:36:02 UTC (rev 240973)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WKMain.h"
 
+#include "DaemonEntryPoint.h"
 #include "XPCServiceEntryPoint.h"
 
 int WKXPCServiceMain(int argc, const char** argv)
@@ -32,3 +33,8 @@
 {
     return WebKit::XPCServiceMain(argc, argv);
 }
+
+int WKDaemonMain(int argc, const char** argv)
+{
+    return WebKit::DaemonMain(argc, argv);
+}

Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp (240972 => 240973)


--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp	2019-02-05 15:36:02 UTC (rev 240973)
@@ -27,5 +27,7 @@
 
 int main(int argc, const char** argv)
 {
+    if (argc >= 2 && strstr(argv[1], "Daemon"))
+        return WKDaemonMain(argc, argv);
     return WKXPCServiceMain(argc, argv);
 }

Modified: trunk/Source/WebKit/SourcesCocoa.txt (240972 => 240973)


--- trunk/Source/WebKit/SourcesCocoa.txt	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2019-02-05 15:36:02 UTC (rev 240973)
@@ -39,6 +39,7 @@
 
 NetworkProcess/Downloads/cocoa/DownloadCocoa.mm
 
+NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm
 NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm
 
 NetworkProcess/ios/NetworkProcessIOS.mm

Modified: trunk/Source/WebKit/UnifiedSources-input.xcfilelist (240972 => 240973)


--- trunk/Source/WebKit/UnifiedSources-input.xcfilelist	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/UnifiedSources-input.xcfilelist	2019-02-05 15:36:02 UTC (rev 240973)
@@ -12,7 +12,8 @@
 $(SRCROOT)/NetworkProcess/Downloads/DownloadManager.cpp
 $(SRCROOT)/NetworkProcess/Downloads/PendingDownload.cpp
 $(SRCROOT)/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm
-$(SRCROOT)/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm
+$(SRCROOT)/NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm
+$(SRCROOT)/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm
 $(SRCROOT)/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
 $(SRCROOT)/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp
 $(SRCROOT)/NetworkProcess/NetworkActivityTracker.cpp

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (240972 => 240973)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-02-05 14:45:04 UTC (rev 240972)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-02-05 15:36:02 UTC (rev 240973)
@@ -1310,7 +1310,7 @@
 		A55BA8351BA3E70A007CD33D /* WebInspectorFrontendAPIDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A55BA8331BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.h */; };
 		A58B6F0818FCA733008CBA53 /* WKFileUploadPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = A58B6F0618FCA733008CBA53 /* WKFileUploadPanel.h */; };
 		A5C0F0A72000654D00536536 /* _WKNSWindowExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C0F0A62000654400536536 /* _WKNSWindowExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		A5C0F0AB2000658200536536 /* WKInspectorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C0F0AA2000656E00536536 /* _WKInspectorWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		A5C0F0AB2000658200536536 /* _WKInspectorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C0F0AA2000656E00536536 /* _WKInspectorWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E391FC2183C1E900C8FB31 /* InspectorTargetProxy.h */; };
 		A5EC6AD42151BD7B00677D17 /* WebPageDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EC6AD32151BD6900677D17 /* WebPageDebuggable.h */; };
 		A5EFD38C16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3449,6 +3449,8 @@
 		5C5CEC2E2209114800D6BBB0 /* WKMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMain.h; sourceTree = "<group>"; };
 		5C5CEC2F2209117E00D6BBB0 /* WKMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKMain.mm; sourceTree = "<group>"; };
 		5C5CEC31220912AF00D6BBB0 /* AuxiliaryProcessMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AuxiliaryProcessMain.cpp; path = Cocoa/AuxiliaryProcessMain.cpp; sourceTree = "<group>"; };
+		5C5CEC382209583200D6BBB0 /* DaemonEntryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaemonEntryPoint.h; sourceTree = "<group>"; };
+		5C5CEC392209583200D6BBB0 /* DaemonEntryPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DaemonEntryPoint.mm; sourceTree = "<group>"; };
 		5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskPrivate.h; sourceTree = "<group>"; };
 		5C6CE6D01F59BC460007C6CB /* PageClientImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImplCocoa.mm; sourceTree = "<group>"; };
 		5C6CE6D31F59EA350007C6CB /* PageClientImplCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImplCocoa.h; sourceTree = "<group>"; };
@@ -6858,6 +6860,16 @@
 			path = Cocoa;
 			sourceTree = "<group>";
 		};
+		5C5CEC372209581B00D6BBB0 /* Daemon */ = {
+			isa = PBXGroup;
+			children = (
+				5C5CEC382209583200D6BBB0 /* DaemonEntryPoint.h */,
+				5C5CEC392209583200D6BBB0 /* DaemonEntryPoint.mm */,
+			);
+			name = Daemon;
+			path = Cocoa/Daemon;
+			sourceTree = "<group>";
+		};
 		5C74300C21500434004BFA17 /* API */ = {
 			isa = PBXGroup;
 			children = (
@@ -8048,6 +8060,7 @@
 		BC82837C16B45DA500A278FE /* EntryPoint */ = {
 			isa = PBXGroup;
 			children = (
+				5C5CEC372209581B00D6BBB0 /* Daemon */,
 				BC8283A116B4BD9100A278FE /* XPCService */,
 			);
 			path = EntryPoint;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to