Bug 184240 - Use NetworkLoadChecker to handle synchronous HTTP loads
Summary: Use NetworkLoadChecker to handle synchronous HTTP loads
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
: 184148 (view as bug list)
Depends on:
Blocks: 197093
  Show dependency treegraph
 
Reported: 2018-04-02 10:38 PDT by youenn fablet
Modified: 2019-04-19 03:07 PDT (History)
10 users (show)

See Also:


Attachments
Patch (75.14 KB, patch)
2018-04-02 11:44 PDT, youenn fablet
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-sierra (2.84 MB, application/zip)
2018-04-02 12:41 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-sierra (3.09 MB, application/zip)
2018-04-02 13:15 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.34 MB, application/zip)
2018-04-02 13:29 PDT, EWS Watchlist
no flags Details
Patch (87.03 KB, patch)
2018-04-02 14:44 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-sierra (2.20 MB, application/zip)
2018-04-02 16:07 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.13 MB, application/zip)
2018-04-02 16:24 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews115 for mac-sierra (2.99 MB, application/zip)
2018-04-02 16:27 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews204 for win-future (12.14 MB, application/zip)
2018-04-02 17:09 PDT, EWS Watchlist
no flags Details
Patch (92.11 KB, patch)
2018-04-02 20:21 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (92.28 KB, patch)
2018-04-02 21:24 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews205 for win-future (12.17 MB, application/zip)
2018-04-02 23:37 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews204 for win-future (12.15 MB, application/zip)
2018-04-03 01:24 PDT, EWS Watchlist
no flags Details
Patch (101.52 KB, patch)
2018-04-03 10:00 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (101.44 KB, patch)
2018-04-03 11:19 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (101.40 KB, patch)
2018-04-03 13:14 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Rebased (59.54 KB, patch)
2018-04-11 12:19 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Rebased (59.55 KB, patch)
2018-04-11 12:37 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (59.56 KB, patch)
2018-04-11 12:46 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.46 MB, application/zip)
2018-04-11 14:21 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.10 MB, application/zip)
2018-04-11 17:25 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews105 for mac-sierra-wk2 (3.06 MB, application/zip)
2018-04-11 17:41 PDT, EWS Watchlist
no flags Details
Patch (111.59 KB, patch)
2018-04-12 00:00 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (78.62 KB, patch)
2018-04-16 09:44 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (78.62 KB, patch)
2018-04-16 09:56 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (85.21 KB, patch)
2018-04-16 11:09 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (89.22 KB, patch)
2018-04-16 12:29 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (88.91 KB, patch)
2018-04-16 14:08 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-04-02 10:38:44 PDT
Use NetworkLoadChecker to handle synchronous HTTP loads.
This should help fixing limitations of sync XHR for instance and will require beefing up NetworkLoadChecker.
Comment 1 youenn fablet 2018-04-02 11:44:38 PDT
Created attachment 337009 [details]
Patch
Comment 2 EWS Watchlist 2018-04-02 12:41:19 PDT
Comment on attachment 337009 [details]
Patch

Attachment 337009 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/7181210

New failing tests:
http/tests/xmlhttprequest/cross-origin-no-authorization.html
http/tests/xmlhttprequest/access-control-and-redirects.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-and-redirects.htm
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 3 EWS Watchlist 2018-04-02 12:41:21 PDT
Created attachment 337013 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 4 EWS Watchlist 2018-04-02 13:15:23 PDT
Comment on attachment 337009 [details]
Patch

Attachment 337009 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/7181235

New failing tests:
http/tests/xmlhttprequest/cross-origin-no-authorization.html
http/tests/xmlhttprequest/access-control-and-redirects.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-and-redirects.htm
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 5 EWS Watchlist 2018-04-02 13:15:25 PDT
Created attachment 337017 [details]
Archive of layout-test-results from ews114 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 6 EWS Watchlist 2018-04-02 13:29:39 PDT
Comment on attachment 337009 [details]
Patch

Attachment 337009 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/7181355

New failing tests:
http/tests/local/fileapi/file-last-modified-after-delete-using-open-panel.html
http/wpt/beacon/cors/cors-redirect-failure.html
http/tests/local/fileapi/file-last-modified-using-open-panel.html
http/tests/local/formdata/send-form-data-constructed-from-form-using-open-panel.html
http/tests/local/blob/send-data-blob.html
http/tests/local/formdata/send-form-data-with-string-containing-null.html
Comment 7 EWS Watchlist 2018-04-02 13:29:41 PDT
Created attachment 337022 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 8 youenn fablet 2018-04-02 14:44:21 PDT
Created attachment 337033 [details]
Patch
Comment 9 EWS Watchlist 2018-04-02 16:07:30 PDT
Comment on attachment 337033 [details]
Patch

Attachment 337033 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/7184407

New failing tests:
http/tests/xmlhttprequest/access-control-and-redirects.html
Comment 10 EWS Watchlist 2018-04-02 16:07:31 PDT
Created attachment 337041 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 11 EWS Watchlist 2018-04-02 16:24:26 PDT
Comment on attachment 337033 [details]
Patch

Attachment 337033 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/7184511

New failing tests:
fast/files/apply-blob-url-to-xhr-using-open-panel.html
storage/indexeddb/modern/blob-svg-image.html
media/video-src-blob-using-open-panel.html
fast/files/apply-blob-url-to-img-using-open-panel.html
fast/history/page-cache-createObjectURL-using-open-panel.html
storage/indexeddb/modern/blob-cursor.html
fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html
fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html
Comment 12 EWS Watchlist 2018-04-02 16:24:27 PDT
Created attachment 337042 [details]
Archive of layout-test-results from ews107 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 13 EWS Watchlist 2018-04-02 16:27:08 PDT
Comment on attachment 337033 [details]
Patch

Attachment 337033 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/7184373

New failing tests:
http/tests/xmlhttprequest/access-control-and-redirects.html
Comment 14 EWS Watchlist 2018-04-02 16:27:09 PDT
Created attachment 337043 [details]
Archive of layout-test-results from ews115 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 15 EWS Watchlist 2018-04-02 17:09:22 PDT
Comment on attachment 337033 [details]
Patch

Attachment 337033 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/7184969

New failing tests:
http/tests/xmlhttprequest/cross-origin-no-authorization.html
http/tests/xmlhttprequest/access-control-and-redirects.html
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 16 EWS Watchlist 2018-04-02 17:09:34 PDT
Created attachment 337045 [details]
Archive of layout-test-results from ews204 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews204  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 17 youenn fablet 2018-04-02 20:21:49 PDT
Created attachment 337056 [details]
Patch
Comment 18 youenn fablet 2018-04-02 21:24:33 PDT
Created attachment 337058 [details]
Patch
Comment 19 EWS Watchlist 2018-04-02 23:37:04 PDT
Comment on attachment 337058 [details]
Patch

Attachment 337058 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/7189124

New failing tests:
http/tests/xmlhttprequest/cross-origin-no-authorization.html
http/tests/xmlhttprequest/access-control-and-redirects.html
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 20 EWS Watchlist 2018-04-02 23:37:16 PDT
Created attachment 337062 [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 21 EWS Watchlist 2018-04-03 01:24:39 PDT
Comment on attachment 337058 [details]
Patch

Attachment 337058 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/7189876

New failing tests:
http/tests/xmlhttprequest/cross-origin-no-authorization.html
http/tests/xmlhttprequest/access-control-and-redirects.html
http/tests/xmlhttprequest/access-control-preflight-not-successful.html
Comment 22 EWS Watchlist 2018-04-03 01:24:50 PDT
Created attachment 337065 [details]
Archive of layout-test-results from ews204 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews204  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 23 youenn fablet 2018-04-03 10:00:19 PDT
Created attachment 337083 [details]
Patch
Comment 24 youenn fablet 2018-04-03 11:19:53 PDT
Created attachment 337095 [details]
Patch
Comment 25 Ryosuke Niwa 2018-04-03 13:10:55 PDT
It looks like the patch doesn't apply on ToT?
Comment 26 youenn fablet 2018-04-03 13:14:42 PDT
Created attachment 337108 [details]
Patch
Comment 27 Radar WebKit Bug Importer 2018-04-03 17:10:19 PDT
<rdar://problem/39160180>
Comment 28 Alex Christensen 2018-04-04 11:14:03 PDT
Comment on attachment 337108 [details]
Patch

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

> Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp:378
> +    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::AddOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains }, 0);

If we do these things in one WebProcess, are we sure we want to do them in the network process?  That would affect other web processes
Comment 29 youenn fablet 2018-04-11 12:19:04 PDT
Created attachment 337719 [details]
Rebased
Comment 30 youenn fablet 2018-04-11 12:37:49 PDT
Created attachment 337722 [details]
Rebased
Comment 31 youenn fablet 2018-04-11 12:46:35 PDT
Created attachment 337724 [details]
Patch
Comment 32 EWS Watchlist 2018-04-11 14:21:55 PDT
Comment on attachment 337724 [details]
Patch

Attachment 337724 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/7286806

New failing tests:
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-preflight-headers-sync.htm
imported/w3c/web-platform-tests/XMLHttpRequest/allow-lists-starting-with-comma.htm
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm
http/tests/xmlhttprequest/access-control-response-with-body-sync.html
http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php
http/tests/xmlhttprequest/access-control-preflight-credential-sync.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm
http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached.html
http/tests/xmlhttprequest/access-control-allow-lists-starting-with-comma.html
http/tests/xmlhttprequest/access-control-preflight-headers-sync.html
http/tests/xmlhttprequest/access-control-basic-non-simple-allow.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-response-with-body-sync.htm
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-preflight-credential-sync.htm
Comment 33 EWS Watchlist 2018-04-11 14:21:57 PDT
Created attachment 337733 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 34 EWS Watchlist 2018-04-11 17:25:38 PDT
Comment on attachment 337724 [details]
Patch

Attachment 337724 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/7288478

New failing tests:
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-preflight-headers-sync.htm
imported/w3c/web-platform-tests/XMLHttpRequest/allow-lists-starting-with-comma.htm
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm
http/tests/xmlhttprequest/access-control-response-with-body-sync.html
http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php
http/tests/xmlhttprequest/access-control-preflight-credential-sync.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm
http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached.html
http/tests/xmlhttprequest/access-control-allow-lists-starting-with-comma.html
http/tests/xmlhttprequest/access-control-preflight-headers-sync.html
http/tests/xmlhttprequest/access-control-basic-non-simple-allow.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-response-with-body-sync.htm
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-preflight-credential-sync.htm
Comment 35 EWS Watchlist 2018-04-11 17:25:39 PDT
Created attachment 337754 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 36 EWS Watchlist 2018-04-11 17:41:54 PDT
Comment on attachment 337724 [details]
Patch

Attachment 337724 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/7288622

New failing tests:
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-preflight-headers-sync.htm
imported/w3c/web-platform-tests/XMLHttpRequest/allow-lists-starting-with-comma.htm
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm
http/tests/xmlhttprequest/access-control-response-with-body-sync.html
http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php
http/tests/xmlhttprequest/access-control-preflight-credential-sync.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm
http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached.html
http/tests/xmlhttprequest/access-control-allow-lists-starting-with-comma.html
http/tests/xmlhttprequest/access-control-preflight-headers-sync.html
http/tests/xmlhttprequest/access-control-basic-non-simple-allow.html
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-response-with-body-sync.htm
imported/w3c/web-platform-tests/XMLHttpRequest/access-control-preflight-credential-sync.htm
Comment 37 EWS Watchlist 2018-04-11 17:41:56 PDT
Created attachment 337759 [details]
Archive of layout-test-results from ews105 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 38 youenn fablet 2018-04-12 00:00:34 PDT
Created attachment 337776 [details]
Patch
Comment 39 youenn fablet 2018-04-16 09:44:14 PDT
Created attachment 338009 [details]
Patch
Comment 40 youenn fablet 2018-04-16 09:56:43 PDT
Created attachment 338010 [details]
Patch
Comment 41 youenn fablet 2018-04-16 11:09:55 PDT
Created attachment 338016 [details]
Patch
Comment 42 youenn fablet 2018-04-16 12:29:29 PDT
Created attachment 338025 [details]
Patch
Comment 43 Chris Dumez 2018-04-16 13:44:01 PDT
Comment on attachment 338025 [details]
Patch

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

> LayoutTests/ChangeLog:3
> +        Preventively expect UTF8 strings from libwebrtc SDP and error messages

Bad changelog.

> LayoutTests/ChangeLog:19
> +        Test should check for actual request header and not header name in Access-Control-Request-Headers.

Why?

> LayoutTests/http/wpt/beacon/cors/cors-preflight-blob-failure.html:42
> +      assert_false(requested_headers.includes("referer"), "Referer header is requested")

Why is this right?

> LayoutTests/http/wpt/beacon/cors/cors-preflight-blob-failure.html:43
> +      assert_false(requested_headers.includes("origin"), "Origin header is requested")

Why is this right?

> LayoutTests/http/wpt/beacon/cors/cors-preflight-blob-success.html:43
> +      assert_false(requested_headers.includes("referer"), "Referer header is requested")

Why is this right?

> LayoutTests/http/wpt/beacon/cors/cors-preflight-blob-success.html:44
> +      assert_false(requested_headers.includes("origin"), "Origin header is requested")

Why is this right?
Comment 44 youenn fablet 2018-04-16 13:58:38 PDT
(In reply to Chris Dumez from comment #43)
> Comment on attachment 338025 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=338025&action=review
> 
> > LayoutTests/ChangeLog:3
> > +        Preventively expect UTF8 strings from libwebrtc SDP and error messages
> 
> Bad changelog.
> 
> > LayoutTests/ChangeLog:19
> > +        Test should check for actual request header and not header name in Access-Control-Request-Headers.
> 
> Why?

As per fetch spec, we should use the referrer of the original request.
But Referrer header is not an application header. It is set on the request after the preflight has been done.
So it should not appear in the list of application headers, ditto for Origin header.

> 
> > LayoutTests/http/wpt/beacon/cors/cors-preflight-blob-failure.html:42
> > +      assert_false(requested_headers.includes("referer"), "Referer header is requested")
> 
> Why is this right?

Referrer should not be in ACAH but should be present as a header.
Ditto for Origin.
Comment 45 youenn fablet 2018-04-16 14:08:06 PDT
Created attachment 338041 [details]
Patch for landing
Comment 46 WebKit Commit Bot 2018-04-16 14:50:32 PDT
Comment on attachment 338041 [details]
Patch for landing

Clearing flags on attachment: 338041

Committed r230681: <https://trac.webkit.org/changeset/230681>
Comment 47 WebKit Commit Bot 2018-04-16 14:50:34 PDT
All reviewed patches have been landed.  Closing bug.
Comment 48 youenn fablet 2018-04-20 13:21:44 PDT
*** Bug 184148 has been marked as a duplicate of this bug. ***