Make SessionStorage work with process swapping.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2018 20:01:27 +0000 (20:01 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2018 20:01:27 +0000 (20:01 +0000)
commit10d236d8b14f87ea55819ad7037e15c262d45a10
treeb514b1d0e5c0e41160836cb945fcc7cc998e4859
parent1f00d1ee17639165d18ada60b1c0ca98372d073c
Make SessionStorage work with process swapping.
https://bugs.webkit.org/show_bug.cgi?id=184270

Reviewed by Andy Estes.

Source/WebKit:

Due to a minor process accounting error, WebPageProxys weren't always being reconnected with their
WebsiteDataStore's StorageManager when doing process swaps.

Fix that error, and SessionStorage "just works."

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::webProcessWillShutDown):
(WebKit::WebPageProxy::processDidTerminate): For NavigationSwap termination, make sure to tell the
  process lifetime tracker that this page was removed.

* UIProcess/WebProcessLifetimeObserver.h:
(WebKit::WebProcessLifetimeObserver::webPageWasInvalidated): Renamed from "webPageWasRemoved"
(WebKit::WebProcessLifetimeObserver::webPageWasRemoved): Deleted.

* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess): Renamed from "webProcessWillShutDown"
(WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
(WebKit::WebProcessLifetimeTracker::webProcessWillShutDown): Deleted.
* UIProcess/WebProcessLifetimeTracker.h:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::webPageWasInvalidated):
(WebKit::WebsiteDataStore::webPageWasRemoved): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONMessageHandler userContentController:didReceiveScriptMessage:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebProcessLifetimeObserver.h
Source/WebKit/UIProcess/WebProcessLifetimeTracker.cpp
Source/WebKit/UIProcess/WebProcessLifetimeTracker.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm