API::PageConfiguration's sessionID needs to be set whenever the API::WebsiteDataStore...
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Aug 2015 21:50:24 +0000 (21:50 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Aug 2015 21:50:24 +0000 (21:50 +0000)
commitd0ba948310a1cdef3ddc1e61cfbb24c2f1fd1fdd
treeac72f3f6d003911cd96e7d0a977802117302f360
parent6d888480f63870de5cf27510ccd6a8be6f15f7fb
API::PageConfiguration's sessionID needs to be set whenever the API::WebsiteDataStore is set
https://bugs.webkit.org/show_bug.cgi?id=148097

Reviewed by Anders Carlsson.

Source/WebKit2:

We were getting an empty SessionID set on the WebPageProxy (and crashing asserting down the line)
when using a WKPageConfiguration with a WKWebsiteDataStore set on it.

Tests:
    WebKit2.WKPageConfigurationBasicWithDataStore
    WebKit2.WKPageConfigurationBasicWithNonPersistentDataStore

* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::setWebsiteDataStore):
Set the sessionID member whenever changing the WebsiteDataStore.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreGetDefaultDataStore):
(WKWebsiteDataStoreCreateNonPersistentDataStore):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
Expose functions for getting default and new non-persistent data stores via the C-SPI. Useful
for testing and transitioning users of the C-SPI to the new model.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Remove explicit setting of the sessionID. This is handled by the above call to setWebsiteDataStore().

Tools:

* TestWebKitAPI/Tests/WebKit2/WKPageConfiguration.cpp:
Add tests for WebsiteDataStores in the WKPageConfiguration.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp
Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/WKPageConfiguration.cpp