- Revision
- 176876
- Author
- [email protected]
- Date
- 2014-12-05 15:00:58 -0800 (Fri, 05 Dec 2014)
Log Message
Give all web pages a website data store
https://bugs.webkit.org/show_bug.cgi?id=139317
Reviewed by Tim Horton.
Source/WebKit2:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Set the website data store on the window.
* UIProcess/WebContext.cpp:
(WebKit::websiteDataStoreConfiguration):
Helper function that will create the default website data store configuration for a context.
(WebKit::WebContext::WebContext):
Create a new, per-context data store.
(WebKit::WebContext::createWebPage):
If we don't have a data store filled in, use the default per-context one.
* UIProcess/WebContext.h:
* UIProcess/WebPageProxy.h:
Tools:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate newPrivateWindow:]):
Don't release the controller - it's implicitly retained by the window.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (176875 => 176876)
--- trunk/Source/WebKit2/ChangeLog 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Source/WebKit2/ChangeLog 2014-12-05 23:00:58 UTC (rev 176876)
@@ -1,5 +1,29 @@
2014-12-05 Anders Carlsson <[email protected]>
+ Give all web pages a website data store
+ https://bugs.webkit.org/show_bug.cgi?id=139317
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView initWithFrame:configuration:]):
+ Set the website data store on the window.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::websiteDataStoreConfiguration):
+ Helper function that will create the default website data store configuration for a context.
+
+ (WebKit::WebContext::WebContext):
+ Create a new, per-context data store.
+
+ (WebKit::WebContext::createWebPage):
+ If we don't have a data store filled in, use the default per-context one.
+
+ * UIProcess/WebContext.h:
+ * UIProcess/WebPageProxy.h:
+
+2014-12-05 Anders Carlsson <[email protected]>
+
Move the website data store code to a new file
https://bugs.webkit.org/show_bug.cgi?id=139312
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (176875 => 176876)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm 2014-12-05 23:00:58 UTC (rev 176876)
@@ -271,7 +271,8 @@
webPageConfiguration.userContentController = [_configuration userContentController]->_userContentControllerProxy.get();
webPageConfiguration.visitedLinkProvider = [_configuration _visitedLinkProvider]->_visitedLinkProvider.get();
- webPageConfiguration.sessionID = [_configuration _websiteDataStore]->_websiteDataStore->websiteDataStore().sessionID();
+ webPageConfiguration.websiteDataStore = &[_configuration _websiteDataStore]->_websiteDataStore->websiteDataStore();
+ webPageConfiguration.sessionID = webPageConfiguration.websiteDataStore->sessionID();
RefPtr<WebKit::WebPageGroup> pageGroup;
NSString *groupIdentifier = configuration._groupIdentifier;
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (176875 => 176876)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2014-12-05 23:00:58 UTC (rev 176876)
@@ -60,6 +60,7 @@
#include "WebProcessMessages.h"
#include "WebProcessProxy.h"
#include "WebResourceCacheManagerProxy.h"
+#include "WebsiteDataStore.h"
#include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/Language.h>
#include <WebCore/LinkHash.h>
@@ -150,6 +151,14 @@
return contexts();
}
+static WebsiteDataStore::Configuration websiteDataStoreConfiguration()
+{
+ WebsiteDataStore::Configuration configuration;
+
+ // FIXME: Fill in the configuration.
+ return configuration;
+}
+
WebContext::WebContext(WebContextConfiguration configuration)
: m_processModel(ProcessModelSharedSecondaryProcess)
, m_webProcessCountLimit(UINT_MAX)
@@ -167,6 +176,7 @@
, m_cacheModel(CacheModelDocumentViewer)
, m_memorySamplerEnabled(false)
, m_memorySamplerInterval(1400.0)
+ , m_websiteDataStore(WebsiteDataStore::create(websiteDataStoreConfiguration()))
, m_storageManager(StorageManager::create(configuration.localStorageDirectory))
#if USE(SOUP)
, m_initialHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain)
@@ -860,8 +870,11 @@
configuration.preferences = &configuration.pageGroup->preferences();
if (!configuration.visitedLinkProvider)
configuration.visitedLinkProvider = m_visitedLinkProvider.get();
- if (!configuration.sessionID.isValid())
+ if (!configuration.websiteDataStore) {
+ ASSERT(!configuration.sessionID.isValid());
+ configuration.websiteDataStore = m_websiteDataStore.get();
configuration.sessionID = configuration.preferences->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : SessionID::defaultSessionID();
+ }
RefPtr<WebProcessProxy> process;
if (m_processModel == ProcessModelSharedSecondaryProcess) {
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (176875 => 176876)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2014-12-05 23:00:58 UTC (rev 176876)
@@ -505,6 +505,7 @@
RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
#endif
+ RefPtr<WebsiteDataStore> m_websiteDataStore;
RefPtr<StorageManager> m_storageManager;
typedef HashMap<const char*, RefPtr<WebContextSupplement>, PtrHash<const char*>> WebContextSupplementMap;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (176875 => 176876)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-12-05 23:00:58 UTC (rev 176876)
@@ -171,6 +171,7 @@
class WebProcessProxy;
class WebUserContentControllerProxy;
class WebWheelEvent;
+class WebsiteDataStore;
struct ActionMenuHitTestResult;
struct AttributedString;
struct ColorSpaceData;
@@ -227,7 +228,11 @@
WebUserContentControllerProxy* userContentController = nullptr;
VisitedLinkProvider* visitedLinkProvider = nullptr;
+ WebsiteDataStore* websiteDataStore = nullptr;
+ // FIXME: We currently have to pass the session ID separately here to support the legacy private browsing session.
+ // Once we get rid of it we should get rid of this configuration parameter as well.
WebCore::SessionID sessionID;
+
WebPageProxy* relatedPage = nullptr;
WebPreferencesStore::ValueMap preferenceValues;
Modified: trunk/Tools/ChangeLog (176875 => 176876)
--- trunk/Tools/ChangeLog 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Tools/ChangeLog 2014-12-05 23:00:58 UTC (rev 176876)
@@ -1,3 +1,14 @@
+2014-12-05 Anders Carlsson <[email protected]>
+
+ Give all web pages a website data store
+ https://bugs.webkit.org/show_bug.cgi?id=139317
+
+ Reviewed by Tim Horton.
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate newPrivateWindow:]):
+ Don't release the controller - it's implicitly retained by the window.
+
2014-12-05 Daniel Bates <[email protected]>
[iOS] DumpRenderTree fails to render every other test when pixel tests are on
Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.m (176875 => 176876)
--- trunk/Tools/MiniBrowser/mac/AppDelegate.m 2014-12-05 22:43:44 UTC (rev 176875)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.m 2014-12-05 23:00:58 UTC (rev 176876)
@@ -110,7 +110,6 @@
[[controller window] makeKeyAndOrderFront:sender];
[_browserWindowControllers addObject:controller];
- [controller release];
[controller loadURLString:[SettingsController shared].defaultURL];
#endif