Don't launch network process in WebCookieManagerProxy::setHTTPCookieAcceptPolicy
authorsihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2018 16:43:23 +0000 (16:43 +0000)
committersihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2018 16:43:23 +0000 (16:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188906
<rdar://problem/42875795>

Reviewed by Ryosuke Niwa.

Add callback in early return.

* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebCookieManagerProxy.cpp

index 1181aa2..6637618 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-27  Sihui Liu  <sihui_liu@apple.com>
+
+        Don't launch network process in WebCookieManagerProxy::setHTTPCookieAcceptPolicy
+        https://bugs.webkit.org/show_bug.cgi?id=188906
+        <rdar://problem/42875795>
+
+        Reviewed by Ryosuke Niwa.
+
+        Add callback in early return.
+
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
+
 2018-08-27  Alex Christensen  <achristensen@webkit.org>
 
         Transition WKBrowsingContextController from WKPageLoaderClient to WKPageNavigationClient
index 08cff58..0a20d85 100644 (file)
@@ -251,8 +251,10 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(PAL::SessionID, HTTPCookie
     processPool()->setInitialHTTPCookieAcceptPolicy(policy);
 #endif
 
-    if (!processPool()->networkProcess())
+    if (!processPool()->networkProcess()) {
+        callbackFunction(CallbackBase::Error::None);
         return;
+    }
 
     auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->ensureNetworkProcess().throttler().backgroundActivityToken());
     processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy, OptionalCallbackID(callbackID)));