Title: [173255] trunk/Source/WebKit2
Revision
173255
Author
[email protected]
Date
2014-09-04 00:41:27 -0700 (Thu, 04 Sep 2014)

Log Message

Initialize m_usesNetworkProcess earlier in WebProcess::initializeWebProcess()
https://bugs.webkit.org/show_bug.cgi?id=136478

Reviewed by Alexey Proskuryakov.

The soup network backend uses WebProcess::usesNetworkProcess()
from WebProcess::platformSetCacheModel() and
WebProcess::platformInitializeWebProcess(), both called before the
m_usesNetworkProcess member has been initialized.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Move the
m_usesNetworkProcess initialization at the beginning right before
calling platformInitializeWebProcess().
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetCacheModel): Remove the early
return when using the network process, since this was dead code
before this change, and not really needed now that
usesNetworkProcess() will return true.
(WebKit::WebProcess::platformInitializeWebProcess): Remove comment
that is not accurate since r171156.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (173254 => 173255)


--- trunk/Source/WebKit2/ChangeLog	2014-09-04 07:03:54 UTC (rev 173254)
+++ trunk/Source/WebKit2/ChangeLog	2014-09-04 07:41:27 UTC (rev 173255)
@@ -1,3 +1,27 @@
+2014-09-04  Carlos Garcia Campos  <[email protected]>
+
+        Initialize m_usesNetworkProcess earlier in WebProcess::initializeWebProcess()
+        https://bugs.webkit.org/show_bug.cgi?id=136478
+
+        Reviewed by Alexey Proskuryakov.
+
+        The soup network backend uses WebProcess::usesNetworkProcess()
+        from WebProcess::platformSetCacheModel() and
+        WebProcess::platformInitializeWebProcess(), both called before the
+        m_usesNetworkProcess member has been initialized.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess): Move the
+        m_usesNetworkProcess initialization at the beginning right before
+        calling platformInitializeWebProcess().
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformSetCacheModel): Remove the early
+        return when using the network process, since this was dead code
+        before this change, and not really needed now that
+        usesNetworkProcess() will return true.
+        (WebKit::WebProcess::platformInitializeWebProcess): Remove comment
+        that is not accurate since r171156.
+
 2014-09-03  Michael Catanzaro  <[email protected]>
 
         [SOUP] Race condition when downloading a file due to the intermediate temporary file

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (173254 => 173255)


--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2014-09-04 07:03:54 UTC (rev 173254)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2014-09-04 07:41:27 UTC (rev 173255)
@@ -271,6 +271,10 @@
 {
     ASSERT(m_pageMap.isEmpty());
 
+#if ENABLE(NETWORK_PROCESS)
+    m_usesNetworkProcess = parameters.usesNetworkProcess;
+#endif
+
     platformInitializeWebProcess(parameters, decoder);
 
     WTF::setCurrentThreadIsUserInitiated();
@@ -348,7 +352,6 @@
         NetworkStorageSession::switchToNewTestingSession();
 
 #if ENABLE(NETWORK_PROCESS)
-    m_usesNetworkProcess = parameters.usesNetworkProcess;
     ensureNetworkProcessConnection();
 
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (173254 => 173255)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2014-09-04 07:03:54 UTC (rev 173254)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2014-09-04 07:41:27 UTC (rev 173255)
@@ -120,14 +120,6 @@
 
     NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
 
-    // FIXME: Once there is no loading being done in the WebProcess, we should remove this,
-    // as calling [NSURLCache sharedURLCache] initializes the cache, which we would rather not do.
-    if (usesNetworkProcess()) {
-        [nsurlCache setMemoryCapacity:0];
-        [nsurlCache setDiskCapacity:0];
-        return;
-    }
-
     [nsurlCache setMemoryCapacity:urlCacheMemoryCapacity];
     [nsurlCache setDiskCapacity:std::max<unsigned long>(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.
 }
@@ -175,8 +167,6 @@
 #endif
 #endif
 
-    // When the network process is enabled, each web process wants a stand-alone
-    // NSURLCache, which it can disable to save memory.
 #if PLATFORM(IOS)
     if (!parameters.uiProcessBundleIdentifier.isNull()) {
         [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to