Activate NetworkLoadChecker for media loads
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2018 20:46:44 +0000 (20:46 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Apr 2018 20:46:44 +0000 (20:46 +0000)
commit73a278ccf8377fd9b3e8b58fdb7930821c30294e
tree9c6141619d828664440e7b62e5d3c86741da3d2f
parent2f69009d1668b11df35b23e70a288163cd69e1ce
Activate NetworkLoadChecker for media loads
https://bugs.webkit.org/show_bug.cgi?id=184841

Reviewed by Eric Carlson.

Source/WebKit:

Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads.

Move CORS checks for response after handling of 304 checks.
For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response.

Updated ResourceError argument coder to explicitly pass the error type
as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess.
Updated platform data encoding of ResourceError accordingly.

All changes are covered by regular media loading layout tests.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::shouldUseNetworkLoadChecker):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceError>::encode):
(IPC::ArgumentCoder<ResourceError>::decode):
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):
We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data.
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<ResourceError>::encodePlatformData):
(IPC::ArgumentCoder<ResourceError>::decodePlatformData):

LayoutTests:

* TestExpectations: Added DumpJSConsoleLogInStdErr to remove console message differences between WK1/WK2.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp