Bug 188242

Summary: httpCookieStore.getAllCookies() does not always call completion block
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: WebKit2Assignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, ews-watchlist, ggaren, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews205 for win-future
none
Patch for landing none

Description Sihui Liu 2018-08-01 15:59:00 PDT
When the view is not visible, network process is put to suspension. We need to take a background assertion during cookie API call.
Comment 1 Sihui Liu 2018-08-01 16:03:49 PDT
Created attachment 346310 [details]
Patch
Comment 2 EWS Watchlist 2018-08-01 23:15:10 PDT
Comment on attachment 346310 [details]
Patch

Attachment 346310 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8734158

New failing tests:
imported/blink/transitions/unprefixed-transform.html
legacy-animation-engine/imported/blink/transitions/unprefixed-transform.html
Comment 3 EWS Watchlist 2018-08-01 23:15:22 PDT
Created attachment 346359 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 4 Chris Dumez 2018-08-02 12:38:15 PDT
Comment on attachment 346310 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=346310&action=review

r=me with nits.

> Source/WebKit/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=188242

Is there a radar tracking this as well?

> Source/WebKit/UIProcess/GenericCallback.h:199
>      CallbackID put(Function<void(T...)>&& function)

Is anyone still relying on this overload? If not, we should probably drop it.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:113
> +    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->networkProcess()->throttler().backgroundActivityToken());

processPool()->ensureNetworkProcess().throttler().backgroundActivityToken()
Then omit the line above.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:140
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:147
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:154
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:161
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:168
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:175
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:262
> +    processPool()->ensureNetworkProcess();

ditto.

> Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:269
> +    processPool()->ensureNetworkProcess();

ditto.
Comment 5 Sihui Liu 2018-08-02 14:37:20 PDT
(In reply to Chris Dumez from comment #4)
> Comment on attachment 346310 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=346310&action=review
> 
> r=me with nits.
> 
> > Source/WebKit/ChangeLog:4
> > +        https://bugs.webkit.org/show_bug.cgi?id=188242
> 
> Is there a radar tracking this as well?
> 
I think it's <rdar://problem/33122061>.

> > Source/WebKit/UIProcess/GenericCallback.h:199
> >      CallbackID put(Function<void(T...)>&& function)
> 
> Is anyone still relying on this overload? If not, we should probably drop it.
> 
No, so dropping.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:113
> > +    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), processPool()->networkProcess()->throttler().backgroundActivityToken());
> 
> processPool()->ensureNetworkProcess().throttler().backgroundActivityToken()
> Then omit the line above.
> 
> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:140
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:147
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:154
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:161
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:168
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:175
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:262
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
> 
Done.

> > Source/WebKit/UIProcess/WebCookieManagerProxy.cpp:269
> > +    processPool()->ensureNetworkProcess();
> 
> ditto.
Done.
Comment 6 Sihui Liu 2018-08-02 14:42:05 PDT
Created attachment 346419 [details]
Patch for landing
Comment 7 Sihui Liu 2018-08-02 14:44:26 PDT
*** Bug 174007 has been marked as a duplicate of this bug. ***
Comment 8 WebKit Commit Bot 2018-08-02 15:21:02 PDT
Comment on attachment 346419 [details]
Patch for landing

Clearing flags on attachment: 346419

Committed r234518: <https://trac.webkit.org/changeset/234518>
Comment 9 WebKit Commit Bot 2018-08-02 15:21:03 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-08-02 15:23:11 PDT
<rdar://problem/42875795>