Title: [215707] trunk/Source/WebKit2
Revision
215707
Author
beid...@apple.com
Date
2017-04-24 17:18:52 -0700 (Mon, 24 Apr 2017)

Log Message

WebProcessPools should always have a WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=171252

Reviewed by Alex Christensen.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted.
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextGetWebsiteDataStore):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::isAssociatedProcessPool):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (215706 => 215707)


--- trunk/Source/WebKit2/ChangeLog	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-25 00:18:52 UTC (rev 215707)
@@ -1,3 +1,24 @@
+2017-04-24  Brady Eidson  <beid...@apple.com>
+
+        WebProcessPools should always have a WebsiteDataStore
+        https://bugs.webkit.org/show_bug.cgi?id=171252
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/API/APIWebsiteDataStore.cpp:
+        (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted.
+        * UIProcess/API/APIWebsiteDataStore.h:
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetWebsiteDataStore):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitialize):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::WebProcessPool):
+        (WebKit::WebProcessPool::createWebPage):
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::isAssociatedProcessPool):
+
 2017-04-24  Youenn Fablet  <you...@apple.com>
 
         Set defaults video getUserMedia constraints

Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp	2017-04-25 00:18:52 UTC (rev 215707)
@@ -87,11 +87,6 @@
     m_websiteDataStore->setResourceLoadStatisticsEnabled(enabled);
 }
 
-void WebsiteDataStore::registerSharedResourceLoadObserver()
-{
-    m_websiteDataStore->registerSharedResourceLoadObserver();
-}
-    
 #if !PLATFORM(COCOA) && !PLATFORM(GTK)
 WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()
 {

Modified: trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h	2017-04-25 00:18:52 UTC (rev 215707)
@@ -46,7 +46,6 @@
 
     bool resourceLoadStatisticsEnabled() const;
     void setResourceLoadStatisticsEnabled(bool);
-    void registerSharedResourceLoadObserver();
 
     WebKit::WebsiteDataStore& websiteDataStore() { return *m_websiteDataStore; }
     HTTPCookieStore& httpCookieStore();

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp	2017-04-25 00:18:52 UTC (rev 215707)
@@ -404,7 +404,7 @@
 
 WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef context)
 {
-    return toAPI(toImpl(context)->websiteDataStore());
+    return toAPI(&toImpl(context)->websiteDataStore());
 }
 
 WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef context)

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2017-04-25 00:18:52 UTC (rev 215707)
@@ -149,8 +149,7 @@
 
     setLegacyCustomProtocolManagerClient(std::make_unique<LegacyCustomProtocolManagerClient>());
 
-    if (m_websiteDataStore)
-        m_websiteDataStore->registerSharedResourceLoadObserver();
+    m_websiteDataStore->websiteDataStore().registerSharedResourceLoadObserver();
 }
 
 #if PLATFORM(IOS)

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp	2017-04-25 00:18:52 UTC (rev 215707)
@@ -229,7 +229,7 @@
     , m_shouldUseFontSmoothing(true)
     , m_memorySamplerEnabled(false)
     , m_memorySamplerInterval(1400.0)
-    , m_websiteDataStore(m_configuration->shouldHaveLegacyDataStore() ? API::WebsiteDataStore::create(legacyWebsiteDataStoreConfiguration(m_configuration)).ptr() : nullptr)
+    , m_websiteDataStore(m_configuration->shouldHaveLegacyDataStore() ? API::WebsiteDataStore::create(legacyWebsiteDataStoreConfiguration(m_configuration)) : API::WebsiteDataStore::defaultDataStore())
 #if PLATFORM(MAC)
     , m_highPerformanceGraphicsUsageSampler(std::make_unique<HighPerformanceGraphicsUsageSampler>(*this))
     , m_perActivityStateCPUUsageSampler(std::make_unique<PerActivityStateCPUUsageSampler>(*this))
@@ -909,8 +909,8 @@
 
     if (!pageConfiguration->websiteDataStore()) {
         ASSERT(!pageConfiguration->sessionID().isValid());
-        pageConfiguration->setWebsiteDataStore(m_websiteDataStore.get());
-        pageConfiguration->setSessionID(pageConfiguration->preferences()->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : SessionID::defaultSessionID());
+        pageConfiguration->setWebsiteDataStore(m_websiteDataStore.ptr());
+        pageConfiguration->setSessionID(pageConfiguration->preferences()->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : m_websiteDataStore->websiteDataStore().sessionID());
     }
 
     RefPtr<WebProcessProxy> process;

Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h	2017-04-25 00:18:52 UTC (rev 215707)
@@ -172,7 +172,7 @@
     // Disconnect the process from the context.
     void disconnectProcess(WebProcessProxy*);
 
-    API::WebsiteDataStore* websiteDataStore() const { return m_websiteDataStore.get(); }
+    API::WebsiteDataStore& websiteDataStore() const { return m_websiteDataStore.get(); }
 
     Ref<WebPageProxy> createWebPage(PageClient&, Ref<API::PageConfiguration>&&);
 
@@ -523,7 +523,7 @@
 
     RefPtr<WebIconDatabase> m_iconDatabase;
 
-    const RefPtr<API::WebsiteDataStore> m_websiteDataStore;
+    const Ref<API::WebsiteDataStore> m_websiteDataStore;
 
     typedef HashMap<const char*, RefPtr<WebContextSupplement>, PtrHash<const char*>> WebContextSupplementMap;
     WebContextSupplementMap m_supplements;

Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (215706 => 215707)


--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-04-25 00:14:31 UTC (rev 215706)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-04-25 00:18:52 UTC (rev 215707)
@@ -1106,18 +1106,7 @@
 
 bool WebsiteDataStore::isAssociatedProcessPool(WebProcessPool& processPool) const
 {
-    if (auto dataStore = processPool.websiteDataStore()) {
-        if (&dataStore->websiteDataStore() == this)
-            return true;
-    } else if (&API::WebsiteDataStore::defaultDataStore()->websiteDataStore() == this) {
-        // If a process pool doesn't have an explicit data store and this is the default WebsiteDataStore,
-        // add that process pool to the set.
-        // FIXME: This behavior is weird and necessitated by the fact that process pools don't always
-        // have a data store; they should.
-        return true;
-    }
-
-    return false;
+    return &processPool.websiteDataStore().websiteDataStore() == this;
 }
 
 HashSet<RefPtr<WebProcessPool>> WebsiteDataStore::processPools(size_t count, bool ensureAPoolExists) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to