Bug 147936 - WKWebsiteDataStore does not clear cookies from all WKProcessPools
Summary: WKWebsiteDataStore does not clear cookies from all WKProcessPools
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-08-12 10:22 PDT by Shreyas VA
Modified: 2015-08-12 23:18 PDT (History)
1 user (show)

See Also:


Attachments
Sample app that repros this bug (25.22 KB, application/zip)
2015-08-12 10:22 PDT, Shreyas VA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shreyas VA 2015-08-12 10:22:42 PDT
Created attachment 258826 [details]
Sample app that repros this bug

Multiple WKProcessPools can be created in an app.
When -[WKWebsiteDataStore removeDataOfTypes:] is called, it removes cookies from *some* WKProcessPool, and not necessarily from all the WKProcessPools that are currently alive.
Since a WKWebsiteDataStore can have multiple WKProcessPools associated with it, it must remove cookies from all the WKProcessPools.

Steps to Reproduce:
1) Run the attached code.
2) Click on wv1, which will allocate a WKWebView with a WKProcessPool and load a URL.
3) Click on "sc1", which will set a cookie of name, value someCookie1=someValue1
4) Click on "deallocate web views", which will deallocate all WKWebViews
5) Click on wv2, which will allocate a WKWebView with a *different* WKProcessPool and load a URL.
6) Click on "sc2", which will set a cookie of name, value someCookie2=someValue2
7) Click on "deallocate web views", which will deallocate all WKWebViews
8) Click on "Clear cookies"
9) Click on wv1
10) Click on "rc", to read all cookies
11) Click on "deallocate web views"
12) Click on wv2
13) Click on "rc", to read all cookies

Expected Results:
The cookies someCookie1, someCookie2 should be removed

Actual Results:
The cookies someCookie1, someCookie2 are not removed. In some scenarios (when this experiment is run numerous time) only one of the cookies is removed.

Configuration:
Device
Comment 1 Shreyas VA 2015-08-12 10:23:27 PDT
rdar://22240544