Unreviewed, rolling out r192667 and r192668.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Nov 2015 03:52:56 +0000 (03:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Nov 2015 03:52:56 +0000 (03:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151476

broke api tests (Requested by alexchristensen on #webkit).

Reverted changesets:

"Remove the non-NetworkProcess configurations"
https://bugs.webkit.org/show_bug.cgi?id=151418
http://trac.webkit.org/changeset/192667

"Fix GTK Build after r192667."
http://trac.webkit.org/changeset/192668

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

113 files changed:
ChangeLog
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/EntryPoint/mac/LegacyProcess/NetworkProcessMain.mm
Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit2/NetworkProcess/NetworkLoad.cpp
Source/WebKit2/NetworkProcess/NetworkLoad.h
Source/WebKit2/NetworkProcess/NetworkLoadClient.h
Source/WebKit2/NetworkProcess/NetworkLoadParameters.cpp
Source/WebKit2/NetworkProcess/NetworkLoadParameters.h
Source/WebKit2/NetworkProcess/NetworkProcess.cpp
Source/WebKit2/NetworkProcess/NetworkProcess.h
Source/WebKit2/NetworkProcess/NetworkProcess.messages.in
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/NetworkResourceLoader.h
Source/WebKit2/NetworkProcess/NetworkResourceLoader.messages.in
Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit2/NetworkProcess/efl/NetworkProcessMainEfl.cpp
Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp
Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm
Source/WebKit2/NetworkProcess/mac/NetworkLoadMac.mm
Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm
Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm
Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit2/NetworkProcess/soup/RemoteNetworkingContextSoup.cpp
Source/WebKit2/Shared/API/c/WKDeprecatedFunctions.cpp
Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp
Source/WebKit2/Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm
Source/WebKit2/Shared/Network/CustomProtocols/CustomProtocolManager.h
Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp
Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp
Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h
Source/WebKit2/Shared/Network/NetworkProcessSupplement.h
Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp
Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h
Source/WebKit2/Shared/ProcessExecutablePath.h
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/Shared/efl/ProcessExecutablePathEfl.cpp
Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp
Source/WebKit2/Shared/mac/CookieStorageShim.h
Source/WebKit2/Shared/mac/CookieStorageShim.mm
Source/WebKit2/Shared/mac/CookieStorageShimLibrary.cpp
Source/WebKit2/Shared/mac/CookieStorageShimLibrary.h
Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp
Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit2/UIProcess/API/APISession.cpp
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKContext.h
Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessGroup.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm
Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp
Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp
Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h
Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in
Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm
Source/WebKit2/UIProcess/Network/soup/NetworkProcessProxySoup.cpp
Source/WebKit2/UIProcess/ProcessModel.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessPool.h
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/WebProcessProxy.messages.in
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp
Source/WebKit2/UIProcess/soup/WebProcessPoolSoup.cpp
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebKit2Prefix.h
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h
Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp
Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h
Source/WebKit2/WebProcess/Network/NetworkProcessConnection.messages.in
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.h
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.h
Source/WebKit2/WebProcess/Network/WebResourceLoader.messages.in
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
Source/WebKit2/config.h
Source/cmake/OptionsEfl.cmake
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsMac.cmake
Source/cmake/WebKitFeatures.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp
Tools/WebKitTestRunner/TestController.cpp

index 078ab95..4101153 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-11-19  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r192667 and r192668.
+        https://bugs.webkit.org/show_bug.cgi?id=151476
+
+        broke api tests (Requested by alexchristensen on #webkit).
+
+        Reverted changesets:
+
+        "Remove the non-NetworkProcess configurations"
+        https://bugs.webkit.org/show_bug.cgi?id=151418
+        http://trac.webkit.org/changeset/192667
+
+        "Fix GTK Build after r192667."
+        http://trac.webkit.org/changeset/192668
+
 2015-11-19  Alex Christensen  <achristensen@webkit.org>
 
         Remove the non-NetworkProcess configurations
index a274dc8..03ffe98 100644 (file)
@@ -803,13 +803,16 @@ if (WebKit2_WebProcess_OUTPUT_NAME)
     set_target_properties(WebProcess PROPERTIES OUTPUT_NAME ${WebKit2_WebProcess_OUTPUT_NAME})
 endif ()
 
-add_executable(NetworkProcess ${NetworkProcess_SOURCES})
-add_webkit2_prefix_header(NetworkProcess)
-target_link_libraries(NetworkProcess ${NetworkProcess_LIBRARIES})
-set_target_properties(NetworkProcess PROPERTIES FOLDER "WebKit")
-
-if (WebKit2_NetworkProcess_OUTPUT_NAME)
-    set_target_properties(NetworkProcess PROPERTIES OUTPUT_NAME ${WebKit2_NetworkProcess_OUTPUT_NAME})
+if (ENABLE_NETWORK_PROCESS)
+    add_executable(NetworkProcess ${NetworkProcess_SOURCES})
+    add_webkit2_prefix_header(NetworkProcess)
+    target_link_libraries(NetworkProcess ${NetworkProcess_LIBRARIES})
+    set_target_properties(NetworkProcess PROPERTIES FOLDER "WebKit")
+    install(TARGETS NetworkProcess DESTINATION "${LIBEXEC_INSTALL_DIR}")
+
+    if (WebKit2_NetworkProcess_OUTPUT_NAME)
+        set_target_properties(NetworkProcess PROPERTIES OUTPUT_NAME ${WebKit2_NetworkProcess_OUTPUT_NAME})
+    endif ()
 endif ()
 
 if (ENABLE_PLUGIN_PROCESS)
@@ -844,7 +847,7 @@ set_target_properties(WebKit2 PROPERTIES VERSION ${WEBKIT2_VERSION} SOVERSION ${
 if (APPLE)
     WEBKIT_FRAMEWORK(WebKit2)
 else ()
-    install(TARGETS WebKit2 WebProcess NetworkProcess
+    install(TARGETS WebKit2 WebProcess
         LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
         RUNTIME DESTINATION "${LIBEXEC_INSTALL_DIR}"
     )
index a4df322..499a995 100644 (file)
@@ -1,3 +1,19 @@
+2015-11-19  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r192667 and r192668.
+        https://bugs.webkit.org/show_bug.cgi?id=151476
+
+        broke api tests (Requested by alexchristensen on #webkit).
+
+        Reverted changesets:
+
+        "Remove the non-NetworkProcess configurations"
+        https://bugs.webkit.org/show_bug.cgi?id=151418
+        http://trac.webkit.org/changeset/192667
+
+        "Fix GTK Build after r192667."
+        http://trac.webkit.org/changeset/192668
+
 2015-11-19  Alex Christensen  <achristensen@webkit.org>
 
         Fix GTK Build after r192667.
index 403feaf..87b9e40 100644 (file)
@@ -25,6 +25,8 @@
 
 #import "config.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #import "ChildProcessEntryPoint.h"
 #import "NetworkProcess.h"
 #import "WKBase.h"
@@ -37,3 +39,5 @@ int NetworkProcessMain(int argc, char** argv)
 {
     return ChildProcessMain<NetworkProcess, ChildProcessMainDelegate>(argc, argv);
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index 7251035..41fb44e 100644 (file)
@@ -52,6 +52,7 @@ extern "C" WK_EXPORT void NetworkServiceInitializer(xpc_connection_t connection,
 
 void NetworkServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage)
 {
+#if ENABLE(NETWORK_PROCESS)
     // Remove the SecItemShim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
     // the this process don't try to insert the shim and crash.
     EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/SecItemShim.dylib");
@@ -68,4 +69,5 @@ void NetworkServiceInitializer(xpc_connection_t connection, xpc_object_t initial
 #if HAVE(OS_ACTIVITY)
     os_activity_end(activity);
 #endif
+#endif
 }
index 3a6f452..cb197ce 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetworkBlobRegistry.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "BlobDataFileReferenceWithSandboxExtension.h"
 #include "SandboxExtension.h"
 #include <WebCore/BlobPart.h>
@@ -149,3 +151,5 @@ Vector<RefPtr<BlobDataFileReference>> NetworkBlobRegistry::filesInBlob(NetworkCo
 }
 
 }
+
+#endif
index a729578..16fdcee 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkBlobRegistry_h
 #define NetworkBlobRegistry_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include <WebCore/URLHash.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
@@ -66,4 +68,6 @@ private:
 
 }
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkBlobRegistry_h
index a64538c..c82e3f0 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetworkConnectionToWebProcess.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "NetworkBlobRegistry.h"
 #include "NetworkConnectionToWebProcessMessages.h"
 #include "NetworkLoad.h"
@@ -272,3 +274,5 @@ void NetworkConnectionToWebProcess::blobSize(const URL& url, uint64_t& resultSiz
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index e455bc7..0fca5ce 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkConnectionToWebProcess_h
 #define NetworkConnectionToWebProcess_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "BlockingResponseMap.h"
 #include "Connection.h"
 #include "NetworkConnectionToWebProcessMessages.h"
@@ -100,4 +102,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkConnectionToWebProcess_h
index ac770d2..7ce3971 100644 (file)
@@ -20,6 +20,8 @@
 # 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 ENABLE(NETWORK_PROCESS)
+
 messages -> NetworkConnectionToWebProcess LegacyReceiver {
 
     ScheduleResourceLoad(WebKit::NetworkResourceLoadParameters resourceLoadParameters)
@@ -46,3 +48,5 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver {
     UnregisterBlobURL(WebCore::URL url)
     BlobSize(WebCore::URL url) -> (uint64_t resultSize)
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index c8df672..c9881b7 100644 (file)
@@ -24,6 +24,8 @@
  */
 
 #include "config.h"
+
+#if ENABLE(NETWORK_PROCESS)
 #include "NetworkLoad.h"
 
 #include "AuthenticationManager.h"
@@ -369,3 +371,5 @@ void NetworkLoad::receivedCancellation(ResourceHandle* handle, const Authenticat
 #endif // !USE(NETWORK_SESSION)
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index ec1b24e..9b7d13f 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkLoad_h
 #define NetworkLoad_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "NetworkLoadClient.h"
 #include "NetworkLoadParameters.h"
 #include "RemoteNetworkingContext.h"
@@ -124,4 +126,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkLoad_h
index b45d402..ba486b7 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkLoadClient_h
 #define NetworkLoadClient_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include <WebCore/ResourceError.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/ResourceResponse.h>
@@ -64,5 +66,7 @@ public:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkLoadClient_h
 
index cc84875..d0b7b11 100644 (file)
@@ -24,6 +24,8 @@
  */
 
 #include "config.h"
+
+#if ENABLE(NETWORK_PROCESS)
 #include "NetworkLoadParameters.h"
 
 #include "NetworkResourceLoadParameters.h"
@@ -45,3 +47,5 @@ NetworkLoadParameters::NetworkLoadParameters(const NetworkResourceLoadParameters
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 130aaa3..7cb3762 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkLoadParameters_h
 #define NetworkLoadParameters_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include <WebCore/ResourceLoaderOptions.h>
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/SessionID.h>
@@ -53,4 +55,6 @@ public:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkLoadParameters_h
index db70eb0..684a2e7 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetworkProcess.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "ArgumentCoders.h"
 #include "Attachment.h"
 #include "AuthenticationManager.h"
@@ -552,3 +554,5 @@ void NetworkProcess::platformLowMemoryHandler(Critical)
 #endif
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 8dc8a63..23070d1 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkProcess_h
 #define NetworkProcess_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "CacheModel.h"
 #include "ChildProcess.h"
 #include "DownloadManager.h"
@@ -195,4 +197,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkProcess_h
index 017a28e..3bf29cf 100644 (file)
@@ -20,6 +20,8 @@
 # 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 ENABLE(NETWORK_PROCESS)
+
 messages -> NetworkProcess LegacyReceiver {
     # Initializes the network process.
     InitializeNetworkProcess(struct WebKit::NetworkProcessCreationParameters processCreationParameters)
@@ -61,3 +63,5 @@ messages -> NetworkProcess LegacyReceiver {
     CancelPrepareToSuspend()
     ProcessDidResume()
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index 9082e38..3252163 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetworkResourceLoader.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "DataReference.h"
 #include "Logging.h"
 #include "NetworkBlobRegistry.h"
@@ -579,3 +581,5 @@ void NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace(bool r
 #endif
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index bf13683..ae8cac2 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkResourceLoader_h
 #define NetworkResourceLoader_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "MessageSender.h"
 #include "NetworkConnectionToWebProcessMessages.h"
 #include "NetworkLoadClient.h"
@@ -167,4 +169,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkResourceLoader_h
index ebb8d7c..79a35af 100644 (file)
@@ -20,6 +20,8 @@
 # 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 ENABLE(NETWORK_PROCESS)
+
 messages -> NetworkResourceLoader LegacyReceiver {
 
     ContinueWillSendRequest(WebCore::ResourceRequest request)
@@ -28,3 +30,5 @@ messages -> NetworkResourceLoader LegacyReceiver {
     ContinueCanAuthenticateAgainstProtectionSpace(bool canAuthenticate)
 #endif
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index 3abcf69..5d55cea 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "NetworkProcess.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #import "NetworkCache.h"
 #import "NetworkProcessCreationParameters.h"
 #import "NetworkResourceLoader.h"
@@ -265,3 +267,5 @@ void NetworkProcess::clearDiskCache(std::chrono::system_clock::time_point modifi
 }
 
 }
+
+#endif
index 432c12a..44e22ea 100644 (file)
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "NetworkProcessMainUnix.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "ChildProcessMain.h"
 #include "NetworkProcess.h"
 #include <Ecore.h>
@@ -68,3 +70,5 @@ int NetworkProcessMainUnix(int argc, char** argv)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index aebc285..6855e31 100644 (file)
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "NetworkProcessMainUnix.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "ChildProcessMain.h"
 #include "NetworkProcess.h"
 #include <WebCore/SoupNetworkSession.h>
@@ -61,3 +63,5 @@ int NetworkProcessMainUnix(int argc, char** argv)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index bd04828..cd5dec6 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "NetworkProcess.h"
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && ENABLE(NETWORK_PROCESS)
 
 #import "NetworkCache.h"
 #import "NetworkProcessCreationParameters.h"
@@ -101,4 +101,4 @@ void NetworkProcess::platformTerminate()
 
 } // namespace WebKit
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) && ENABLE(NETWORK_PROCESS)
index d8d2d38..f98e490 100644 (file)
@@ -24,6 +24,8 @@
  */
 
 #import "config.h"
+
+#if ENABLE(NETWORK_PROCESS)
 #import "NetworkLoad.h"
 
 #import <WebCore/CFNetworkSPI.h>
@@ -58,3 +60,5 @@ void NetworkLoad::willCacheResponseAsync(ResourceHandle* handle, NSCachedURLResp
 #endif // !USE(CFNETWORK)
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 284e5b7..fac11a4 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "NetworkProcess.h"
 
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && ENABLE(NETWORK_PROCESS)
 
 #import "NetworkCache.h"
 #import "NetworkProcessCreationParameters.h"
@@ -144,4 +144,4 @@ void NetworkProcess::platformTerminate()
 
 } // namespace WebKit
 
-#endif // PLATFORM(MAC)
+#endif // PLATFORM(MAC) && ENABLE(NETWORK_PROCESS)
index a6d1267..8a286e6 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "NetworkResourceLoader.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #import "NetworkDiskCacheMonitor.h"
 #import "ShareableResource.h"
 #import <WebCore/CFNetworkSPI.h>
@@ -89,3 +91,5 @@ void NetworkResourceLoader::willCacheResponseAsync(CFCachedURLResponseRef cfResp
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
index c2fd1fc..f9a0ff8 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "config.h"
+#if ENABLE(NETWORK_PROCESS)
 #include "NetworkProcess.h"
 
 #include "NetworkCache.h"
@@ -169,3 +170,5 @@ void NetworkProcess::platformTerminate()
 }
 
 } // namespace WebKit
+
+#endif
index 6aecb7f..6da4d68 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include "config.h"
+#if ENABLE(NETWORK_PROCESS)
 #include "RemoteNetworkingContext.h"
 
 #include <WebCore/NetworkStorageSession.h>
@@ -56,3 +57,5 @@ NetworkStorageSession& RemoteNetworkingContext::storageSession() const
 }
 
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index d0df667..937f87b 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "APIDictionary.h"
 #include "WKArray.h"
-#include "WKContext.h"
-#include "WKContextPrivate.h"
 #include "WKMutableDictionary.h"
 #include "WKPreferencesRefPrivate.h"
 #include "WKSharedAPICast.h"
@@ -136,19 +134,6 @@ void WKInspectorToggleJavaScriptProfiling(WKInspectorRef)
 {
 }
 
-void WKContextSetProcessModel(WKContextRef, WKProcessModel)
-{
-}
-
-WKProcessModel WKContextGetProcessModel(WKContextRef)
-{
-    return kWKProcessModelMultipleSecondaryProcesses;
-}
-
-void WKContextSetUsesNetworkProcess(WKContextRef, bool)
-{
-}
-
 #if PLATFORM(MAC)
 CGContextRef WKGraphicsContextGetCGContext(WKGraphicsContextRef graphicsContext)
 {
index a5184c9..716805a 100644 (file)
@@ -30,7 +30,6 @@
 #include "ChildProcess.h"
 #include "Download.h"
 #include "DownloadProxyMessages.h"
-#include "NetworkProcessProxyMessages.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebFrame.h"
 #include "WebPage.h"
 #include <WebCore/AuthenticationChallenge.h>
 #include <WebCore/AuthenticationClient.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessProxyMessages.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -125,6 +128,7 @@ void AuthenticationManager::didReceiveAuthenticationChallenge(WebFrame* frame, c
     m_process->send(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, challengeID), frame->page()->pageID());
 }
 
+#if ENABLE(NETWORK_PROCESS)
 #if USE(NETWORK_SESSION)
 void AuthenticationManager::didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler completionHandler)
 {
@@ -153,6 +157,7 @@ void AuthenticationManager::didReceiveAuthenticationChallenge(uint64_t pageID, u
     
     m_process->send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(pageID, frameID, authenticationChallenge, challengeID));
 }
+#endif
 
 #if !USE(NETWORK_SESSION)
 void AuthenticationManager::didReceiveAuthenticationChallenge(Download* download, const AuthenticationChallenge& authenticationChallenge)
index 1443f16..e388255 100644 (file)
@@ -30,7 +30,6 @@
 #import "CustomProtocolManagerMessages.h"
 #import "CustomProtocolManagerProxyMessages.h"
 #import "DataReference.h"
-#import "NetworkProcessCreationParameters.h"
 #import "WebCoreArgumentCoders.h"
 #import "WebProcessCreationParameters.h"
 #import <WebCore/URL.h>
 #import <WebCore/ResourceRequest.h>
 #import <WebCore/ResourceResponse.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#import "NetworkProcessCreationParameters.h"
+#endif
+
 #ifdef __has_include
 #if __has_include(<Foundation/NSURLConnectionPrivate.h>)
 #import <Foundation/NSURLConnectionPrivate.h>
@@ -134,11 +137,22 @@ void CustomProtocolManager::initializeConnection(IPC::Connection* connection)
 
 void CustomProtocolManager::initialize(const WebProcessCreationParameters& parameters)
 {
-    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty());
-    m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
-    m_messageQueue = nullptr;
+#if ENABLE(NETWORK_PROCESS)
+    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty() || !parameters.usesNetworkProcess);
+    if (parameters.usesNetworkProcess) {
+        m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
+        m_messageQueue = nullptr;
+        return;
+    }
+#endif
+
+    [NSURLProtocol registerClass:[WKCustomProtocol class]];
+
+    for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
+        registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
 }
 
+#if ENABLE(NETWORK_PROCESS)
 void CustomProtocolManager::initialize(const NetworkProcessCreationParameters& parameters)
 {
     [NSURLProtocol registerClass:[WKCustomProtocol class]];
@@ -146,6 +160,7 @@ void CustomProtocolManager::initialize(const NetworkProcessCreationParameters& p
     for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
         registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
 }
+#endif
 
 void CustomProtocolManager::addCustomProtocol(WKCustomProtocol *customProtocol)
 {
index c4857b1..098009c 100644 (file)
@@ -83,8 +83,10 @@ private:
     // WebProcessSupplement
     void initialize(const WebProcessCreationParameters&) override;
 
+#if ENABLE(NETWORK_PROCESS)
     // NetworkProcessSupplement
     void initialize(const NetworkProcessCreationParameters&) override;
+#endif
 
     // IPC::MessageReceiver
     virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
index b30fe73..a65ca08 100644 (file)
 #include "ChildProcess.h"
 #include "CustomProtocolManagerImpl.h"
 #include "CustomProtocolManagerMessages.h"
-#include "NetworkProcessCreationParameters.h"
 #include "WebProcessCreationParameters.h"
 #include <WebCore/NotImplemented.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessCreationParameters.h"
+#endif
+
 namespace WebKit {
 
 const char* CustomProtocolManager::supplementName()
@@ -48,16 +51,25 @@ void CustomProtocolManager::initializeConnection(IPC::Connection* connection)
 
 void CustomProtocolManager::initialize(const WebProcessCreationParameters& parameters)
 {
-    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty());
-    m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
-    m_messageQueue = nullptr;
+#if ENABLE(NETWORK_PROCESS)
+    ASSERT(parameters.urlSchemesRegisteredForCustomProtocols.isEmpty() || !parameters.usesNetworkProcess);
+    if (parameters.usesNetworkProcess) {
+        m_childProcess->parentProcessConnection()->removeWorkQueueMessageReceiver(Messages::CustomProtocolManager::messageReceiverName());
+        m_messageQueue = nullptr;
+        return;
+    }
+#endif
+    for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
+        registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
 }
 
+#if ENABLE(NETWORK_PROCESS)
 void CustomProtocolManager::initialize(const NetworkProcessCreationParameters& parameters)
 {
     for (size_t i = 0; i < parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
         registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
 }
+#endif
 
 void CustomProtocolManager::registerScheme(const String& scheme)
 {
index 751fbb1..a37bbe3 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetworkProcessCreationParameters.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "ArgumentCoders.h"
 
 #if PLATFORM(COCOA)
@@ -166,3 +168,5 @@ bool NetworkProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, Net
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 71d1333..90869c1 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkProcessCreationParameters_h
 #define NetworkProcessCreationParameters_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "CacheModel.h"
 #include "SandboxExtension.h"
 #include <wtf/Vector.h>
@@ -101,4 +103,6 @@ struct NetworkProcessCreationParameters {
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkProcessCreationParameters_h
index e2b46b3..d6fbe5b 100644 (file)
@@ -33,10 +33,12 @@ namespace WebKit {
 struct NetworkProcessCreationParameters;
 
 class NetworkProcessSupplement : public ChildProcessSupplement {
+#if ENABLE(NETWORK_PROCESS)
 public:
     virtual void initialize(const NetworkProcessCreationParameters&)
     {
     }
+#endif
 };
 
 } // namespace WebKit
index f4c58a5..c5d8465 100644 (file)
@@ -30,6 +30,8 @@
 #include "DataReference.h"
 #include "WebCoreArgumentCoders.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -158,3 +160,5 @@ bool NetworkResourceLoadParameters::decode(IPC::ArgumentDecoder& decoder, Networ
 }
     
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 2f1528a..2e8b91c 100644 (file)
@@ -32,6 +32,8 @@
 #include <WebCore/ResourceRequest.h>
 #include <WebCore/SessionID.h>
 
+#if ENABLE(NETWORK_PROCESS)
+
 namespace IPC {
     class ArgumentDecoder;
     class ArgumentEncoder;
@@ -66,4 +68,6 @@ public:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkResourceLoadParameters_h
index b007584..4ffd11b 100644 (file)
@@ -32,7 +32,9 @@ namespace WebKit {
 
 String executablePathOfWebProcess();
 String executablePathOfPluginProcess();
+#if ENABLE(NETWORK_PROCESS)
 String executablePathOfNetworkProcess();
+#endif
 #if ENABLE(DATABASE_PROCESS)
 String executablePathOfDatabaseProcess();
 #endif
index 0925295..1e631a0 100644 (file)
@@ -43,6 +43,9 @@ WebProcessCreationParameters::WebProcessCreationParameters()
     , shouldEnableJIT(false)
     , shouldEnableFTLJIT(false)
 #endif
+#if ENABLE(NETWORK_PROCESS)
+    , usesNetworkProcess(false)
+#endif
     , memoryCacheDisabled(false)
 #if ENABLE(SERVICE_CONTROLS)
     , hasImageServices(false)
@@ -130,6 +133,10 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
     encoder << notificationPermissions;
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+    encoder << usesNetworkProcess;
+#endif
+
     encoder << plugInAutoStartOriginHashes;
     encoder << plugInAutoStartOrigins;
     encoder << memoryCacheDisabled;
@@ -284,6 +291,11 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
         return false;
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+    if (!decoder.decode(parameters.usesNetworkProcess))
+        return false;
+#endif
+
     if (!decoder.decode(parameters.plugInAutoStartOriginHashes))
         return false;
     if (!decoder.decode(parameters.plugInAutoStartOrigins))
index cad5b70..b838a97 100644 (file)
@@ -154,6 +154,10 @@ struct WebProcessCreationParameters {
     HashMap<String, bool> notificationPermissions;
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+    bool usesNetworkProcess;
+#endif
+
     HashMap<WebCore::SessionID, HashMap<unsigned, double>> plugInAutoStartOriginHashes;
     Vector<String> plugInAutoStartOrigins;
 
index e5350fe..3d53604 100644 (file)
@@ -81,12 +81,14 @@ String executablePathOfPluginProcess()
     return webKitPluginProcessName;
 }
 
+#if ENABLE(NETWORK_PROCESS)
 String executablePathOfNetworkProcess()
 {
     static NeverDestroyed<const String> webKitNetworkProcessName(findProcessPath(NETWORKPROCESSNAME));
 
     return webKitNetworkProcessName;
 }
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
 String executablePathOfDatabaseProcess()
index 22f705b..91fc580 100644 (file)
@@ -79,10 +79,12 @@ String executablePathOfPluginProcess()
     return findWebKitProcess("WebKitPluginProcess");
 }
 
+#if ENABLE(NETWORK_PROCESS)
 String executablePathOfNetworkProcess()
 {
     return findWebKitProcess("WebKitNetworkProcess");
 }
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
 String executablePathOfDatabaseProcess()
index 55ec761..ab34224 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef CookieStorageShim_h
 #define CookieStorageShim_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include <wtf/Noncopyable.h>
 #include <wtf/NeverDestroyed.h>
 
@@ -47,4 +49,6 @@ private:
 
 }
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // CookieStorageShim_h
index 7011763..043d656 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CookieStorageShim.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "CookieStorageShimLibrary.h"
 #include "NetworkConnectionToWebProcess.h"
 #include "NetworkProcessConnection.h"
@@ -133,3 +135,5 @@ using CompletionHandlerBlock = void(^)(CFDictionaryRef);
 }
 
 @end
+
+#endif // ENABLE(NETWORK_PROCESS)
index df7f896..677db27 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "CookieStorageShimLibrary.h"
 
-#if !PLATFORM(IOS)
+#if ENABLE(NETWORK_PROCESS) && !PLATFORM(IOS)
 
 #include <WebCore/DynamicLinkerInterposing.h>
 
@@ -90,4 +90,4 @@ void WebKitCookieStorageShimInitialize(const CookieStorageShimCallbacks& callbac
     
 }
 
-#endif // !PLATFORM(IOS)
+#endif // ENABLE(NETWORK_PROCESS) && !PLATFORM(IOS)
index 7747fc9..3108e0a 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef CookieStorageShimLibrary_h
 #define CookieStorageShimLibrary_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
 
 namespace WebKit {
@@ -38,4 +40,6 @@ typedef void (*CookieStorageShimInitializeFunc)(const CookieStorageShimCallbacks
 
 }
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // CookieStorageShimLibrary_h
index ff76551..0dc8e29 100644 (file)
@@ -41,6 +41,7 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::createWithLegacyOptions(
     auto configuration = ProcessPoolConfiguration::create();
 
     configuration->m_shouldHaveLegacyDataStore = true;
+    configuration->m_processModel = WebKit::ProcessModelSharedSecondaryProcess;
     configuration->m_useNetworkProcess = false;
     configuration->m_cacheModel = WebKit::CacheModelDocumentViewer;
 
@@ -73,6 +74,7 @@ Ref<ProcessPoolConfiguration> ProcessPoolConfiguration::copy()
     auto copy = this->create();
 
     copy->m_shouldHaveLegacyDataStore = this->m_shouldHaveLegacyDataStore;
+    copy->m_processModel = this->m_processModel;
     copy->m_useNetworkProcess = this->m_useNetworkProcess;
     copy->m_maximumProcessCount = this->m_maximumProcessCount;
     copy->m_cacheModel = this->m_cacheModel;
index 9d5e25b..6dc9f2a 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "APIObject.h"
 #include "CacheModel.h"
+#include "ProcessModel.h"
 #include <wtf/Ref.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
@@ -47,6 +48,9 @@ public:
     bool shouldHaveLegacyDataStore() const { return m_shouldHaveLegacyDataStore; }
     void setShouldHaveLegacyDataStore(bool shouldHaveLegacyDataStore) { m_shouldHaveLegacyDataStore = shouldHaveLegacyDataStore; }
 
+    WebKit::ProcessModel processModel() const { return m_processModel; }
+    void setProcessModel(WebKit::ProcessModel processModel) { m_processModel = processModel; } 
+
     bool useNetworkProcess() const { return m_useNetworkProcess; }
     void setUseNetworkProcess(bool useNetworkProcess) { m_useNetworkProcess = useNetworkProcess; } 
 
@@ -92,6 +96,7 @@ public:
 private:
     bool m_shouldHaveLegacyDataStore { false };
 
+    WebKit::ProcessModel m_processModel { WebKit::ProcessModelMultipleSecondaryProcesses };
     bool m_useNetworkProcess { true };
     unsigned m_maximumProcessCount { 0 };
     WebKit::CacheModel m_cacheModel { WebKit::CacheModelPrimaryWebBrowser };
index 6c460dc..a296e76 100644 (file)
 
 #include <wtf/RunLoop.h>
 
+#if ENABLE(NETWORK_PROCESS)
 #include "NetworkProcessMessages.h"
 #include "WebProcessPool.h"
+#endif
 
 namespace API {
 
@@ -78,10 +80,12 @@ WebCore::SessionID Session::getID() const
 
 Session::~Session()
 {
+#if ENABLE(NETWORK_PROCESS)
     if (m_sessionID.isEphemeral()) {
         for (auto& processPool : WebKit::WebProcessPool::allProcessPools())
             processPool->sendToNetworkingProcess(Messages::NetworkProcess::DestroyPrivateBrowsingSession(m_sessionID));
     }
+#endif
 }
 
 } // namespace API
index 4846ea3..8cbb8d5 100644 (file)
@@ -32,6 +32,7 @@
 #include "HTTPCookieAcceptPolicy.h"
 #include "InjectedBundleHitTestResultMediaType.h"
 #include "PluginModuleInfo.h"
+#include "ProcessModel.h"
 #include "ResourceCachesToClear.h"
 #include "WKBundleHitTestResult.h"
 #include "WKContext.h"
@@ -229,6 +230,31 @@ inline WKCacheModel toAPI(CacheModel cacheModel)
     return kWKCacheModelDocumentViewer;
 }
 
+inline ProcessModel toProcessModel(WKProcessModel wkProcessModel)
+{
+    switch (wkProcessModel) {
+    case kWKProcessModelSharedSecondaryProcess:
+        return ProcessModelSharedSecondaryProcess;
+    case kWKProcessModelMultipleSecondaryProcesses:
+        return ProcessModelMultipleSecondaryProcesses;
+    }
+
+    ASSERT_NOT_REACHED();
+    return ProcessModelSharedSecondaryProcess;
+}
+
+inline WKProcessModel toAPI(ProcessModel processModel)
+{
+    switch (processModel) {
+    case ProcessModelSharedSecondaryProcess:
+        return kWKProcessModelSharedSecondaryProcess;
+    case ProcessModelMultipleSecondaryProcesses:
+        return kWKProcessModelMultipleSecondaryProcesses;
+    }
+    
+    return kWKProcessModelSharedSecondaryProcess;
+}
+
 inline FontSmoothingLevel toFontSmoothingLevel(WKFontSmoothingLevel wkLevel)
 {
     switch (wkLevel) {
index 8768792..7025313 100644 (file)
@@ -329,6 +329,16 @@ WKCacheModel WKContextGetCacheModel(WKContextRef contextRef)
     return toAPI(toImpl(contextRef)->cacheModel());
 }
 
+void WKContextSetProcessModel(WKContextRef contextRef, WKProcessModel processModel)
+{
+    toImpl(contextRef)->setProcessModel(toProcessModel(processModel));
+}
+
+WKProcessModel WKContextGetProcessModel(WKContextRef contextRef)
+{
+    return toAPI(toImpl(contextRef)->processModel());
+}
+
 void WKContextSetMaximumNumberOfProcesses(WKContextRef contextRef, unsigned numberOfProcesses)
 {
     toImpl(contextRef)->setMaximumNumberOfProcesses(numberOfProcesses);
@@ -544,6 +554,11 @@ void WKContextSetJavaScriptGarbageCollectorTimerEnabled(WKContextRef contextRef,
     toImpl(contextRef)->setJavaScriptGarbageCollectorTimerEnabled(enable);
 }
 
+void WKContextSetUsesNetworkProcess(WKContextRef contextRef, bool usesNetworkProcess)
+{
+    toImpl(contextRef)->setUsesNetworkProcess(usesNetworkProcess);
+}
+
 void WKContextUseTestingNetworkSession(WKContextRef context)
 {
     toImpl(context)->useTestingNetworkSession();
index 6de013e..1b3d82c 100644 (file)
@@ -75,7 +75,6 @@ typedef struct WKContextClientV1 {
     WKContextCopyWebCryptoMasterKeyCallback                             copyWebCryptoMasterKey;
 } WKContextClientV1;
 
-// FIXME: These can be removed once we are no longer supporting Mavericks.
 enum {
     kWKProcessModelSharedSecondaryProcess = 0,
     kWKProcessModelMultipleSecondaryProcesses = 1
index 43a2362..9a28dab 100644 (file)
@@ -166,5 +166,10 @@ bool WKContextShouldSuggestBlockWebGL()
 
 pid_t WKContextGetNetworkProcessIdentifier(WKContextRef contextRef)
 {
+#if ENABLE(NETWORK_PROCESS)
     return toImpl(contextRef)->networkProcessIdentifier();
+#else
+    UNUSED_PARAM(contextRef);
+    return 0;
+#endif
 }
index ecfc80f..84a7681 100644 (file)
@@ -192,6 +192,10 @@ static void setUpHistoryClient(WKProcessGroup *processGroup, WKContextRef contex
 
     auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
     configuration->setInjectedBundlePath(bundleURL ? String(bundleURL.path) : String());
+#if PLATFORM(IOS)
+    configuration->setUseNetworkProcess(true);
+    configuration->setProcessModel(ProcessModelMultipleSecondaryProcesses);
+#endif
 
     _processPool = WebProcessPool::create(configuration);
 
index 18fda50..9681ae8 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "CacheModel.h"
 #import "DownloadClient.h"
+#import "ProcessModel.h"
 #import "SandboxUtilities.h"
 #import "WKObject.h"
 #import "WeakObjCPtr.h"
index 69719d7..8570350 100644 (file)
@@ -570,18 +570,29 @@ void ewk_context_message_from_extensions_callback_set(Ewk_Context* ewkContext, E
 
 Eina_Bool ewk_context_process_model_set(Ewk_Context* ewkContext, Ewk_Process_Model processModel)
 {
+#if ENABLE(NETWORK_PROCESS)
     EWK_OBJ_GET_IMPL_OR_RETURN(EwkContext, ewkContext, impl, false);
 
     impl->setProcessModel(processModel);
 
     return true;
+#else
+    UNUSED_PARAM(ewkContext);
+    UNUSED_PARAM(processModel);
+    return false;
+#endif
 }
 
 Ewk_Process_Model ewk_context_process_model_get(const Ewk_Context* ewkContext)
 {
+#if ENABLE(NETWORK_PROCESS)
     EWK_OBJ_GET_IMPL_OR_RETURN(const EwkContext, ewkContext, impl, EWK_PROCESS_MODEL_SHARED_SECONDARY);
 
     return impl->processModel();
+#else
+    UNUSED_PARAM(ewkContext);
+    return EWK_PROCESS_MODEL_SHARED_SECONDARY;
+#endif
 }
 
 Ewk_TLS_Error_Policy ewk_context_tls_error_policy_get(const Ewk_Context* context)
index 41e843b..9fbc511 100644 (file)
@@ -193,6 +193,32 @@ static guint signals[LAST_SIGNAL] = { 0, };
 
 WEBKIT_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT)
 
+static inline WebKit::ProcessModel toProcessModel(WebKitProcessModel webKitProcessModel)
+{
+    switch (webKitProcessModel) {
+    case WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS:
+        return ProcessModelSharedSecondaryProcess;
+    case WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES:
+        return ProcessModelMultipleSecondaryProcesses;
+    default:
+        ASSERT_NOT_REACHED();
+        return ProcessModelSharedSecondaryProcess;
+    }
+}
+
+static inline WebKitProcessModel toWebKitProcessModel(WebKit::ProcessModel processModel)
+{
+    switch (processModel) {
+    case ProcessModelSharedSecondaryProcess:
+        return WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS;
+    case ProcessModelMultipleSecondaryProcesses:
+        return WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES;
+    default:
+        ASSERT_NOT_REACHED();
+        return WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS;
+    }
+}
+
 static const char* injectedBundleDirectory()
 {
 #if ENABLE(DEVELOPER_MODE)
@@ -259,6 +285,7 @@ static void webkitWebContextConstructed(GObject* object)
 
     API::ProcessPoolConfiguration configuration;
     configuration.setInjectedBundlePath(WebCore::filenameToString(bundleFilename.get()));
+    configuration.setProcessModel(ProcessModelSharedSecondaryProcess);
     configuration.setUseNetworkProcess(false);
 
     WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(object);
@@ -1138,9 +1165,17 @@ void webkit_web_context_allow_tls_certificate_for_host(WebKitWebContext* context
  *
  * Since: 2.4
  */
-void webkit_web_context_set_process_model(WebKitWebContext*, WebKitProcessModel)
+void webkit_web_context_set_process_model(WebKitWebContext* context, WebKitProcessModel processModel)
 {
-    // FIXME: This is deprecated. Only WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES is supported now.
+    g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
+
+    ProcessModel newProcessModel(toProcessModel(processModel));
+
+    if (newProcessModel == context->priv->context->processModel())
+        return;
+
+    context->priv->context->setUsesNetworkProcess(newProcessModel == ProcessModelMultipleSecondaryProcesses);
+    context->priv->context->setProcessModel(newProcessModel);
 }
 
 /**
@@ -1156,7 +1191,9 @@ void webkit_web_context_set_process_model(WebKitWebContext*, WebKitProcessModel)
  */
 WebKitProcessModel webkit_web_context_get_process_model(WebKitWebContext* context)
 {
-    return WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES;
+    g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS);
+
+    return toWebKitProcessModel(context->priv->context->processModel());
 }
 
 /**
index 7d4f494..fd1083f 100644 (file)
@@ -26,8 +26,6 @@
 #import "config.h"
 #import "WebProcessPool.h"
 
-#import "NetworkProcessCreationParameters.h"
-#import "NetworkProcessProxy.h"
 #import "PluginProcessManager.h"
 #import "SandboxUtilities.h"
 #import "TextChecker.h"
 #import <WebCore/RuntimeApplicationChecks.h>
 #import <sys/param.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#import "NetworkProcessCreationParameters.h"
+#import "NetworkProcessProxy.h"
+#endif
+
 #if PLATFORM(IOS)
 #import "ArgumentCodersCF.h"
 #import "WebMemoryPressureHandlerIOS.h"
@@ -73,8 +76,10 @@ static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNot
 // FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String.
 NSString *WebIconDatabaseDirectoryDefaultsKey = @"WebIconDatabaseDirectoryDefaultsKey";
 
+#if ENABLE(NETWORK_PROCESS)
 static NSString * const WebKit2HTTPProxyDefaultsKey = @"WebKit2HTTPProxy";
 static NSString * const WebKit2HTTPSProxyDefaultsKey = @"WebKit2HTTPSProxy";
+#endif
 
 #if ENABLE(NETWORK_CACHE)
 static NSString * const WebKitNetworkCacheEnabledDefaultsKey = @"WebKitNetworkCacheEnabled";
@@ -114,8 +119,10 @@ static void registerUserDefaultsIfNeeded()
 
 void WebProcessPool::updateProcessSuppressionState()
 {
-    if (m_networkProcess)
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && m_networkProcess)
         m_networkProcess->setProcessSuppressionEnabled(processSuppressionEnabled());
+#endif
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     if (!m_processSuppressionDisabledForPageCounter.value())
@@ -190,6 +197,15 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
 
     parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]);
 
+#if ENABLE(NETWORK_PROCESS)
+    if (!usesNetworkProcess()) {
+#endif
+        for (const auto& scheme : globalURLSchemesWithCustomProtocolHandlers())
+            parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
+#if ENABLE(NETWORK_PROCESS)
+    }
+#endif
+
     parameters.fontWhitelist = m_fontWhitelist;
 
     if (m_bundleParameters) {
@@ -220,6 +236,7 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
 #endif
 }
 
+#if ENABLE(NETWORK_PROCESS)
 void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)
 {
     NSURLCache *urlCache = [NSURLCache sharedURLCache];
@@ -254,6 +271,7 @@ void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationPara
     parameters.uiProcessCookieStorageIdentifier.append(CFDataGetBytePtr(cookieStorageData.get()), CFDataGetLength(cookieStorageData.get()));
 #endif
 }
+#endif
 
 void WebProcessPool::platformInvalidateContext()
 {
index 4acb544..e505d04 100644 (file)
 #include "AuthenticationChallengeProxy.h"
 #include "DataReference.h"
 #include "DownloadProxyMap.h"
-#include "NetworkProcessMessages.h"
-#include "NetworkProcessProxy.h"
 #include "WebProcessMessages.h"
 #include "WebProcessPool.h"
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessMessages.h"
+#include "NetworkProcessProxy.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -71,8 +74,15 @@ void DownloadProxy::cancel()
     if (!m_processPool)
         return;
 
-    if (NetworkProcessProxy* networkProcess = m_processPool->networkProcess())
-        networkProcess->connection()->send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
+#if ENABLE(NETWORK_PROCESS)
+    if (m_processPool->usesNetworkProcess()) {
+        if (NetworkProcessProxy* networkProcess = m_processPool->networkProcess())
+            networkProcess->connection()->send(Messages::NetworkProcess::CancelDownload(m_downloadID), 0);
+        return;
+    }
+#endif
+
+    m_processPool->sendToAllProcesses(Messages::WebProcess::CancelDownload(m_downloadID));
 }
 
 void DownloadProxy::invalidate()
index 2e79851..76ea71f 100644 (file)
@@ -84,8 +84,10 @@ const char* ProcessLauncher::processTypeAsString(ProcessType processType)
     case PluginProcess:
         return "pluginprocess";
 #endif
+#if ENABLE(NETWORK_PROCESS)
     case NetworkProcess:
         return "networkprocess";
+#endif
 #if ENABLE(DATABASE_PROCESS)
     case DatabaseProcess:
         return "databaseprocess";
@@ -110,10 +112,12 @@ bool ProcessLauncher::getProcessTypeFromString(const char* string, ProcessType&
     }
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
     if (!strcmp(string, "networkprocess")) {
         processType = NetworkProcess;
         return true;
     }
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
     if (!strcmp(string, "databaseprocess")) {
index 200dbae..fe7da8e 100644 (file)
@@ -50,7 +50,9 @@ public:
 #if ENABLE(NETSCAPE_PLUGIN_API)
         PluginProcess,
 #endif
+#if ENABLE(NETWORK_PROCESS)
         NetworkProcess,
+#endif
 #if ENABLE(DATABASE_PROCESS)
         DatabaseProcess,
 #endif
index e2a6096..4c601d2 100644 (file)
@@ -114,9 +114,11 @@ void ProcessLauncher::launchProcess()
         pluginPath = m_launchOptions.extraInitializationData.get("plugin-path");
         break;
 #endif
+#if ENABLE(NETWORK_PROCESS)
     case NetworkProcess:
         executablePath = executablePathOfNetworkProcess();
         break;
+#endif
 #if ENABLE(DATABASE_PROCESS)
     case DatabaseProcess:
         executablePath = executablePathOfDatabaseProcess();
index 435b137..9d416a8 100644 (file)
@@ -76,9 +76,11 @@ void ProcessLauncher::launchProcess()
         realPluginPath = fileSystemRepresentation(pluginPath);
         break;
 #endif
+#if ENABLE(NETWORK_PROCESS)
     case NetworkProcess:
         executablePath = executablePathOfNetworkProcess();
         break;
+#endif
 #if ENABLE(DATABASE_PROCESS)
     case DatabaseProcess:
         executablePath = executablePathOfDatabaseProcess();
index 6cc61b3..4536848 100644 (file)
@@ -105,12 +105,14 @@ static RetainPtr<NSString> computeProcessShimPath(const ProcessLauncher::LaunchO
     }
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
     if (launchOptions.processType == ProcessLauncher::NetworkProcess) {
         NSString *processPath = [webKitBundle pathForAuxiliaryExecutable:@"NetworkProcess.app"];
         NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];
 
         return [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"SecItemShim.dylib"];
     }
+#endif
 
     if (launchOptions.processType == ProcessLauncher::WebProcess) {
         NSString *processPath = [webKitBundle pathForAuxiliaryExecutable:@"WebProcess.app"];
@@ -165,10 +167,12 @@ static const char* serviceName(const ProcessLauncher::LaunchOptions& launchOptio
         if (forDevelopment)
             return "com.apple.WebKit.WebContent.Development";
         return "com.apple.WebKit.WebContent";
+#if ENABLE(NETWORK_PROCESS)
     case ProcessLauncher::NetworkProcess:
         if (forDevelopment)
             return "com.apple.WebKit.Networking.Development";
         return "com.apple.WebKit.Networking";
+#endif
 #if ENABLE(DATABASE_PROCESS)
     case ProcessLauncher::DatabaseProcess:
         if (forDevelopment)
@@ -202,9 +206,12 @@ static bool shouldLeakBoost(const ProcessLauncher::LaunchOptions& launchOptions)
     // On iOS, leak a boost onto all child processes
     UNUSED_PARAM(launchOptions);
     return true;
-#else
+#elif ENABLE(NETWORK_PROCESS)
     // On Mac, leak a boost onto the NetworkProcess.
     return launchOptions.processType == ProcessLauncher::NetworkProcess;
+#else
+    UNUSED_PARAM(launchOptions);
+    return false;
 #endif
 }
     
@@ -476,9 +483,11 @@ static void createProcess(const ProcessLauncher::LaunchOptions& launchOptions, b
         processPath = [webKitBundle pathForAuxiliaryExecutable:@"PluginProcess.app"];
         break;
 #endif
+#if ENABLE(NETWORK_PROCESS)
     case ProcessLauncher::NetworkProcess:
         processPath = [webKitBundle pathForAuxiliaryExecutable:@"NetworkProcess.app"];
         break;
+#endif
 #if ENABLE(DATABASE_PROCESS)
     case ProcessLauncher::DatabaseProcess:
         processPath = [webKitBundle pathForAuxiliaryExecutable:@"DatabaseProcess.app"];
index 1aed5a1..969867e 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetworkProcessProxy.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "AuthenticationChallengeProxy.h"
 #include "CustomProtocolManagerProxyMessages.h"
 #include "DownloadProxyMessages.h"
@@ -375,3 +377,5 @@ void NetworkProcessProxy::setIsHoldingLockedFiles(bool isHoldingLockedFiles)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index bbdd7fb..364fc2f 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetworkProcessProxy_h
 #define NetworkProcessProxy_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "ChildProcessProxy.h"
 #include "CustomProtocolManagerProxy.h"
 #include "ProcessLauncher.h"
@@ -130,4 +132,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // NetworkProcessProxy_h
index dc93b84..ad3de35 100644 (file)
@@ -20,6 +20,8 @@
 # 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 ENABLE(NETWORK_PROCESS)
+
 messages -> NetworkProcessProxy LegacyReceiver {
     DidCreateNetworkConnectionToWebProcess(IPC::Attachment connectionIdentifier)
 
@@ -37,3 +39,5 @@ messages -> NetworkProcessProxy LegacyReceiver {
     LogSampledDiagnosticMessageWithResult(uint64_t pageID, String message, String description, uint32_t result)
     LogSampledDiagnosticMessageWithValue(uint64_t pageID, String message, String description, String value)
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index 19f7225..b0df1b8 100644 (file)
@@ -28,6 +28,8 @@
 
 #import "NetworkProcessMessages.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -57,3 +59,5 @@ void NetworkProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOption
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 859cb75..1bdf0ed 100644 (file)
@@ -24,8 +24,9 @@
  */
 
 #include "config.h"
-#include "NetworkProcessProxy.h"
+#if ENABLE(NETWORK_PROCESS)
 
+#include "NetworkProcessProxy.h"
 #include <glib.h>
 
 namespace WebKit {
@@ -42,3 +43,5 @@ void NetworkProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOption
 }
 
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
diff --git a/Source/WebKit2/UIProcess/ProcessModel.h b/Source/WebKit2/UIProcess/ProcessModel.h
new file mode 100644 (file)
index 0000000..6c18da0
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef ProcessModel_h
+#define ProcessModel_h
+
+namespace WebKit {
+
+enum ProcessModel {
+    ProcessModelSharedSecondaryProcess,
+    ProcessModelMultipleSecondaryProcesses
+};
+
+} // namespace WebKit
+
+#endif // ProcessModel_h
index 114f1aa..12012fd 100644 (file)
@@ -85,8 +85,8 @@ void WebCookieManagerProxy::processDidClose(NetworkProcessProxy*)
 
 bool WebCookieManagerProxy::shouldTerminate(WebProcessProxy*) const
 {
-    // FIXME: Remove this.
-    return true;
+    return processPool()->processModel() != ProcessModelSharedSecondaryProcess
+        || (m_arrayCallbacks.isEmpty() && m_httpCookieAcceptPolicyCallbacks.isEmpty());
 }
 
 void WebCookieManagerProxy::refWebContextSupplement()
@@ -163,7 +163,10 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy pol
     // - When testing, we only have one WebProcess and one NetworkProcess, and WebKitTestRunner never restarts them;
     // - When not testing, Cocoa has the policy persisted, and thus new processes use it (even for ephemeral sessions).
     processPool()->sendToAllProcesses(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
-    processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
+#if ENABLE(NETWORK_PROCESS)
+    if (processPool()->usesNetworkProcess())
+        processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
+#endif
 }
 
 void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(std::function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)> callbackFunction)
index 281dafa..65aaa51 100644 (file)
@@ -312,6 +312,7 @@ WebProcessPool& WebInspectorProxy::inspectorProcessPool()
     // guarantees no process sharing for our user interface.
     if (!s_processPool) {
         auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
+        configuration->setProcessModel(ProcessModelMultipleSecondaryProcesses);
         s_processPool = &WebProcessPool::create(configuration.get()).leakRef();
     };
 
index de0c42b..4531639 100644 (file)
@@ -60,7 +60,6 @@
 #include "NativeWebMouseEvent.h"
 #include "NativeWebWheelEvent.h"
 #include "NavigationActionData.h"
-#include "NetworkProcessMessages.h"
 #include "NotificationPermissionRequest.h"
 #include "NotificationPermissionRequestManager.h"
 #include "PageClient.h"
 #include <wtf/RefCountedLeakCounter.h>
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessMessages.h"
+#endif
+
 #if PLATFORM(COCOA)
 #include "RemoteLayerTreeDrawingAreaProxy.h"
 #include "RemoteLayerTreeScrollingPerformanceData.h"
@@ -484,8 +487,10 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
 
     m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this);
 
+#if ENABLE(NETWORK_PROCESS)
     if (m_sessionID.isEphemeral())
         m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::EnsurePrivateBrowsingSession(m_sessionID));
+#endif
 
 #if PLATFORM(COCOA)
     const CFIndex viewStateChangeRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
@@ -691,7 +696,10 @@ void WebPageProxy::reattachToWebProcess()
     m_process->removeWebPage(m_pageID);
     m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
 
-    m_process = m_process->processPool().createNewWebProcessRespectingProcessCountLimit();
+    if (m_process->processPool().processModel() == ProcessModelSharedSecondaryProcess)
+        m_process = m_process->processPool().ensureSharedWebProcess();
+    else
+        m_process = m_process->processPool().createNewWebProcessRespectingProcessCountLimit();
 
     ASSERT(m_process->state() != ChildProcessProxy::State::Terminated);
     if (m_process->state() == ChildProcessProxy::State::Running)
@@ -766,8 +774,10 @@ void WebPageProxy::setSessionID(SessionID sessionID)
     m_sessionID = sessionID;
     m_process->send(Messages::WebPage::SetSessionID(sessionID), m_pageID);
 
+#if ENABLE(NETWORK_PROCESS)
     if (sessionID.isEphemeral())
         m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::EnsurePrivateBrowsingSession(sessionID));
+#endif
 }
 
 void WebPageProxy::initializeWebPage()
index 4ce20bf..96bf429 100644 (file)
@@ -35,9 +35,6 @@
 #include "DownloadProxy.h"
 #include "DownloadProxyMessages.h"
 #include "Logging.h"
-#include "NetworkProcessCreationParameters.h"
-#include "NetworkProcessMessages.h"
-#include "NetworkProcessProxy.h"
 #include "SandboxExtension.h"
 #include "StatisticsData.h"
 #include "TextChecker.h"
 #include "DatabaseProcessMessages.h"
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessCreationParameters.h"
+#include "NetworkProcessMessages.h"
+#include "NetworkProcessProxy.h"
+#endif
 
 #if ENABLE(SERVICE_CONTROLS)
 #include "ServicesController.h"
@@ -103,6 +105,8 @@ using namespace WebKit;
 
 namespace WebKit {
 
+static const double sharedSecondaryProcessShutdownTimeout = 60;
+
 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, processPoolCounter, ("WebProcessPool"));
 
 Ref<WebProcessPool> WebProcessPool::create(API::ProcessPoolConfiguration& configuration)
@@ -155,8 +159,10 @@ WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration& configuration)
 #endif
     , m_shouldUseTestingNetworkSession(false)
     , m_processTerminationEnabled(true)
+#if ENABLE(NETWORK_PROCESS)
     , m_canHandleHTTPSServerTrustEvaluation(true)
     , m_didNetworkProcessCrash(false)
+#endif
 #if USE(SOUP)
     , m_ignoreTLSErrors(true)
 #endif
@@ -248,8 +254,10 @@ WebProcessPool::~WebProcessPool()
     processPoolCounter.decrement();
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
     if (m_networkProcess)
         m_networkProcess->shutDownProcess();
+#endif
 }
 
 void WebProcessPool::initializeClient(const WKContextClientBase* client)
@@ -283,6 +291,17 @@ void WebProcessPool::setDownloadClient(std::unique_ptr<API::DownloadClient> down
         m_downloadClient = WTF::move(downloadClient);
 }
 
+void WebProcessPool::setProcessModel(ProcessModel processModel)
+{
+    // Guard against API misuse.
+    if (!m_processes.isEmpty())
+        CRASH();
+    if (processModel != ProcessModelSharedSecondaryProcess && !m_messagesToInjectedBundlePostedToEmptyContext.isEmpty())
+        CRASH();
+
+    m_configuration->setProcessModel(processModel);
+}
+
 void WebProcessPool::setMaximumNumberOfProcesses(unsigned maximumNumberOfProcesses)
 {
     // Guard against API misuse.
@@ -294,7 +313,23 @@ void WebProcessPool::setMaximumNumberOfProcesses(unsigned maximumNumberOfProcess
 
 IPC::Connection* WebProcessPool::networkingProcessConnection()
 {
-    return m_networkProcess->connection();
+    switch (processModel()) {
+    case ProcessModelSharedSecondaryProcess:
+#if ENABLE(NETWORK_PROCESS)
+        if (usesNetworkProcess())
+            return m_networkProcess->connection();
+#endif
+        return m_processes[0]->connection();
+    case ProcessModelMultipleSecondaryProcesses:
+#if ENABLE(NETWORK_PROCESS)
+        ASSERT(usesNetworkProcess());
+        return m_networkProcess->connection();
+#else
+        break;
+#endif
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
 }
 
 void WebProcessPool::languageChanged(void* context)
@@ -305,8 +340,8 @@ void WebProcessPool::languageChanged(void* context)
 void WebProcessPool::languageChanged()
 {
     sendToAllProcesses(Messages::WebProcess::UserPreferredLanguagesChanged(userPreferredLanguages()));
-#if USE(SOUP)
-    if (m_networkProcess)
+#if USE(SOUP) && ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && m_networkProcess)
         m_networkProcess->send(Messages::NetworkProcess::UserPreferredLanguagesChanged(userPreferredLanguages()), 0);
 #endif
 }
@@ -321,6 +356,25 @@ void WebProcessPool::textCheckerStateChanged()
     sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state()));
 }
 
+void WebProcessPool::setUsesNetworkProcess(bool usesNetworkProcess)
+{
+#if ENABLE(NETWORK_PROCESS)
+    m_configuration->setUseNetworkProcess(usesNetworkProcess);
+#else
+    UNUSED_PARAM(usesNetworkProcess);
+#endif
+}
+
+bool WebProcessPool::usesNetworkProcess() const
+{
+#if ENABLE(NETWORK_PROCESS)
+    return m_configuration->useNetworkProcess();
+#else
+    return false;
+#endif
+}
+
+#if ENABLE(NETWORK_PROCESS)
 NetworkProcessProxy& WebProcessPool::ensureNetworkProcess()
 {
     if (m_networkProcess)
@@ -405,6 +459,7 @@ void WebProcessPool::getNetworkProcessConnection(PassRefPtr<Messages::WebProcess
 
     m_networkProcess->getNetworkProcessConnection(reply);
 }
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
 void WebProcessPool::ensureDatabaseProcess()
@@ -472,12 +527,14 @@ void WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool private
 {
     m_iconDatabase->setPrivateBrowsingEnabled(privateBrowsingEnabled);
 
-    if (networkProcess()) {
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && networkProcess()) {
         if (privateBrowsingEnabled)
             networkProcess()->send(Messages::NetworkProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
         else
             networkProcess()->send(Messages::NetworkProcess::DestroyPrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
     }
+#endif // ENABLED(NETWORK_PROCESS)
 
     if (privateBrowsingEnabled)
         sendToAllProcesses(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()));
@@ -512,9 +569,20 @@ void WebProcessPool::processDidCachePage(WebProcessProxy* process)
     m_processWithPageCache = process;
 }
 
+WebProcessProxy& WebProcessPool::ensureSharedWebProcess()
+{
+    ASSERT(processModel() == ProcessModelSharedSecondaryProcess);
+    if (m_processes.isEmpty())
+        createNewWebProcess();
+    return *m_processes[0];
+}
+
 WebProcessProxy& WebProcessPool::createNewWebProcess()
 {
-    ensureNetworkProcess();
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess())
+        ensureNetworkProcess();
+#endif
 
     Ref<WebProcessProxy> process = WebProcessProxy::create(*this);
 
@@ -578,7 +646,7 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
     // iconDatabasePath is non-empty by default, but m_iconDatabase isn't enabled in UI process unless setDatabasePath is called explicitly.
     parameters.iconDatabaseEnabled = !iconDatabasePath().isEmpty();
 
-    parameters.terminationTimeout = 0;
+    parameters.terminationTimeout = (processModel() == ProcessModelSharedSecondaryProcess) ? sharedSecondaryProcessShutdownTimeout : 0;
 
     parameters.textCheckerState = TextChecker::state();
 
@@ -591,6 +659,10 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
     supplement<WebNotificationManagerProxy>()->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+    parameters.usesNetworkProcess = usesNetworkProcess();
+#endif
+
     parameters.plugInAutoStartOriginHashes = m_plugInAutoStartProvider.autoStartOriginHashesCopy();
     copyToVector(m_plugInAutoStartProvider.autoStartOrigins(), parameters.plugInAutoStartOrigins);
 
@@ -634,7 +706,15 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
 
     m_processes.append(process.ptr());
 
-    ASSERT(m_messagesToInjectedBundlePostedToEmptyContext.isEmpty());
+    if (processModel() == ProcessModelSharedSecondaryProcess) {
+        for (size_t i = 0; i != m_messagesToInjectedBundlePostedToEmptyContext.size(); ++i) {
+            auto& messageNameAndBody = m_messagesToInjectedBundlePostedToEmptyContext[i];
+
+            process->send(Messages::WebProcess::HandleInjectedBundleMessage(messageNameAndBody.first, UserData(process->transformObjectsToHandles(messageNameAndBody.second.get()).get())), 0);
+        }
+        m_messagesToInjectedBundlePostedToEmptyContext.clear();
+    } else
+        ASSERT(m_messagesToInjectedBundlePostedToEmptyContext.isEmpty());
 
 #if ENABLE(REMOTE_INSPECTOR)
     // Initialize remote inspector connection now that we have a sub-process that is hosting one of our web views.
@@ -718,12 +798,28 @@ void WebProcessPool::disconnectProcess(WebProcessProxy* process)
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Some of the invalidation calls below are still necessary in multi-process mode, but they should only affect data structures pertaining to the process being disconnected.
     // Clearing everything causes assertion failures, so it's less trouble to skip that for now.
-    RefPtr<WebProcessProxy> protect(process);
-    if (m_processWithPageCache == process)
-        m_processWithPageCache = 0;
+    if (processModel() != ProcessModelSharedSecondaryProcess) {
+        RefPtr<WebProcessProxy> protect(process);
+        if (m_processWithPageCache == process)
+            m_processWithPageCache = 0;
+
+        static_cast<WebContextSupplement*>(supplement<WebGeolocationManagerProxy>())->processDidClose(process);
+
+        m_processes.removeFirst(process);
+        return;
+    }
 
-    static_cast<WebContextSupplement*>(supplement<WebGeolocationManagerProxy>())->processDidClose(process);
+    WebContextSupplementMap::const_iterator it = m_supplements.begin();
+    WebContextSupplementMap::const_iterator end = m_supplements.end();
+    for (; it != end; ++it)
+        it->value->processDidClose(process);
 
+    // The vector may have the last reference to process proxy, which in turn may have the last reference to the context.
+    // Since vector elements are destroyed in place, we would recurse into WebProcessProxy destructor
+    // if it were invoked from Vector::remove(). RefPtr delays destruction until it's safe.
+    RefPtr<WebProcessProxy> protect(process);
+    if (m_processWithPageCache == process)
+        m_processWithPageCache = nullptr;
     m_processes.removeFirst(process);
 }
 
@@ -755,14 +851,18 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
     }
 
     RefPtr<WebProcessProxy> process;
-    if (m_haveInitialEmptyProcess) {
-        process = m_processes.last();
-        m_haveInitialEmptyProcess = false;
-    } else if (pageConfiguration->relatedPage()) {
-        // Sharing processes, e.g. when creating the page via window.open().
-        process = &pageConfiguration->relatedPage()->process();
-    } else
-        process = &createNewWebProcessRespectingProcessCountLimit();
+    if (processModel() == ProcessModelSharedSecondaryProcess) {
+        process = &ensureSharedWebProcess();
+    } else {
+        if (m_haveInitialEmptyProcess) {
+            process = m_processes.last();
+            m_haveInitialEmptyProcess = false;
+        } else if (pageConfiguration->relatedPage()) {
+            // Sharing processes, e.g. when creating the page via window.open().
+            process = &pageConfiguration->relatedPage()->process();
+        } else
+            process = &createNewWebProcessRespectingProcessCountLimit();
+    }
 
     return process->createWebPage(pageClient, WTF::move(pageConfiguration));
 }
@@ -770,16 +870,18 @@ Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API:
 DownloadProxy* WebProcessPool::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
 {
     DownloadProxy* downloadProxy = createDownloadProxy(request);
+    uint64_t initiatingPageID = initiatingPage ? initiatingPage->pageID() : 0;
     SessionID sessionID = initiatingPage ? initiatingPage->sessionID() : SessionID::defaultSessionID();
 
-    if (networkProcess()) {
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && networkProcess()) {
         // FIXME (NetworkProcess): Replicate whatever FrameLoader::setOriginalURLForDownloadRequest does with the request here.
         networkProcess()->send(Messages::NetworkProcess::DownloadRequest(sessionID, downloadProxy->downloadID(), request), 0);
         return downloadProxy;
     }
+#endif
 
-    // FIXME: make networkProcess() return a reference so this is not necessary.
-    ASSERT_NOT_REACHED();
+    m_processes[0]->send(Messages::WebProcess::DownloadRequest(sessionID, downloadProxy->downloadID(), initiatingPageID, request), 0);
     return downloadProxy;
 }
 
@@ -791,18 +893,25 @@ DownloadProxy* WebProcessPool::resumeDownload(const API::Data* resumeData, const
     if (!path.isEmpty())
         SandboxExtension::createHandle(path, SandboxExtension::ReadWrite, sandboxExtensionHandle);
 
-    if (networkProcess()) {
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && networkProcess()) {
         networkProcess()->send(Messages::NetworkProcess::ResumeDownload(downloadProxy->downloadID(), resumeData->dataReference(), path, sandboxExtensionHandle), 0);
         return downloadProxy;
     }
+#endif
 
-    // FIXME: make networkProcess() return a reference so this is not necessary.
-    ASSERT_NOT_REACHED();
+    m_processes[0]->send(Messages::WebProcess::ResumeDownload(downloadProxy->downloadID(), resumeData->dataReference(), path, sandboxExtensionHandle), 0);
     return downloadProxy;
 }
 
 void WebProcessPool::postMessageToInjectedBundle(const String& messageName, API::Object* messageBody)
 {
+    if (m_processes.isEmpty()) {
+        if (processModel() == ProcessModelSharedSecondaryProcess)
+            m_messagesToInjectedBundlePostedToEmptyContext.append(std::make_pair(messageName, messageBody));
+        return;
+    }
+
     for (auto& process : m_processes) {
         // FIXME: Return early if the message body contains any references to WKPageRefs/WKFrameRefs etc. since they're local to a process.
         process->send(Messages::WebProcess::HandleInjectedBundleMessage(messageName, UserData(process->transformObjectsToHandles(messageBody).get())), 0);
@@ -831,6 +940,7 @@ void WebProcessPool::setAdditionalPluginsDirectory(const String& directory)
 }
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
+#if ENABLE(NETWORK_PROCESS)
 PlatformProcessIdentifier WebProcessPool::networkProcessIdentifier()
 {
     if (!m_networkProcess)
@@ -838,6 +948,7 @@ PlatformProcessIdentifier WebProcessPool::networkProcessIdentifier()
 
     return m_networkProcess->processIdentifier();
 }
+#endif
 
 void WebProcessPool::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
 {
@@ -877,9 +988,15 @@ void WebProcessPool::setDomainRelaxationForbiddenForURLScheme(const String& urlS
 
 void WebProcessPool::setCanHandleHTTPSServerTrustEvaluation(bool value)
 {
+#if ENABLE(NETWORK_PROCESS)
     m_canHandleHTTPSServerTrustEvaluation = value;
-    if (m_networkProcess)
+    if (usesNetworkProcess() && m_networkProcess) {
         m_networkProcess->send(Messages::NetworkProcess::SetCanHandleHTTPSServerTrustEvaluation(value), 0);
+        return;
+    }
+#else
+    UNUSED_PARAM(value);
+#endif
 }
 
 void WebProcessPool::registerURLSchemeAsLocal(const String& urlScheme)
@@ -947,8 +1064,10 @@ void WebProcessPool::setCacheModel(CacheModel cacheModel)
     m_configuration->setCacheModel(cacheModel);
     sendToAllProcesses(Messages::WebProcess::SetCacheModel(cacheModel));
 
-    if (m_networkProcess)
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && m_networkProcess)
         m_networkProcess->send(Messages::NetworkProcess::SetCacheModel(cacheModel), 0);
+#endif
 }
 
 void WebProcessPool::setDefaultRequestTimeoutInterval(double timeoutInterval)
@@ -958,9 +1077,15 @@ void WebProcessPool::setDefaultRequestTimeoutInterval(double timeoutInterval)
 
 DownloadProxy* WebProcessPool::createDownloadProxy(const ResourceRequest& request)
 {
-    ensureNetworkProcess();
-    ASSERT(m_networkProcess);
-    return m_networkProcess->createDownloadProxy(request);
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess()) {
+        ensureNetworkProcess();
+        ASSERT(m_networkProcess);
+        return m_networkProcess->createDownloadProxy(request);
+    }
+#endif
+
+    return ensureSharedWebProcess().createDownloadProxy(request);
 }
 
 void WebProcessPool::addMessageReceiver(IPC::StringReference messageReceiverName, IPC::MessageReceiver& messageReceiver)
@@ -1057,10 +1182,12 @@ String WebProcessPool::cookieStorageDirectory() const
 void WebProcessPool::useTestingNetworkSession()
 {
     ASSERT(m_processes.isEmpty());
+#if ENABLE(NETWORK_PROCESS)
     ASSERT(!m_networkProcess);
 
     if (m_networkProcess)
         return;
+#endif
 
     if (!m_processes.isEmpty())
         return;
@@ -1070,18 +1197,22 @@ void WebProcessPool::useTestingNetworkSession()
 
 void WebProcessPool::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host)
 {
-    if (m_networkProcess) {
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && m_networkProcess) {
         m_networkProcess->send(Messages::NetworkProcess::AllowSpecificHTTPSCertificateForHost(certificate->certificateInfo(), host), 0);
         return;
     }
+#endif
 
 #if USE(SOUP)
     m_processes[0]->send(Messages::WebProcess::AllowSpecificHTTPSCertificateForHost(certificate->certificateInfo(), host), 0);
     return;
+#else
+    UNUSED_PARAM(certificate);
+    UNUSED_PARAM(host);
 #endif
 
 #if !PLATFORM(IOS)
-    // FIXME: Why is this only on iOS? Can we remove it?
     ASSERT_NOT_REACHED();
 #endif
 }
@@ -1122,19 +1253,40 @@ void WebProcessPool::getStatistics(uint32_t statisticsMask, std::function<void (
 
 void WebProcessPool::requestWebContentStatistics(StatisticsRequest* request)
 {
-    // FIXME (Multi-WebProcess) <rdar://problem/13200059>: Make getting statistics from multiple WebProcesses work.
+    if (processModel() == ProcessModelSharedSecondaryProcess) {
+        if (m_processes.isEmpty())
+            return;
+        
+        uint64_t requestID = request->addOutstandingRequest();
+        m_statisticsRequests.set(requestID, request);
+        m_processes[0]->send(Messages::WebProcess::GetWebCoreStatistics(requestID), 0);
+
+    } else {
+        // FIXME (Multi-WebProcess) <rdar://problem/13200059>: Make getting statistics from multiple WebProcesses work.
+    }
 }
 
 void WebProcessPool::requestNetworkingStatistics(StatisticsRequest* request)
 {
-    if (!m_networkProcess) {
+    bool networkProcessUnavailable;
+#if ENABLE(NETWORK_PROCESS)
+    networkProcessUnavailable = !usesNetworkProcess() || !m_networkProcess;
+#else
+    networkProcessUnavailable = true;
+#endif
+
+    if (networkProcessUnavailable) {
         LOG_ERROR("Attempt to get NetworkProcess statistics but the NetworkProcess is unavailable");
         return;
     }
 
+#if ENABLE(NETWORK_PROCESS)
     uint64_t requestID = request->addOutstandingRequest();
     m_statisticsRequests.set(requestID, request);
     m_networkProcess->send(Messages::NetworkProcess::GetNetworkProcessStatistics(requestID), 0);
+#else
+    UNUSED_PARAM(request);
+#endif
 }
 
 void WebProcessPool::handleMessage(IPC::Connection& connection, const String& messageName, const WebKit::UserData& messageBody)
index 307a5ca..cff06f1 100644 (file)
@@ -34,9 +34,9 @@
 #include "GenericCallback.h"
 #include "MessageReceiver.h"
 #include "MessageReceiverMap.h"
-#include "NetworkProcessProxy.h"
 #include "PlugInAutoStartProvider.h"
 #include "PluginInfoStore.h"
+#include "ProcessModel.h"
 #include "ProcessThrottler.h"
 #include "StatisticsRequest.h"
 #include "VisitedLinkStore.h"
 #include "DatabaseProcessProxy.h"
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessProxy.h"
+#endif
+
 #if ENABLE(MEDIA_SESSION)
 #include "WebMediaSessionFocusManager.h"
 #endif
@@ -82,12 +86,14 @@ class WebContextSupplement;
 class WebIconDatabase;
 class WebPageGroup;
 class WebPageProxy;
-struct NetworkProcessCreationParameters;
 struct StatisticsData;
 struct WebProcessCreationParameters;
     
 typedef GenericCallback<API::Dictionary*> DictionaryCallback;
 
+#if ENABLE(NETWORK_PROCESS)
+struct NetworkProcessCreationParameters;
+#endif
 
 #if PLATFORM(COCOA)
 int networkProcessLatencyQOS();
@@ -136,6 +142,9 @@ public:
     void setHistoryClient(std::unique_ptr<API::LegacyContextHistoryClient>);
     void setDownloadClient(std::unique_ptr<API::DownloadClient>);
 
+    void setProcessModel(ProcessModel); // Can only be called when there are no processes running.
+    ProcessModel processModel() const { return m_configuration->processModel(); }
+
     void setMaximumNumberOfProcesses(unsigned); // Can only be called when there are no processes running.
     unsigned maximumNumberOfProcesses() const { return !m_configuration->maximumProcessCount() ? UINT_MAX : m_configuration->maximumProcessCount(); }
 
@@ -184,7 +193,9 @@ public:
     void clearPluginClientPolicies();
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
     PlatformProcessIdentifier networkProcessIdentifier();
+#endif
 
     void setAlwaysUsesComplexTextCodePath(bool);
     void setShouldUseFontSmoothing(bool);
@@ -275,11 +286,16 @@ public:
 
     // Network Process Management
 
+    void setUsesNetworkProcess(bool);
+    bool usesNetworkProcess() const;
+
+#if ENABLE(NETWORK_PROCESS)
     NetworkProcessProxy& ensureNetworkProcess();
     NetworkProcessProxy* networkProcess() { return m_networkProcess.get(); }
     void networkProcessCrashed(NetworkProcessProxy*);
 
     void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>);
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
     void ensureDatabaseProcess();
@@ -362,7 +378,9 @@ private:
     void requestWebContentStatistics(StatisticsRequest*);
     void requestNetworkingStatistics(StatisticsRequest*);
 
+#if ENABLE(NETWORK_PROCESS)
     void platformInitializeNetworkProcess(NetworkProcessCreationParameters&);
+#endif
 
     void handleMessage(IPC::Connection&, const String& messageName, const UserData& messageBody);
     void handleSynchronousMessage(IPC::Connection&, const String& messageName, const UserData& messageBody, UserData& returnUserData);
@@ -482,9 +500,11 @@ private:
 
     bool m_processTerminationEnabled;
 
+#if ENABLE(NETWORK_PROCESS)
     bool m_canHandleHTTPSServerTrustEvaluation;
     bool m_didNetworkProcessCrash;
     RefPtr<NetworkProcessProxy> m_networkProcess;
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
     RefPtr<DatabaseProcessProxy> m_databaseProcess;
@@ -519,15 +539,55 @@ private:
 template<typename T>
 void WebProcessPool::sendToNetworkingProcess(T&& message)
 {
-    if (m_networkProcess && m_networkProcess->canSendMessage())
-        m_networkProcess->send(std::forward<T>(message), 0);
+    switch (processModel()) {
+    case ProcessModelSharedSecondaryProcess:
+#if ENABLE(NETWORK_PROCESS)
+        if (usesNetworkProcess()) {
+            if (m_networkProcess && m_networkProcess->canSendMessage())
+                m_networkProcess->send(std::forward<T>(message), 0);
+            return;
+        }
+#endif
+        if (!m_processes.isEmpty() && m_processes[0]->canSendMessage())
+            m_processes[0]->send(std::forward<T>(message), 0);
+        return;
+    case ProcessModelMultipleSecondaryProcesses:
+#if ENABLE(NETWORK_PROCESS)
+        if (m_networkProcess && m_networkProcess->canSendMessage())
+            m_networkProcess->send(std::forward<T>(message), 0);
+        return;
+#else
+        break;
+#endif
+    }
+    ASSERT_NOT_REACHED();
 }
 
 template<typename T>
 void WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary(T&& message)
 {
-    ensureNetworkProcess();
-    m_networkProcess->send(std::forward<T>(message), 0);
+    switch (processModel()) {
+    case ProcessModelSharedSecondaryProcess:
+#if ENABLE(NETWORK_PROCESS)
+        if (usesNetworkProcess()) {
+            ensureNetworkProcess();
+            m_networkProcess->send(std::forward<T>(message), 0);
+            return;
+        }
+#endif
+        ensureSharedWebProcess();
+        m_processes[0]->send(std::forward<T>(message), 0);
+        return;
+    case ProcessModelMultipleSecondaryProcesses:
+#if ENABLE(NETWORK_PROCESS)
+        ensureNetworkProcess();
+        m_networkProcess->send(std::forward<T>(message), 0);
+        return;
+#else
+        break;
+#endif
+    }
+    ASSERT_NOT_REACHED();
 }
 
 template<typename T>
@@ -556,12 +616,17 @@ template<typename T>
 void WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary(const T& message)
 {
     // FIXME (Multi-WebProcess): WebProcessPool doesn't track processes that have exited, so it cannot relaunch these. Perhaps this functionality won't be needed in this mode.
+    if (processModel() == ProcessModelSharedSecondaryProcess)
+        ensureSharedWebProcess();
     sendToAllProcesses(message);
 }
 
 template<typename T>
 void WebProcessPool::sendToOneProcess(T&& message)
 {
+    if (processModel() == ProcessModelSharedSecondaryProcess)
+        ensureSharedWebProcess();
+
     bool messageSent = false;
     size_t processCount = m_processes.size();
     for (size_t i = 0; i < processCount; ++i) {
@@ -573,7 +638,7 @@ void WebProcessPool::sendToOneProcess(T&& message)
         }
     }
 
-    if (!messageSent) {
+    if (!messageSent && processModel() == ProcessModelMultipleSecondaryProcesses) {
         warmInitialProcess();
         RefPtr<WebProcessProxy> process = m_processes.last();
         if (process->canSendMessage())
index 0d31c04..1912cda 100644 (file)
@@ -256,7 +256,7 @@ void WebProcessProxy::removeWebPage(uint64_t pageID)
 
     // If this was the last WebPage open in that web process, and we have no other reason to keep it alive, let it go.
     // We only allow this when using a network process, as otherwise the WebProcess needs to preserve its session state.
-    if (state() == State::Terminated || !canTerminateChildProcess())
+    if (!m_processPool->usesNetworkProcess() || state() == State::Terminated || !canTerminateChildProcess())
         return;
 
     shutDown();
@@ -427,10 +427,12 @@ void WebProcessProxy::getPluginProcessConnection(uint64_t pluginProcessToken, Pa
 }
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
 void WebProcessProxy::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
 {
     m_processPool->getNetworkProcessConnection(reply);
 }
+#endif // ENABLE(NETWORK_PROCESS)
 
 #if ENABLE(DATABASE_PROCESS)
 void WebProcessProxy::getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply> reply)
@@ -700,6 +702,18 @@ void WebProcessProxy::updateTextCheckerState()
         send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0);
 }
 
+DownloadProxy* WebProcessProxy::createDownloadProxy(const ResourceRequest& request)
+{
+#if ENABLE(NETWORK_PROCESS)
+    ASSERT(!m_processPool->usesNetworkProcess());
+#endif
+
+    if (!m_downloadProxyMap)
+        m_downloadProxyMap = std::make_unique<DownloadProxyMap>(this);
+
+    return m_downloadProxyMap->createDownloadProxy(m_processPool, request);
+}
+
 void WebProcessProxy::didSaveToPageCache()
 {
     m_processPool->processDidCachePage(this);
@@ -933,6 +947,7 @@ void WebProcessProxy::didCancelProcessSuspension()
     m_throttler.didCancelProcessSuspension();
 }
 
+#if ENABLE(NETWORK_PROCESS)
 void WebProcessProxy::reinstateNetworkProcessAssertionState(NetworkProcessProxy& newNetworkProcessProxy)
 {
 #if PLATFORM(IOS)
@@ -947,10 +962,11 @@ void WebProcessProxy::reinstateNetworkProcessAssertionState(NetworkProcessProxy&
     UNUSED_PARAM(newNetworkProcessProxy);
 #endif
 }
+#endif
 
 void WebProcessProxy::didSetAssertionState(AssertionState state)
 {
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && ENABLE(NETWORK_PROCESS)
     ASSERT(!m_backgroundTokenForNetworkProcess || !m_foregroundTokenForNetworkProcess);
 
     switch (state) {
@@ -962,12 +978,14 @@ void WebProcessProxy::didSetAssertionState(AssertionState state)
         break;
 
     case AssertionState::Background:
-        m_backgroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().backgroundActivityToken();
+        if (processPool().usesNetworkProcess())
+            m_backgroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().backgroundActivityToken();
         m_foregroundTokenForNetworkProcess = nullptr;
         break;
     
     case AssertionState::Foreground:
-        m_foregroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().foregroundActivityToken();
+        if (processPool().usesNetworkProcess())
+            m_foregroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().foregroundActivityToken();
         m_backgroundTokenForNetworkProcess = nullptr;
         for (auto& page : m_pageMap.values())
             page->processWillBecomeForeground();
index 5ab438b..cc3eceb 100644 (file)
@@ -152,7 +152,9 @@ public:
 
     ProcessThrottler& throttler() { return m_throttler; }
 
+#if ENABLE(NETWORK_PROCESS)
     void reinstateNetworkProcessAssertionState(NetworkProcessProxy&);
+#endif
 
 private:
     explicit WebProcessProxy(WebProcessPool&);
@@ -184,7 +186,9 @@ private:
 #if ENABLE(NETSCAPE_PLUGIN_API)
     void getPluginProcessConnection(uint64_t pluginProcessToken, PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>);
 #endif
+#if ENABLE(NETWORK_PROCESS)
     void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>);
+#endif
 #if ENABLE(DATABASE_PROCESS)
     void getDatabaseProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetDatabaseProcessConnection::DelayedReply>);
 #endif
@@ -249,7 +253,7 @@ private:
     int m_numberOfTimesSuddenTerminationWasDisabled;
     ProcessThrottler m_throttler;
     ProcessThrottler::BackgroundActivityToken m_tokenForHoldingLockedFiles;
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && ENABLE(NETWORK_PROCESS)
     ProcessThrottler::ForegroundActivityToken m_foregroundTokenForNetworkProcess;
     ProcessThrottler::BackgroundActivityToken m_backgroundTokenForNetworkProcess;
 #endif
index 21dbfd4..74509e0 100644 (file)
@@ -38,7 +38,9 @@ messages -> WebProcessProxy LegacyReceiver {
     GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins)
     GetPluginProcessConnection(uint64_t pluginProcessToken) -> (IPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed
 #endif
+#if ENABLE(NETWORK_PROCESS)
     GetNetworkProcessConnection() -> (IPC::Attachment connectionHandle) Delayed
+#endif
 #if ENABLE(DATABASE_PROCESS)
     GetDatabaseProcessConnection() -> (IPC::Attachment connectionHandle) Delayed
 #endif
index 936162a..5305f88 100644 (file)
@@ -94,10 +94,12 @@ WebsiteDataStore::~WebsiteDataStore()
 {
     platformDestroy();
 
+#if ENABLE(NETWORK_PROCESS)
     if (m_sessionID.isEphemeral()) {
         for (auto& processPool : WebProcessPool::allProcessPools())
             processPool->sendToNetworkingProcess(Messages::NetworkProcess::DestroyPrivateBrowsingSession(m_sessionID));
     }
+#endif
 }
 
 void WebsiteDataStore::cloneSessionData(WebPageProxy& sourcePage, WebPageProxy& newPage)
index d826a01..14a8c73 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "APIProcessPoolConfiguration.h"
 #include "Logging.h"
-#include "NetworkProcessMessages.h"
 #include "WebCookieManagerProxy.h"
 #include "WebInspectorServer.h"
 #include "WebProcessCreationParameters.h"
 #include <wtf/glib/GUniquePtr.h>
 #include <wtf/text/CString.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkProcessMessages.h"
+#endif
+
 namespace WebKit {
 
 static void initInspectorServer()
@@ -95,6 +98,16 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
         parameters.urlSchemesRegisteredAsLocal.append("resource");
     }
 
+    if (!usesNetworkProcess()) {
+        parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols();
+
+        supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
+        parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
+
+        parameters.ignoreTLSErrors = m_ignoreTLSErrors;
+        parameters.diskCacheDirectory = m_configuration->diskCacheDirectory();
+    }
+
     parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModelDocumentViewer;
 }
 
@@ -136,8 +149,13 @@ String WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory()
 void WebProcessPool::setIgnoreTLSErrors(bool ignoreTLSErrors)
 {
     m_ignoreTLSErrors = ignoreTLSErrors;
-    if (networkProcess())
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess() && networkProcess()) {
         networkProcess()->send(Messages::NetworkProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors), 0);
+        return;
+    }
+#endif
+    sendToAllProcesses(Messages::WebProcess::SetIgnoreTLSErrors(m_ignoreTLSErrors));
 }
 
 } // namespace WebKit
index 72682ed..c3db0a1 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include "config.h"
+#if ENABLE(NETWORK_PROCESS)
 #include "WebProcessPool.h"
 
 #include "NetworkProcessCreationParameters.h"
@@ -46,3 +47,5 @@ void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationPara
 }
 
 }
+
+#endif
index 8ac0955..e0242e2 100644 (file)
                BC5750981268F3C6006F0F12 /* WebPopupMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */; };
                BC575613126E0138006F0F12 /* APIError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575612126E0138006F0F12 /* APIError.cpp */; };
                BC59548915C7868500FD1E3E /* WebKit2.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59548815C7868500FD1E3E /* WebKit2.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BC597075116591D000551FCA /* ProcessModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BC597074116591D000551FCA /* ProcessModel.h */; };
                BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */; };
                BC5D24A116CC3B9E007D5461 /* ChildProcessMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5D249F16CC3B9E007D5461 /* ChildProcessMain.mm */; };
                BC5D24A216CC3B9E007D5461 /* ChildProcessMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5D249F16CC3B9E007D5461 /* ChildProcessMain.mm */; };
                BC5750961268F3C6006F0F12 /* WebPopupMenuProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPopupMenuProxyMac.mm; sourceTree = "<group>"; };
                BC575612126E0138006F0F12 /* APIError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIError.cpp; sourceTree = "<group>"; };
                BC59548815C7868500FD1E3E /* WebKit2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2.h; sourceTree = "<group>"; };
+               BC597074116591D000551FCA /* ProcessModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessModel.h; sourceTree = "<group>"; };
                BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKConnectionInternal.h; sourceTree = "<group>"; };
                BC5D249F16CC3B9E007D5461 /* ChildProcessMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ChildProcessMain.mm; sourceTree = "<group>"; };
                BC5D24B816CC40BB007D5461 /* BaseLegacyProcess.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BaseLegacyProcess.xcconfig; sourceTree = "<group>"; };
                                1AC7537A183A9FDB0072CB15 /* PageLoadState.h */,
                                37716A59195B910500EE8B1B /* ProcessAssertion.cpp */,
                                86F9536018FF4FD4001DB2EF /* ProcessAssertion.h */,
+                               BC597074116591D000551FCA /* ProcessModel.h */,
                                86E67A22190F411800004AB7 /* ProcessThrottler.cpp */,
                                86E67A21190F411800004AB7 /* ProcessThrottler.h */,
                                83048AE51ACA45DC0082C832 /* ProcessThrottlerClient.h */,
                                E1CC1B9012D7EADF00625838 /* PrintInfo.h in Headers */,
                                86F9536518FF58F5001DB2EF /* ProcessAssertion.h in Headers */,
                                BC1A7C581136E19C00FB7167 /* ProcessLauncher.h in Headers */,
+                               BC597075116591D000551FCA /* ProcessModel.h in Headers */,
                                86E67A251910B9D100004AB7 /* ProcessThrottler.h in Headers */,
                                83048AE61ACA45DC0082C832 /* ProcessThrottlerClient.h in Headers */,
                                2D7F13101A702FBA009A6FBD /* ProcessType.h in Headers */,
index a9f1521..8b21f8f 100644 (file)
@@ -36,6 +36,8 @@
 
 #define ENABLE_WEB_PROCESS_SANDBOX 1
 
+#define ENABLE_NETWORK_PROCESS 1
+
 #define ENABLE_DATABASE_PROCESS 1
 
 #define ENABLE_MEMORY_SAMPLER 1
@@ -57,6 +59,7 @@
 #endif
 
 #if PLATFORM(GTK)
+#define ENABLE_NETWORK_PROCESS 1
 #define ENABLE_SHAREABLE_RESOURCE 1
 #endif
 
index 7f44bea..dace573 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "BlobRegistryProxy.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "NetworkConnectionToWebProcessMessages.h"
 #include "NetworkProcessConnection.h"
 #include "WebCoreArgumentCoders.h"
@@ -38,6 +40,8 @@ namespace WebKit {
 
 void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<BlobDataFileReference> file, const String& contentType)
 {
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
+
     SandboxExtension::Handle extensionHandle;
 
     // File path can be empty when submitting a form file input without a file, see bug 111778.
@@ -49,26 +53,36 @@ void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
 {
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
+
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
 {
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
+
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
 }
 
 void BlobRegistryProxy::unregisterBlobURL(const URL& url)
 {
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
+
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
 }
 
 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
 {
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
+
     WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
 }
 
 unsigned long long BlobRegistryProxy::blobSize(const URL& url)
 {
+    ASSERT(WebProcess::singleton().usesNetworkProcess());
+
     uint64_t resultSize;
     if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
         return 0;
@@ -76,3 +90,5 @@ unsigned long long BlobRegistryProxy::blobSize(const URL& url)
 }
 
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index ad1a7c5..8cc069a 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef BlobRegistryProxy_h
 #define BlobRegistryProxy_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include <WebCore/BlobRegistry.h>
 
 namespace WebKit {
@@ -42,4 +44,6 @@ public:
 
 }
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // BlobRegistryProxy_h
index de3e5c0..714865d 100644 (file)
@@ -37,6 +37,8 @@
 #include <WebCore/SessionID.h>
 #include <WebCore/SharedBuffer.h>
 
+#if ENABLE(NETWORK_PROCESS)
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -96,3 +98,5 @@ void NetworkProcessConnection::didCacheResource(const ResourceRequest& request,
 #endif
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index cae80a3..0d5ad08 100644 (file)
@@ -31,6 +31,8 @@
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(NETWORK_PROCESS)
+
 namespace IPC {
 class DataReference;
 }
@@ -80,4 +82,7 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
+
 #endif // NetworkProcessConnection_h
index c2407f2..c1f78c4 100644 (file)
@@ -20,6 +20,8 @@
 # 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 ENABLE(NETWORK_PROCESS)
+
 messages -> NetworkProcessConnection LegacyReceiver {
 
 #if ENABLE(SHAREABLE_RESOURCE)
@@ -27,3 +29,5 @@ messages -> NetworkProcessConnection LegacyReceiver {
 #endif
 
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index 85778a8..6e3af30 100644 (file)
@@ -52,6 +52,8 @@
 #include <WebCore/SubresourceLoader.h>
 #include <wtf/text/CString.h>
 
+#if ENABLE(NETWORK_PROCESS)
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -284,3 +286,5 @@ void WebResourceLoadScheduler::networkProcessCrashed()
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 221e174..c32309c 100644 (file)
@@ -32,6 +32,8 @@
 #include <WebCore/ResourceLoader.h>
 #include <wtf/RunLoop.h>
 
+#if ENABLE(NETWORK_PROCESS)
+
 namespace WebKit {
 
 class NetworkProcessConnection;
@@ -75,4 +77,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // WebResourceLoadScheduler_h
index f41b779..3753797 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "WebResourceLoader.h"
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "DataReference.h"
 #include "Logging.h"
 #include "NetworkProcessConnection.h"
@@ -219,3 +221,5 @@ void WebResourceLoader::canAuthenticateAgainstProtectionSpace(const ProtectionSp
 #endif
 
 } // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
index 3a62009..796806e 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef WebResourceLoader_h
 #define WebResourceLoader_h
 
+#if ENABLE(NETWORK_PROCESS)
+
 #include "Connection.h"
 #include "MessageSender.h"
 #include "ShareableResource.h"
@@ -92,4 +94,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETWORK_PROCESS)
+
 #endif // WebResourceLoader_h
index 67fd0d9..3994d97 100644 (file)
@@ -20,6 +20,8 @@
 # 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 ENABLE(NETWORK_PROCESS)
+
 messages -> WebResourceLoader LegacyReceiver {
     WillSendRequest(WebCore::ResourceRequest request, WebCore::ResourceResponse redirectResponse)
     DidSendData(uint64_t bytesSent, uint64_t totalBytesToBeSent)
@@ -37,3 +39,5 @@ messages -> WebResourceLoader LegacyReceiver {
     DidReceiveResource(WebKit::ShareableResource::Handle resource, double finishTime)
 #endif
 }
+
+#endif // ENABLE(NETWORK_PROCESS)
index cc6e74d..8e84f80 100644 (file)
@@ -1053,7 +1053,11 @@ static void initializeBrowserFuncs(NPNetscapeFuncs &netscapeFuncs)
     netscapeFuncs.popupcontextmenu = 0;
     netscapeFuncs.convertpoint = 0;
 #endif
+#if ENABLE(NETWORK_PROCESS)
     netscapeFuncs.urlredirectresponse = NPN_URLRedirectResponse;
+#else
+    netscapeFuncs.urlredirectresponse = 0;
+#endif
 }
     
 NPNetscapeFuncs* netscapeBrowserFuncs()
index bd95b43..5f78963 100644 (file)
@@ -400,12 +400,16 @@ bool NetscapePlugin::getAuthenticationInfo(const ProtectionSpace& protectionSpac
 
 void NetscapePlugin::registerRedirect(NetscapePluginStream* stream, const URL& requestURL, int redirectResponseStatus, void* notificationData)
 {
+#if ENABLE(NETWORK_PROCESS)
     // NPP_URLRedirectNotify may synchronously request this stream back out, so set it first
     m_redirects.set(notificationData, std::make_pair(stream, requestURL.string()));
     if (!NPP_URLRedirectNotify(requestURL.string().utf8().data(), redirectResponseStatus, notificationData)) {
         m_redirects.take(notificationData);
         controller()->continueStreamLoad(stream->streamID());
     }
+#else
+    controller()->continueStreamLoad(stream->streamID());
+#endif
 }
 
 void NetscapePlugin::urlRedirectResponse(void* notifyData, bool allow)
index 8d22ec9..443aceb 100644 (file)
 #include "config.h"
 #include "WebPlatformStrategies.h"
 
-#include "BlobRegistryProxy.h"
 #include "BlockingResponseMap.h"
 #include "DataReference.h"
 #include "HangDetectionDisabler.h"
-#include "NetworkConnectionToWebProcessMessages.h"
-#include "NetworkProcessConnection.h"
 #include "NetworkResourceLoadParameters.h"
 #include "PluginInfoStore.h"
 #include "SessionTracker.h"
@@ -47,7 +44,6 @@
 #include "WebPasteboardProxyMessages.h"
 #include "WebProcess.h"
 #include "WebProcessProxyMessages.h"
-#include "WebResourceLoadScheduler.h"
 #include <WebCore/Color.h>
 #include <WebCore/DocumentLoader.h>
 #include <WebCore/IDBFactoryBackendInterface.h>
 #include <WebCore/URL.h>
 #include <wtf/Atomics.h>
 
+#if ENABLE(NETWORK_PROCESS)
+#include "BlobRegistryProxy.h"
+#include "NetworkConnectionToWebProcessMessages.h"
+#include "NetworkProcessConnection.h"
+#include "WebResourceLoadScheduler.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -109,56 +112,114 @@ PluginStrategy* WebPlatformStrategies::createPluginStrategy()
 
 String WebPlatformStrategies::cookiesForDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url)
 {
+#if ENABLE(NETWORK_PROCESS)
     auto& webProcess = WebProcess::singleton();
-    String result;
-    if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
-        return String();
-    return result;
+    if (webProcess.usesNetworkProcess()) {
+        String result;
+        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(result), 0))
+            return String();
+        return result;
+    }
+#endif
+
+    return WebCore::cookiesForDOM(session, firstParty, url);
 }
 
 void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const String& cookieString)
 {
+#if ENABLE(NETWORK_PROCESS)
     auto& webProcess = WebProcess::singleton();
-    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(SessionTracker::sessionID(session), firstParty, url, cookieString), 0);
+    if (webProcess.usesNetworkProcess()) {
+        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(SessionTracker::sessionID(session), firstParty, url, cookieString), 0);
+        return;
+    }
+#endif
+
+    WebCore::setCookiesFromDOM(session, firstParty, url, cookieString);
 }
 
 bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session, const URL& firstParty, const URL& url)
 {
-    bool result;
-    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
-        return false;
-    return result;
+#if ENABLE(NETWORK_PROCESS)
+    auto& webProcess = WebProcess::singleton();
+    if (webProcess.usesNetworkProcess()) {
+        bool result;
+        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
+            return false;
+        return result;
+    }
+#endif
+
+    return WebCore::cookiesEnabled(session, firstParty, url);
 }
 
 String WebPlatformStrategies::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const URL& firstParty, const URL& url)
 {
-    String result;
-    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
-        return String();
-    return result;
+#if ENABLE(NETWORK_PROCESS)
+    auto& webProcess = WebProcess::singleton();
+    if (webProcess.usesNetworkProcess()) {
+        String result;
+        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(result), 0))
+            return String();
+        return result;
+    }
+#endif
+
+    return WebCore::cookieRequestHeaderFieldValue(session, firstParty, url);
 }
 
 bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const URL& url, Vector<Cookie>& rawCookies)
 {
-    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
-        return false;
-    return true;
+#if ENABLE(NETWORK_PROCESS)
+    auto& webProcess = WebProcess::singleton();
+    if (webProcess.usesNetworkProcess()) {
+        if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(SessionTracker::sessionID(session), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
+            return false;
+        return true;
+    }
+#endif
+
+    return WebCore::getRawCookies(session, firstParty, url, rawCookies);
 }
 
 void WebPlatformStrategies::deleteCookie(const NetworkStorageSession& session, const URL& url, const String& cookieName)
 {
-    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(SessionTracker::sessionID(session), url, cookieName), 0);
+#if ENABLE(NETWORK_PROCESS)
+    auto& webProcess = WebProcess::singleton();
+    if (webProcess.usesNetworkProcess()) {
+        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::DeleteCookie(SessionTracker::sessionID(session), url, cookieName), 0);
+        return;
+    }
+#endif
+
+    WebCore::deleteCookie(session, url, cookieName);
 }
 
 // LoaderStrategy
 
+#if ENABLE(NETWORK_PROCESS)
 ResourceLoadScheduler* WebPlatformStrategies::resourceLoadScheduler()
 {
-    return &WebProcess::singleton().webResourceLoadScheduler();
+    static ResourceLoadScheduler* scheduler;
+    if (!scheduler) {
+        auto& webProcess = WebProcess::singleton();
+        if (webProcess.usesNetworkProcess())
+            scheduler = &webProcess.webResourceLoadScheduler();
+        else
+            scheduler = WebCore::resourceLoadScheduler();
+    }
+    
+    return scheduler;
 }
 
 void WebPlatformStrategies::loadResourceSynchronously(NetworkingContext* context, unsigned long resourceLoadIdentifier, const ResourceRequest& request, StoredCredentials storedCredentials, ClientCredentialPolicy clientCredentialPolicy, ResourceError& error, ResourceResponse& response, Vector<char>& data)
 {
+    auto& webProcess = WebProcess::singleton();
+    if (!webProcess.usesNetworkProcess()) {
+        LoaderStrategy::loadResourceSynchronously(context, resourceLoadIdentifier, request, storedCredentials, clientCredentialPolicy, error, response, data);
+        return;
+    }
+
     WebFrameNetworkingContext* webContext = static_cast<WebFrameNetworkingContext*>(context);
     // FIXME: Some entities in WebCore use WebCore's "EmptyFrameLoaderClient" instead of having a proper WebFrameLoaderClient.
     // EmptyFrameLoaderClient shouldn't exist and everything should be using a WebFrameLoaderClient,
@@ -182,7 +243,7 @@ void WebPlatformStrategies::loadResourceSynchronously(NetworkingContext* context
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    if (!WebProcess::singleton().networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
+    if (!webProcess.networkConnection()->connection()->sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
         response = ResourceResponse();
         error = internalError(request.url());
     }
@@ -195,6 +256,12 @@ void WebPlatformStrategies::createPingHandle(NetworkingContext* networkingContex
     if (!networkingContext)
         return;
 
+    auto& webProcess = WebProcess::singleton();
+    if (!webProcess.usesNetworkProcess()) {
+        LoaderStrategy::createPingHandle(networkingContext, request, shouldUseCredentialStorage);
+        return;
+    }
+
     WebFrameNetworkingContext* webContext = static_cast<WebFrameNetworkingContext*>(networkingContext);
     WebFrameLoaderClient* webFrameLoaderClient = webContext->webFrameLoaderClient();
     WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : nullptr;
@@ -206,13 +273,16 @@ void WebPlatformStrategies::createPingHandle(NetworkingContext* networkingContex
     loadParameters.allowStoredCredentials = shouldUseCredentialStorage ? AllowStoredCredentials : DoNotAllowStoredCredentials;
     loadParameters.shouldClearReferrerOnHTTPSToHTTPRedirect = networkingContext->shouldClearReferrerOnHTTPSToHTTPRedirect();
 
-    WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::LoadPing(loadParameters), 0);
+    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::LoadPing(loadParameters), 0);
 }
 
 BlobRegistry* WebPlatformStrategies::createBlobRegistry()
 {
+    if (!WebProcess::singleton().usesNetworkProcess())
+        return LoaderStrategy::createBlobRegistry();
     return new BlobRegistryProxy;    
 }
+#endif
 
 // PluginStrategy
 
index eb9a132..c5841aa 100644 (file)
@@ -59,10 +59,12 @@ private:
     virtual void deleteCookie(const WebCore::NetworkStorageSession&, const WebCore::URL&, const String&) override;
 
     // WebCore::LoaderStrategy
+#if ENABLE(NETWORK_PROCESS)
     virtual WebCore::ResourceLoadScheduler* resourceLoadScheduler() override;
     virtual void loadResourceSynchronously(WebCore::NetworkingContext*, unsigned long resourceLoadIdentifier, const WebCore::ResourceRequest&, WebCore::StoredCredentials, WebCore::ClientCredentialPolicy, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>& data) override;
     virtual WebCore::BlobRegistry* createBlobRegistry() override;
     virtual void createPingHandle(WebCore::NetworkingContext*, WebCore::ResourceRequest&, bool shouldUseCredentialStorage) override;
+#endif
 
     // WebCore::PluginStrategy
     virtual void refreshPlugins() override;
index dc2a50c..fa05407 100644 (file)
 #include "InjectedBundleNodeHandle.h"
 #include "InjectedBundleRangeHandle.h"
 #include "InjectedBundleScriptWorld.h"
-#include "NetworkConnectionToWebProcessMessages.h"
-#include "NetworkProcessConnection.h"
 #include "PluginView.h"
 #include "WKAPICast.h"
 #include "WKBundleAPICast.h"
 #include "WebChromeClient.h"
-#include "WebCoreArgumentCoders.h"
 #include "WebDocumentLoader.h"
 #include "WebPage.h"
 #include "WebPageProxyMessages.h"
 #include <WebCore/LegacyWebArchive.h>
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+#include "NetworkConnectionToWebProcessMessages.h"
+#include "NetworkProcessConnection.h"
+#include "WebCoreArgumentCoders.h"
+#endif
+
 #ifndef NDEBUG
 #include <wtf/RefCountedLeakCounter.h>
 #endif
@@ -254,9 +257,23 @@ void WebFrame::startDownload(const WebCore::ResourceRequest& request)
     m_policyDownloadID = 0;
 
     auto& webProcess = WebProcess::singleton();
+#if USE(NETWORK_SESSION)
+    ASSERT(webProcess.usesNetworkProcess());
+#endif
     SessionID sessionID = page() ? page()->sessionID() : SessionID::defaultSessionID();
-    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request), 0);
-    return;
+#if ENABLE(NETWORK_PROCESS)
+    if (webProcess.usesNetworkProcess()) {
+        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request), 0);
+        return;
+    }
+#endif
+
+#if USE(NETWORK_SESSION)
+    // Using NETWORK_SESSION requires the use of a network process.
+    RELEASE_ASSERT_NOT_REACHED();
+#else
+    webProcess.downloadManager().startDownload(sessionID, policyDownloadID, request);
+#endif
 }
 
 void WebFrame::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, SessionID sessionID, const ResourceRequest& request, const ResourceResponse& response)
@@ -269,12 +286,39 @@ void WebFrame::convertMainResourceLoadToDownload(DocumentLoader* documentLoader,
     SubresourceLoader* mainResourceLoader = documentLoader->mainResourceLoader();
 
     auto& webProcess = WebProcess::singleton();
-    // Use 0 to indicate that the resource load can't be converted and a new download must be started.
-    // This can happen if there is no loader because the main resource is in the WebCore memory cache,
-    // or because the conversion was attempted when not calling SubresourceLoader::didReceiveResponse().
-    uint64_t mainResourceLoadIdentifier = mainResourceLoader ? mainResourceLoader->identifier() : 0;
+#if ENABLE(NETWORK_PROCESS)
+#if USE(NETWORK_SESSION)
+    ASSERT(webProcess.usesNetworkProcess());
+#endif
+    if (webProcess.usesNetworkProcess()) {
+        // Use 0 to indicate that the resource load can't be converted and a new download must be started.
+        // This can happen if there is no loader because the main resource is in the WebCore memory cache,
+        // or because the conversion was attempted when not calling SubresourceLoader::didReceiveResponse().
+        uint64_t mainResourceLoadIdentifier;
+        if (mainResourceLoader)
+            mainResourceLoadIdentifier = mainResourceLoader->identifier();
+        else
+            mainResourceLoadIdentifier = 0;
+
+        webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
+        return;
+    }
+#endif
 
-    webProcess.networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
+    if (!mainResourceLoader) {
+        // The main resource has already been loaded. Start a new download instead.
+#if !USE(NETWORK_SESSION)
+        webProcess.downloadManager().startDownload(sessionID, policyDownloadID, request);
+#endif
+        return;
+    }
+
+#if USE(NETWORK_SESSION)
+    // Using NETWORK_SESSION requires the use of a network process.
+    RELEASE_ASSERT_NOT_REACHED();
+#else
+    webProcess.downloadManager().convertHandleToDownload(policyDownloadID, documentLoader->mainResourceLoader()->handle(), request, response);
+#endif
 }
 
 String WebFrame::source() const
index d9b0a7b..38a4d8f 100644 (file)
@@ -37,7 +37,6 @@
 #include "InjectedBundle.h"
 #include "Logging.h"
 #include "NetworkConnectionToWebProcessMessages.h"
-#include "NetworkProcessConnection.h"
 #include "PluginProcessConnectionManager.h"
 #include "SessionTracker.h"
 #include "StatisticsData.h"
@@ -61,7 +60,6 @@
 #include "WebProcessMessages.h"
 #include "WebProcessPoolMessages.h"
 #include "WebProcessProxyMessages.h"
-#include "WebResourceLoadScheduler.h"
 #include "WebsiteData.h"
 #include "WebsiteDataTypes.h"
 #include <JavaScriptCore/JSLock.h>
 #include "ObjCObjectGraph.h"
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
 #if PLATFORM(COCOA)
 #include "CookieStorageShim.h"
 #endif
+#include "NetworkProcessConnection.h"
+#endif
 
 #if ENABLE(SEC_ITEM_SHIM)
 #include "SecItemShim.h"
 #include "WebBatteryManager.h"
 #endif
 
+#if ENABLE(NETWORK_PROCESS)
+#include "WebResourceLoadScheduler.h"
+#endif
+
 #if ENABLE(REMOTE_INSPECTOR)
 #include <JavaScriptCore/RemoteInspector.h>
 #endif
@@ -156,8 +161,11 @@ WebProcess::WebProcess()
     , m_fullKeyboardAccessEnabled(false)
     , m_textCheckerState()
     , m_iconDatabaseProxy(new WebIconDatabaseProxy(this))
+#if ENABLE(NETWORK_PROCESS)
+    , m_usesNetworkProcess(false)
     , m_webResourceLoadScheduler(new WebResourceLoadScheduler)
     , m_dnsPrefetchHystereris([this](HysteresisState state) { if (state == HysteresisState::Stopped) m_dnsPrefetchedHosts.clear(); })
+#endif
 #if ENABLE(NETSCAPE_PLUGIN_API)
     , m_pluginProcessConnectionManager(PluginProcessConnectionManager::create())
 #endif
@@ -244,10 +252,34 @@ void WebProcess::initializeConnection(IPC::Connection* connection)
     connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true);
 }
 
+void WebProcess::didCreateDownload()
+{
+    disableTermination();
+}
+
+void WebProcess::didDestroyDownload()
+{
+    enableTermination();
+}
+
+IPC::Connection* WebProcess::downloadProxyConnection()
+{
+    return parentProcessConnection();
+}
+
+AuthenticationManager& WebProcess::downloadsAuthenticationManager()
+{
+    return *supplement<AuthenticationManager>();
+}
+
 void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
 {
     ASSERT(m_pageMap.isEmpty());
 
+#if ENABLE(NETWORK_PROCESS)
+    m_usesNetworkProcess = parameters.usesNetworkProcess;
+#endif
+
 #if OS(LINUX)
     WebCore::MemoryPressureHandler::ReliefLogger::setLoggingEnabled(parameters.shouldEnableMemoryPressureReliefLogging);
 #endif
@@ -326,10 +358,13 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
     if (parameters.shouldUseTestingNetworkSession)
         NetworkStorageSession::switchToNewTestingSession();
 
+#if ENABLE(NETWORK_PROCESS)
     ensureNetworkProcessConnection();
 
 #if PLATFORM(COCOA)
-    CookieStorageShim::singleton().initialize();
+    if (usesNetworkProcess())
+        CookieStorageShim::singleton().initialize();
+#endif
 #endif
     setTerminationTimeout(parameters.terminationTimeout);
 
@@ -361,8 +396,12 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
 #endif
 }
 
+#if ENABLE(NETWORK_PROCESS)
 void WebProcess::ensureNetworkProcessConnection()
 {
+    if (!m_usesNetworkProcess)
+        return;
+
     if (m_networkProcessConnection)
         return;
 
@@ -383,6 +422,7 @@ void WebProcess::ensureNetworkProcessConnection()
         return;
     m_networkProcessConnection = NetworkProcessConnection::create(connectionIdentifier);
 }
+#endif // ENABLE(NETWORK_PROCESS)
 
 void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)
 {
@@ -471,6 +511,14 @@ void WebProcess::destroyPrivateBrowsingSession(SessionID sessionID)
 #endif
 }
 
+DownloadManager& WebProcess::downloadManager()
+{
+    ASSERT(!usesNetworkProcess());
+
+    static NeverDestroyed<DownloadManager> downloadManager(this);
+    return downloadManager;
+}
+
 #if ENABLE(NETSCAPE_PLUGIN_API)
 PluginProcessConnectionManager& WebProcess::pluginProcessConnectionManager()
 {
@@ -533,6 +581,7 @@ void WebProcess::removeWebPage(uint64_t pageID)
 bool WebProcess::shouldTerminate()
 {
     ASSERT(m_pageMap.isEmpty());
+    ASSERT(usesNetworkProcess() || !downloadManager().isDownloading());
 
     // FIXME: the ShouldTerminate message should also send termination parameters, such as any session cookies that need to be preserved.
     bool shouldTerminate = false;
@@ -976,8 +1025,20 @@ void WebProcess::setInjectedBundleParameters(const IPC::DataReference& value)
     injectedBundle->setBundleParameters(value);
 }
 
+bool WebProcess::usesNetworkProcess() const
+{
+#if ENABLE(NETWORK_PROCESS)
+    return m_usesNetworkProcess;
+#else
+    return false;
+#endif
+}
+
+#if ENABLE(NETWORK_PROCESS)
 NetworkProcessConnection* WebProcess::networkConnection()
 {
+    ASSERT(m_usesNetworkProcess);
+
     // If we've lost our connection to the network process (e.g. it crashed) try to re-establish it.
     if (!m_networkProcessConnection)
         ensureNetworkProcessConnection();
@@ -1003,6 +1064,7 @@ WebResourceLoadScheduler& WebProcess::webResourceLoadScheduler()
 {
     return *m_webResourceLoadScheduler;
 }
+#endif // ENABLED(NETWORK_PROCESS)
 
 #if ENABLE(DATABASE_PROCESS)
 void WebProcess::webToDatabaseProcessConnectionClosed(WebToDatabaseProcessConnection* connection)
@@ -1046,6 +1108,27 @@ void WebProcess::ensureWebToDatabaseProcessConnection()
 
 #endif // ENABLED(DATABASE_PROCESS)
 
+void WebProcess::downloadRequest(SessionID sessionID, uint64_t downloadID, uint64_t initiatingPageID, const ResourceRequest& request)
+{
+    WebPage* initiatingPage = initiatingPageID ? webPage(initiatingPageID) : 0;
+
+    ResourceRequest requestWithOriginalURL = request;
+    if (initiatingPage)
+        initiatingPage->mainFrame()->loader().setOriginalURLForDownloadRequest(requestWithOriginalURL);
+
+    downloadManager().startDownload(sessionID, downloadID, requestWithOriginalURL);
+}
+
+void WebProcess::resumeDownload(uint64_t downloadID, const IPC::DataReference& resumeData, const String& path, const WebKit::SandboxExtension::Handle& sandboxExtensionHandle)
+{
+    downloadManager().resumeDownload(downloadID, resumeData, path, sandboxExtensionHandle);
+}
+
+void WebProcess::cancelDownload(uint64_t downloadID)
+{
+    downloadManager().cancelDownload(downloadID);
+}
+
 void WebProcess::setEnhancedAccessibility(bool flag)
 {
     WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility(flag);
@@ -1387,12 +1470,18 @@ void WebProcess::prefetchDNS(const String& hostname)
     if (hostname.isEmpty())
         return;
 
-    if (m_dnsPrefetchedHosts.add(hostname).isNewEntry)
-        networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
-    // The DNS prefetched hosts cache is only to avoid asking for the same hosts too many times
-    // in a very short period of time, producing a lot of IPC traffic. So we clear this cache after
-    // some time of no DNS requests.
-    m_dnsPrefetchHystereris.impulse();
+#if ENABLE(NETWORK_PROCESS)
+    if (usesNetworkProcess()) {
+        if (m_dnsPrefetchedHosts.add(hostname).isNewEntry)
+            networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
+        // The DNS prefetched hosts cache is only to avoid asking for the same hosts too many times
+        // in a very short period of time, producing a lot of IPC traffic. So we clear this cache after
+        // some time of no DNS requests.
+        m_dnsPrefetchHystereris.impulse();
+        return;
+    }
+#endif
+    WebCore::prefetchDNS(hostname);
 }
 
 } // namespace WebKit
index 4749459..27006e5 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CacheModel.h"
 #include "ChildProcess.h"
+#include "DownloadManager.h"
 #include "DrawingArea.h"
 #include "PluginProcessConnectionManager.h"
 #include "ResourceCachesToClear.h"
@@ -70,9 +71,9 @@ struct SecurityOriginData;
 
 namespace WebKit {
 
+class DownloadManager;
 class EventDispatcher;
 class InjectedBundle;
-class NetworkProcessConnection;
 class ObjCObjectGraph;
 class UserData;
 class WebConnectionToUIProcess;
@@ -81,17 +82,22 @@ class WebIconDatabaseProxy;
 class WebPage;
 class WebPageGroupProxy;
 class WebProcessSupplement;
-class WebResourceLoadScheduler;
 struct WebPageCreationParameters;
 struct WebPageGroupData;
 struct WebPreferencesStore;
 struct WebProcessCreationParameters;
 
+#if ENABLE(NETWORK_PROCESS)
+class NetworkProcessConnection;
+class WebResourceLoadScheduler;
+#endif
+
 #if ENABLE(DATABASE_PROCESS)
 class WebToDatabaseProcessConnection;
 #endif
 
-class WebProcess : public ChildProcess {
+class WebProcess : public ChildProcess, private DownloadManager::Client {
+    friend class NeverDestroyed<DownloadManager>;
 public:
     static WebProcess& singleton();
 
@@ -141,6 +147,7 @@ public:
 #endif
     
     const TextCheckerState& textCheckerState() const { return m_textCheckerState; }
+    DownloadManager& downloadManager();
 
     void clearResourceCaches(ResourceCachesToClear = AllResourceCaches);
     
@@ -150,9 +157,13 @@ public:
 
     EventDispatcher& eventDispatcher() { return *m_eventDispatcher; }
 
+    bool usesNetworkProcess() const;
+
+#if ENABLE(NETWORK_PROCESS)
     NetworkProcessConnection* networkConnection();
     void networkProcessConnectionClosed(NetworkProcessConnection*);
     WebResourceLoadScheduler& webResourceLoadScheduler();
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
     void webToDatabaseProcessConnectionClosed(WebToDatabaseProcessConnection*);
@@ -211,6 +222,12 @@ private:
     WebProcess();
     ~WebProcess();
 
+    // DownloadManager::Client.
+    virtual void didCreateDownload() override;
+    virtual void didDestroyDownload() override;
+    virtual IPC::Connection* downloadProxyConnection() override;
+    virtual AuthenticationManager& downloadsAuthenticationManager() override;
+
     void initializeWebProcess(WebProcessCreationParameters&&);
     void platformInitializeWebProcess(WebProcessCreationParameters&&);
 
@@ -342,11 +359,14 @@ private:
 
     WebIconDatabaseProxy* m_iconDatabaseProxy;
 
+#if ENABLE(NETWORK_PROCESS)
     void ensureNetworkProcessConnection();
     RefPtr<NetworkProcessConnection> m_networkProcessConnection;
+    bool m_usesNetworkProcess;
     WebResourceLoadScheduler* m_webResourceLoadScheduler;
     HashSet<String> m_dnsPrefetchedHosts;
     WebCore::HysteresisActivity m_dnsPrefetchHystereris;
+#endif
 
 #if ENABLE(DATABASE_PROCESS)
     void ensureWebToDatabaseProcessConnection();
index 461027e..d4372ce 100644 (file)
@@ -62,6 +62,12 @@ messages -> WebProcess LegacyReceiver {
     void StartMemorySampler(WebKit::SandboxExtension::Handle sampleLogFileHandle, String sampleLogFilePath, double interval);
     void StopMemorySampler();
 
+    # Downloads. This should really be in a Download.messages.in, but it seemed unnecessary to create a new file just for
+    # three messages.
+    DownloadRequest(WebCore::SessionID sessionID, uint64_t downloadID, uint64_t initiatingPageID, WebCore::ResourceRequest request)
+    ResumeDownload(uint64_t downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
+    CancelDownload(uint64_t downloadID)
+
     SetTextCheckerState(struct WebKit::TextCheckerState textCheckerState)
 
     SetEnhancedAccessibility(bool flag)
index e39e15c..325be46 100644 (file)
 
 namespace WebKit {
 
+static uint64_t getCacheDiskFreeSize(SoupCache* cache)
+{
+    ASSERT(cache);
+
+    GUniqueOutPtr<char> cacheDir;
+    g_object_get(G_OBJECT(cache), "cache-dir", &cacheDir.outPtr(), NULL);
+    if (!cacheDir)
+        return 0;
+
+    return WebCore::getVolumeFreeSizeForPath(cacheDir.get());
+}
+
 void WebProcess::platformSetCacheModel(CacheModel cacheModel)
 {
     unsigned cacheTotalCapacity = 0;
@@ -61,6 +73,12 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
     unsigned long urlCacheDiskCapacity = 0;
 
     uint64_t diskFreeSize = 0;
+    SoupCache* cache = nullptr;
+
+    if (!usesNetworkProcess()) {
+        cache = WebCore::SoupNetworkSession::defaultSession().cache();
+        diskFreeSize = getCacheDiskFreeSize(cache) / WTF::MB;
+    }
 
     uint64_t memSize = WTF::ramSize() / WTF::MB;
     calculateCacheSizes(cacheModel, memSize, diskFreeSize,
@@ -76,10 +94,33 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
 #if PLATFORM(GTK)
     WebCore::PageCache::singleton().setShouldClearBackingStores(true);
 #endif
+
+    if (!usesNetworkProcess()) {
+        if (urlCacheDiskCapacity > soup_cache_get_max_size(cache))
+            soup_cache_set_max_size(cache, urlCacheDiskCapacity);
+    }
 }
 
 void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear)
 {
+    if (cachesToClear == InMemoryResourceCachesOnly)
+        return;
+
+    // If we're using the network process then it is the only one that needs to clear the disk cache.
+    if (usesNetworkProcess())
+        return;
+
+    soup_cache_clear(WebCore::SoupNetworkSession::defaultSession().cache());
+}
+
+static void setSoupSessionAcceptLanguage(const Vector<String>& languages)
+{
+    WebCore::SoupNetworkSession::defaultSession().setAcceptLanguages(languages);
+}
+
+static void languageChanged(void*)
+{
+    setSoupSessionAcceptLanguage(WebCore::userPreferredLanguages());
 }
 
 void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& parameters)
@@ -94,18 +135,62 @@ void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&& par
         seccompFilters.initialize();
     }
 #endif
+
+    if (usesNetworkProcess())
+        return;
+
+    ASSERT(!parameters.diskCacheDirectory.isEmpty());
+
+    // We used to use the given cache directory for the soup cache, but now we use a subdirectory to avoid
+    // conflicts with other cache files in the same directory. Remove the old cache files if they still exist.
+    WebCore::SoupNetworkSession::defaultSession().clearCache(WebCore::directoryName(parameters.diskCacheDirectory));
+
+#if ENABLE(NETWORK_CACHE)
+    // When network cache is enabled, the disk cache directory is the network process one.
+    CString diskCachePath = WebCore::pathByAppendingComponent(WebCore::directoryName(parameters.diskCacheDirectory), "webkit").utf8();
+#else
+    CString diskCachePath = parameters.diskCacheDirectory.utf8();
+#endif
+
+    GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(diskCachePath.data(), SOUP_CACHE_SINGLE_USER));
+    WebCore::SoupNetworkSession::defaultSession().setCache(soupCache.get());
+    // Set an initial huge max_size for the SoupCache so the call to soup_cache_load() won't evict any cached
+    // resource. The final size of the cache will be set by NetworkProcess::platformSetCacheModel().
+    unsigned initialMaxSize = soup_cache_get_max_size(soupCache.get());
+    soup_cache_set_max_size(soupCache.get(), G_MAXUINT);
+    soup_cache_load(soupCache.get());
+    soup_cache_set_max_size(soupCache.get(), initialMaxSize);
+
+    if (!parameters.cookiePersistentStoragePath.isEmpty()) {
+        supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath,
+            parameters.cookiePersistentStorageType);
+    }
+    supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy);
+
+    if (!parameters.languages.isEmpty())
+        setSoupSessionAcceptLanguage(parameters.languages);
+
+    setIgnoreTLSErrors(parameters.ignoreTLSErrors);
+
+    WebCore::addLanguageChangeObserver(this, languageChanged);
 }
 
 void WebProcess::platformTerminate()
 {
+    if (!usesNetworkProcess())
+        WebCore::removeLanguageChangeObserver(this);
 }
 
 void WebProcess::setIgnoreTLSErrors(bool ignoreTLSErrors)
 {
+    ASSERT(!usesNetworkProcess());
+    WebCore::ResourceHandle::setIgnoreSSLErrors(ignoreTLSErrors);
 }
 
 void WebProcess::allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo& certificateInfo, const String& host)
 {
+    ASSERT(!usesNetworkProcess());
+    WebCore::ResourceHandle::setClientCertificate(host, certificateInfo.certificate());
 }
 
 } // namespace WebKit
index 24e30a4..0d640c8 100644 (file)
@@ -91,7 +91,7 @@
 #endif
 
 #ifndef ENABLE_NETWORK_CACHE
-#if PLATFORM(COCOA) || PLATFORM(GTK)
+#if ENABLE(NETWORK_PROCESS) && (PLATFORM(COCOA) || PLATFORM(GTK))
 #define ENABLE_NETWORK_CACHE 1
 #else
 #define ENABLE_NETWORK_CACHE 0
index bc83089..811c9e5 100644 (file)
@@ -106,6 +106,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MOUSE_CURSOR_SCALE PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_CONTENT_UTILS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_HWCONCURRENCY PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PUBLIC ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOSNIFF PUBLIC ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PUBLIC_SUFFIX_LIST PRIVATE ON)
index ff44193..986afff 100644 (file)
@@ -186,6 +186,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO_TRACK PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIEW_MODE_CSS_MEDIA PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_TIMING PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THREADED_COMPOSITOR PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHADOW_DOM PRIVATE OFF)
 
index f654f66..ae64450 100644 (file)
@@ -220,6 +220,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_IOS_AIRPLAY_iphonesimulator PRIVATE OFF)
 
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SANDBOX_EXTENSIONS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_PROCESS_SANDBOX PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_PROCESS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DATABASE_PROCESS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PLUGIN_PROCESS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON)
index d96224d..9395a66 100644 (file)
@@ -128,6 +128,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_NAVIGATOR_HWCONCURRENCY "Toggle Navigator hardware concurrency support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_NOSNIFF "Toggle support for 'X-Content-Type-Options: nosniff'" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_NETSCAPE_PLUGIN_API "Toggle Netscape Plugin support" PRIVATE ON)
+    WEBKIT_OPTION_DEFINE(ENABLE_NETWORK_PROCESS "Toggle dedicated network process support in WebKit2" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_NOTIFICATIONS "Toggle Desktop Notifications Support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_ORIENTATION_EVENTS "Toggle Orientation Events support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_PDFKIT_PLUGIN "Toggle PDFKit plugin support" PRIVATE OFF)
index de3d8d4..86d30e5 100644 (file)
@@ -1,3 +1,19 @@
+2015-11-19  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r192667 and r192668.
+        https://bugs.webkit.org/show_bug.cgi?id=151476
+
+        broke api tests (Requested by alexchristensen on #webkit).
+
+        Reverted changesets:
+
+        "Remove the non-NetworkProcess configurations"
+        https://bugs.webkit.org/show_bug.cgi?id=151418
+        http://trac.webkit.org/changeset/192667
+
+        "Fix GTK Build after r192667."
+        http://trac.webkit.org/changeset/192668
+
 2015-11-19  Alex Christensen  <achristensen@webkit.org>
 
         Remove the non-NetworkProcess configurations
index 7cd4f7c..c5c3eff 100644 (file)
@@ -42,6 +42,7 @@ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef us
 TEST(WebKit2, GetPIDAfterAbortedProcessLaunch)
 {
     WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+    WKContextSetUsesNetworkProcess(context.get(), true);
 
     PlatformWebView webView(context.get());
 
index 1bf5cc5..0b592d0 100644 (file)
@@ -400,6 +400,11 @@ WKRetainPtr<WKPageConfigurationRef> TestController::generatePageConfiguration(WK
 
     m_geolocationProvider = std::make_unique<GeolocationProviderMock>(m_context.get());
 
+#if PLATFORM(EFL)
+    WKContextSetUsesNetworkProcess(m_context.get(), false);
+    WKContextSetProcessModel(m_context.get(), kWKProcessModelSharedSecondaryProcess);
+#endif
+
     if (const char* dumpRenderTreeTemp = libraryPathForTesting()) {
         String temporaryFolder = String::fromUTF8(dumpRenderTreeTemp);