Title: [225999] trunk
Revision
225999
Author
bfulg...@apple.com
Date
2017-12-16 09:57:09 -0800 (Sat, 16 Dec 2017)

Log Message

Plugin processes are repeatedly spun up to do nothing
https://bugs.webkit.org/show_bug.cgi?id=180885
<rdar://problem/36082564>

Reviewed by Geoffrey Garen.

Source/WebKit:

Tested by TestWebKitAPI.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData): Don't ask plugins to remove data when no websites are
passed to the function.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(runTestWithWebsiteDataStore): Check that deleting website data did not
trigger any plugin processes to start up.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (225998 => 225999)


--- trunk/Source/WebKit/ChangeLog	2017-12-16 17:54:39 UTC (rev 225998)
+++ trunk/Source/WebKit/ChangeLog	2017-12-16 17:57:09 UTC (rev 225999)
@@ -1,3 +1,17 @@
+2017-12-16  Brent Fulgham  <bfulg...@apple.com>
+
+        Plugin processes are repeatedly spun up to do nothing
+        https://bugs.webkit.org/show_bug.cgi?id=180885
+        <rdar://problem/36082564>
+
+        Reviewed by Geoffrey Garen.
+
+        Tested by TestWebKitAPI.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::removeData): Don't ask plugins to remove data when no websites are
+        passed to the function.
+
 2017-12-15  Chris Dumez  <cdu...@apple.com>
 
         Support updating a service worker registration's updateViaCache flag

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (225998 => 225999)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-12-16 17:54:39 UTC (rev 225998)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-12-16 17:57:09 UTC (rev 225999)
@@ -1125,7 +1125,8 @@
             Vector<String> m_hostNames;
         };
 
-        State::deleteData(*callbackAggregator, plugins(), WTFMove(hostNames));
+        if (!hostNames.isEmpty())
+            State::deleteData(*callbackAggregator, plugins(), WTFMove(hostNames));
     }
 #endif
 

Modified: trunk/Tools/ChangeLog (225998 => 225999)


--- trunk/Tools/ChangeLog	2017-12-16 17:54:39 UTC (rev 225998)
+++ trunk/Tools/ChangeLog	2017-12-16 17:57:09 UTC (rev 225999)
@@ -1,3 +1,15 @@
+2017-12-16  Brent Fulgham  <bfulg...@apple.com>
+
+        Plugin processes are repeatedly spun up to do nothing
+        https://bugs.webkit.org/show_bug.cgi?id=180885
+        <rdar://problem/36082564>
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
+        (runTestWithWebsiteDataStore): Check that deleting website data did not
+        trigger any plugin processes to start up.
+
 2017-12-16  Yusuke Suzuki  <utatane....@gmail.com>
 
         Remove unnecessary boolean result of start() functions

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm (225998 => 225999)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm	2017-12-16 17:54:39 UTC (rev 225998)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm	2017-12-16 17:57:09 UTC (rev 225999)
@@ -29,6 +29,7 @@
 #import "TestNavigationDelegate.h"
 #import <WebKit/WKFoundation.h>
 #import <WebKit/WKHTTPCookieStore.h>
+#import <WebKit/WKProcessPoolPrivate.h>
 #import <WebKit/WKWebsiteDataStorePrivate.h>
 #import <WebKit/_WKWebsiteDataStoreConfiguration.h>
 #import <wtf/RetainPtr.h>
@@ -71,6 +72,10 @@
     TestWebKitAPI::Util::run(&gotFlag);
     gotFlag = false;
 
+    // Triggering removeData when we don't have plugin data to remove should not trigger the plugin process to launch.
+    id pool = [WKProcessPool _sharedProcessPool];
+    EXPECT_EQ([pool _pluginProcessCount], static_cast<size_t>(0));
+
     globalCookieStore = dataStore.httpCookieStore;
     RetainPtr<CookieObserver> observer1 = adoptNS([[CookieObserver alloc] init]);
     RetainPtr<CookieObserver> observer2 = adoptNS([[CookieObserver alloc] init]);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to