Changeset 220758 in webkit


Ignore:
Timestamp:
Aug 15, 2017 2:04:38 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[Cache API] Adding generic support for CacheStorage and Cache methods
https://bugs.webkit.org/show_bug.cgi?id=175455

Patch by Youenn Fablet <youenn@apple.com> on 2017-08-15
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

  • web-platform-tests/service-workers/cache-storage/serviceworker/credentials.https-expected.txt:
  • web-platform-tests/service-workers/cache-storage/window/cache-storage-match.https-expected.txt:
  • web-platform-tests/service-workers/cache-storage/window/cache-storage.https-expected.txt:
  • web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https-expected.txt:
  • web-platform-tests/service-workers/cache-storage/worker/cache-storage.https-expected.txt:

Source/WebCore:

Covered by existing tests.

Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection.
The CacheStorageProvider is accessed from the page for Document calls.
The CacheStorageConnection is responsible to implement the read/write operations on the cache database.
At the moment, it does nothing but return not implemented errors.

Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on.
CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache.
The CacheStorageConnection is a generic connection and not tied to any document/context.
CacheStorage objects are manipulated by providing to the connection the origin of the context.
CacheStorage are global to all contexts with the same origin.
Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object.

Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation.

  • Modules/cache/Cache.cpp:

(WebCore::Cache::Cache):
(WebCore::Cache::~Cache):
The CacheStorageConnection is a generic connection and not tied to any document/context.
(WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match.
Redirect to matchAll as per spec.
(WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll.
Checks for request as per spec. Then either refresh the request to response map and return all responses.
Or call the query cache algorithm and return copies of the responses (using clone).
(WebCore::Cache::put):
Check the request and response as per spec.
Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now.
Call the batch put operation.
(WebCore::Cache::remove):
Check the request and response as per spec.
Call the batch delete operation.
(WebCore::Cache::keys):
Refresh the request to response map and return corresponding requests.
Making sure to reuse the same request objects as per spec.
As per spec, the request to response map is ordered. We implement it as a Vector.
(WebCore::Cache::refreshRequestToResponseMap):
Use the cache storage connection to get an up-to-date list of cached records.
(WebCore::Cache::queryCacheMatch):
Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm.
This is split for queryCache as cache storage engine will need to use it when implementing the delete operation.
(WebCore::Cache::queryCache):
Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument.
(WebCore::Cache::queryCacheWithTargetStorage):
Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument.
(WebCore::Cache::batchDeleteOperation):
Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation.
Delete operation are always done one at a time.
(WebCore::Cache::batchPutOperation):
Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation.
Put operation takes one record for put but can take several records in the case of addAll, hence the current design.
(WebCore::Cache::updateRequestToResponseMap):
Update the cache request to response map based on the records retrieved from the cache storage connection.

  • Modules/cache/Cache.h:

(WebCore::Cache::create):
(WebCore::Cache::name const):

  • Modules/cache/Cache.idl:
  • Modules/cache/CacheStorage.cpp:

(WebCore::CacheStorage::origin const):
Computing the cache origin that is passed to the CacheStorageConnection.
(WebCore::CacheStorage::has):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has.
Call the cache storage connection to refresh its cache map.
Then use it to check whether a cache exists.
(WebCore::CacheStorage::refreshCacheMap):
Use the cache storage connection to get the list of existing caches.
(WebCore::CacheStorage::open):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open.
Refreshing the cache map so as to return a pre-existing cache if any.
(WebCore::CacheStorage::remove):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method.
Refreshing the cache map so as to do nothing if there is no cache to remove.
(WebCore::CacheStorage::keys):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method.
Refreshing the cache map and returnin its keys.
As per spec, the cache map is ordered. We implement it as a Vector.
(WebCore::CacheStorage::cacheMap):
Get the list of cache objects, used as a private accessor for JS built-ins.

  • Modules/cache/CacheStorage.h:

(WebCore::CacheStorage::create):
(WebCore::CacheStorage::CacheStorage):

  • Modules/cache/CacheStorageConnection.cpp: Added.

(WebCore::CacheStorageConnection::exceptionFromError):

  • Modules/cache/CacheStorageConnection.h: Added.

Makes the link between Web facing Cache API and the cache storage engine.
Envisioned implementation are:

  • One main thread connection used by all documents in the given process.
  • One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards.

(WebCore::CacheStorageConnection::create):
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::remove):
(WebCore::CacheStorageConnection::refreshCacheMap):
(WebCore::CacheStorageConnection::refreshRequestToResponseMap):
(WebCore::CacheStorageConnection::batchDeleteOperation):
(WebCore::CacheStorageConnection::batchPutOperation):

  • Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective.
  • Modules/cache/DOMWindowCaches.cpp:

(WebCore::DOMWindowCaches::caches const):

  • Modules/cache/WorkerGlobalScopeCaches.cpp:

(WebCore::WorkerGlobalScopeCaches::from):
(WebCore::WorkerGlobalScopeCaches::caches const):

  • Modules/cache/WorkerGlobalScopeCaches.h:

(WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches):

  • Modules/fetch/FetchBodyOwner.h:

(WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API.

  • Modules/fetch/FetchHeaders.h:

(WebCore::FetchHeaders::create): Add another create as used by the cache API.
(WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine.

  • Modules/fetch/FetchLoader.cpp:

(WebCore::FetchLoader::start):

  • Modules/fetch/FetchRequest.cpp:

(WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value.
Add a check so that no value at all is the same as a null/undefined value.
(WebCore::FetchRequest::resourceRequest const):

  • Modules/fetch/FetchRequest.h:
  • Modules/fetch/FetchResponse.h:
  • WebCore.xcodeproj/project.pbxproj:
  • inspector/InspectorOverlay.cpp:

(WebCore::InspectorOverlay::overlayPage):

  • page/CacheStorageProvider.h: Added.

Interface to create main thread cache storage connection for the given page.
There will be one provider for each process.
Passing a sessionID so that we will create a connection per session.

  • page/Page.cpp:

(WebCore::Page::Page):

  • page/Page.h:

(WebCore::Page::cacheStorageProvider):

  • page/PageConfiguration.cpp:

(WebCore::PageConfiguration::PageConfiguration):

  • page/PageConfiguration.h:
  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::dataChanged):

Source/WebKit:

  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/Cache/WebCacheStorageProvider.h: Added.
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::m_cpuLimit):

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::WebProcess):

  • WebProcess/WebProcess.h:

(WebKit::WebProcess::cacheStorageProvider):

Source/WebKitLegacy/mac:

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKitLegacy/win:

  • WebView.cpp:

(WebView::initWithFrame):

LayoutTests:

  • TestExpectations: Skipping a test that would timeout otherwise due to the current implementation limitations.
Location:
trunk
Files:
3 added
58 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r220751 r220758  
     12017-08-15  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Adding generic support for CacheStorage and Cache methods
     4        https://bugs.webkit.org/show_bug.cgi?id=175455
     5
     6        Reviewed by Chris Dumez.
     7
     8        * TestExpectations: Skipping a test that would timeout otherwise due to the current implementation limitations.
     9
    1102017-08-15  Chris Dumez  <cdumez@apple.com>
    211
  • trunk/LayoutTests/TestExpectations

    r220750 r220758  
    122122imported/w3c/web-platform-tests/service-workers/cache-storage [ Pass ]
    123123imported/w3c/web-platform-tests/service-workers/cache-storage/window [ Pass Failure ]
    124 
     124imported/w3c/web-platform-tests/service-workers/cache-storage/common.https.html [ Skip ]
    125125
    126126# textarea.animate is not supported
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r220754 r220758  
     12017-08-15  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Adding generic support for CacheStorage and Cache methods
     4        https://bugs.webkit.org/show_bug.cgi?id=175455
     5
     6        Reviewed by Chris Dumez.
     7
     8        * web-platform-tests/service-workers/cache-storage/serviceworker/credentials.https-expected.txt:
     9        * web-platform-tests/service-workers/cache-storage/window/cache-storage-match.https-expected.txt:
     10        * web-platform-tests/service-workers/cache-storage/window/cache-storage.https-expected.txt:
     11        * web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https-expected.txt:
     12        * web-platform-tests/service-workers/cache-storage/worker/cache-storage.https-expected.txt:
     13
    1142017-08-15  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/credentials.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache API matching includes credentials promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache API matching includes credentials assert_unreached: unregister should not fail: serviceWorker.getRegistration() is not yet implemented Reached unreachable code
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-add.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.add called with no arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.add called with relative URL specified as a string promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.add called with non-HTTP/HTTPS URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.add called with Request object promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.add called with POST request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.add called twice with the same Request object promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.add with request with null body (not consumed) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.add with 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.addAll with 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.add with request that results in a status of 404 promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.add with request that results in a status of 500 promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.addAll with no arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.addAll with a mix of valid and undefined arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.addAll with an empty array promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    16 FAIL Cache.addAll with string URL arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    17 FAIL Cache.addAll with Request arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    18 FAIL Cache.addAll with a mix of succeeding and failing requests promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    19 FAIL Cache.addAll called with the same Request object specified twice promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.add called with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.add called with relative URL specified as a string promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.add called with non-HTTP/HTTPS URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.add called with Request object promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.add called with POST request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.add called twice with the same Request object promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.add with request with null body (not consumed) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.add with 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.addAll with 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.add with request that results in a status of 404 promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.add with request that results in a status of 500 promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.addAll with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.addAll with a mix of valid and undefined arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.addAll with an empty array promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     16FAIL Cache.addAll with string URL arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     17FAIL Cache.addAll with Request arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     18FAIL Cache.addAll with a mix of succeeding and failing requests promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     19FAIL Cache.addAll called with the same Request object specified twice promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    2020
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-delete.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.delete with no arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.delete called with a string URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.delete called with a Request object promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.delete called with a HEAD request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.delete supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.delete with a non-existent entry promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.delete with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.delete with ignoreSearch option (when it is specified as false) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.delete with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.delete called with a string URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.delete called with a Request object promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.delete called with a HEAD request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.delete supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.delete with a non-existent entry promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.delete with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.delete with ignoreSearch option (when it is specified as false) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1010
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-keys.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.keys() called on an empty cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.keys with no matching entries promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.keys with URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.keys with Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.keys with new Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.keys with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.keys with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.keys supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.keys supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.keys with URL containing fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.keys with string fragment "http" as query promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.keys without parameters promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.keys with a HEAD Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.keys() called on an empty cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.keys with no matching entries promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.keys with URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.keys with Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.keys with new Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.keys with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.keys with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.keys supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.keys supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.keys with URL containing fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.keys with string fragment "http" as query promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.keys without parameters promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.keys with a HEAD Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1515
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.match with no matching entries promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.match with URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.match with Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.match with multiple cache hits promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.match with new Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.match with HEAD promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.match with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.match with ignoreSearch option (request with search parameter) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.match supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.match with URL containing fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.match with string fragment "http" as query promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.match with responses containing "Vary" header promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.match with Request and Response objects with different URLs promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    16 FAIL Cache.match invoked multiple times for the same Request/Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    17 FAIL Cache.match blob should be sliceable promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    18 FAIL Cache.match with POST Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    19 FAIL Cache.match with a non-2xx Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    20 FAIL Cache.match with a network error Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    21 FAIL Cache produces large Responses that can be cloned and read correctly. promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.match with no matching entries promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.match with URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.match with Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.match with multiple cache hits promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.match with new Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.match with HEAD promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.match with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.match with ignoreSearch option (request with search parameter) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.match supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.match with URL containing fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.match with string fragment "http" as query promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.match with responses containing "Vary" header promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.match with Request and Response objects with different URLs promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     16FAIL Cache.match invoked multiple times for the same Request/Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     17FAIL Cache.match blob should be sliceable promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     18FAIL Cache.match with POST Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     19FAIL Cache.match with a non-2xx Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     20FAIL Cache.match with a network error Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     21FAIL Cache produces large Responses that can be cloned and read correctly. promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    2222
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-matchAll.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.matchAll with no matching entries promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.matchAll with URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.matchAll with Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.matchAll with new Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.matchAll with HEAD promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.matchAll with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.matchAll with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.matchAll supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.matchAll supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.matchAll with URL containing fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.matchAll with string fragment "http" as query promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.matchAll without parameters promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.matchAll with responses containing "Vary" header promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.matchAll with multiple vary pairs promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.matchAll with no matching entries promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.matchAll with URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.matchAll with Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.matchAll with new Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.matchAll with HEAD promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.matchAll with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.matchAll with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.matchAll supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.matchAll supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.matchAll with URL containing fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.matchAll with string fragment "http" as query promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.matchAll without parameters promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.matchAll with responses containing "Vary" header promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.matchAll with multiple vary pairs promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1616
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.put called with simple Request and Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.put called with Request and Response from fetch() promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.put with Request without a body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.put with Response without a body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.put with a Response containing an empty URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.put with an empty response body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.put with synthetic 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.put with HTTP 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.put with HTTP 500 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.put called twice with matching Requests and different Responses promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.put called twice with request URLs that differ only by a fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.put with a string request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.put with an invalid response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.put with a non-HTTP/HTTPS request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    16 FAIL Cache.put with a relative URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    17 FAIL Cache.put with a non-GET request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    18 FAIL Cache.put with a null response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    19 FAIL Cache.put with a POST request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    20 FAIL Cache.put with a used response body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    21 FAIL getReader() after Cache.put promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    22 FAIL Cache.put with a VARY:* Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    23 FAIL Cache.put with an embedded VARY:* Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    24 FAIL Cache.put should store Response.redirect() correctly promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.put called with simple Request and Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.put called with Request and Response from fetch() promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.put with Request without a body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.put with Response without a body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.put with a Response containing an empty URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.put with an empty response body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.put with synthetic 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.put with HTTP 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.put with HTTP 500 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.put called twice with matching Requests and different Responses promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.put called twice with request URLs that differ only by a fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.put with a string request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.put with an invalid response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.put with a non-HTTP/HTTPS request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     16FAIL Cache.put with a relative URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     17FAIL Cache.put with a non-GET request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     18FAIL Cache.put with a null response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     19FAIL Cache.put with a POST request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     20FAIL Cache.put with a used response body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     21FAIL getReader() after Cache.put promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     22FAIL Cache.put with a VARY:* Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     23FAIL Cache.put with an embedded VARY:* Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     24FAIL Cache.put should store Response.redirect() correctly promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    2525
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-storage-keys.https-expected.txt

    r220311 r220758  
    11
    2 FAIL CacheStorage keys promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL CacheStorage keys promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-storage-match.https-expected.txt

    r220311 r220758  
    11
    2 FAIL CacheStorageMatch with no cache name provided promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL CacheStorageMatch from one of many caches promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL CacheStorageMatch from one of many caches by name promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL CacheStorageMatch a string request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL CacheStorageMatch a HEAD request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL CacheStorageMatch with no cached entry promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL CacheStorageMatch with no caches available but name provided promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL CacheStorageMatch with empty cache name provided promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL CacheStorageMatch supports ignoreSearch promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL CacheStorageMatch supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL CacheStorageMatch with no cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL CacheStorageMatch from one of many caches promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL CacheStorageMatch from one of many caches by name promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL CacheStorageMatch a string request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL CacheStorageMatch a HEAD request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL CacheStorageMatch with no cached entry promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL CacheStorageMatch with no caches available but name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL CacheStorageMatch with empty cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL CacheStorageMatch supports ignoreSearch promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL CacheStorageMatch supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1313
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-storage.https-expected.txt

    r220311 r220758  
    11
    2 FAIL CacheStorage.open promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL CacheStorage.delete dooms, but does not delete immediately promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL CacheStorage.open with an empty name promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL CacheStorage.open promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL CacheStorage.delete dooms, but does not delete immediately promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL CacheStorage.open with an empty name promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    55PASS CacheStorage.open with no arguments
    6 FAIL CacheStorage.has with existing cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL CacheStorage.has with nonexistent cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL CacheStorage.open with existing cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL CacheStorage.delete with existing cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL CacheStorage.delete with nonexistent cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL CacheStorage names are DOMStrings not USVStrings promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     6FAIL CacheStorage.has with existing cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7PASS CacheStorage.has with nonexistent cache
     8FAIL CacheStorage.open with existing cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL CacheStorage.delete with existing cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10PASS CacheStorage.delete with nonexistent cache
     11FAIL CacheStorage names are DOMStrings not USVStrings promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/sandboxed-iframes.https-expected.txt

    r220311 r220758  
    22
    33FAIL Sandboxed iframe with allow-same-origin is allowed access assert_equals: Access should be allowed if sandbox has allow-same-origin expected "allowed" but got "denied"
    4 FAIL Sandboxed iframe without allow-same-origin is denied access assert_equals: Failure should be a SecurityError expected "SecurityError" but got "TypeError"
     4FAIL Sandboxed iframe without allow-same-origin is denied access assert_equals: Failure should be a SecurityError expected "SecurityError" but got "NotSupportedError"
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.add called with no arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.add called with relative URL specified as a string promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.add called with non-HTTP/HTTPS URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.add called with Request object promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.add called with POST request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.add called twice with the same Request object promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.add with request with null body (not consumed) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.add with 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.addAll with 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.add with request that results in a status of 404 promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.add with request that results in a status of 500 promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.addAll with no arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.addAll with a mix of valid and undefined arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.addAll with an empty array promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    16 FAIL Cache.addAll with string URL arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    17 FAIL Cache.addAll with Request arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    18 FAIL Cache.addAll with a mix of succeeding and failing requests promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    19 FAIL Cache.addAll called with the same Request object specified twice promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.add called with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.add called with relative URL specified as a string promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.add called with non-HTTP/HTTPS URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.add called with Request object promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.add called with POST request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.add called twice with the same Request object promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.add with request with null body (not consumed) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.add with 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.addAll with 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.add with request that results in a status of 404 promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.add with request that results in a status of 500 promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.addAll with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.addAll with a mix of valid and undefined arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.addAll with an empty array promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     16FAIL Cache.addAll with string URL arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     17FAIL Cache.addAll with Request arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     18FAIL Cache.addAll with a mix of succeeding and failing requests promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     19FAIL Cache.addAll called with the same Request object specified twice promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    2020
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-delete.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.delete with no arguments promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.delete called with a string URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.delete called with a Request object promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.delete called with a HEAD request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.delete supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.delete with a non-existent entry promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.delete with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.delete with ignoreSearch option (when it is specified as false) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.delete with no arguments promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.delete called with a string URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.delete called with a Request object promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.delete called with a HEAD request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.delete supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.delete with a non-existent entry promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.delete with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.delete with ignoreSearch option (when it is specified as false) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1010
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-keys.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.keys() called on an empty cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.keys with no matching entries promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.keys with URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.keys with Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.keys with new Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.keys with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.keys with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.keys supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.keys supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.keys with URL containing fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.keys with string fragment "http" as query promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.keys without parameters promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.keys with a HEAD Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.keys() called on an empty cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.keys with no matching entries promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.keys with URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.keys with Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.keys with new Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.keys with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.keys with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.keys supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.keys supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.keys with URL containing fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.keys with string fragment "http" as query promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.keys without parameters promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.keys with a HEAD Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1515
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.match with no matching entries promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.match with URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.match with Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.match with multiple cache hits promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.match with new Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.match with HEAD promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.match with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.match with ignoreSearch option (request with search parameter) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.match supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.match with URL containing fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.match with string fragment "http" as query promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.match with responses containing "Vary" header promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.match with Request and Response objects with different URLs promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    16 FAIL Cache.match invoked multiple times for the same Request/Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    17 FAIL Cache.match blob should be sliceable promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    18 FAIL Cache.match with POST Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    19 FAIL Cache.match with a non-2xx Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    20 FAIL Cache.match with a network error Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    21 FAIL Cache produces large Responses that can be cloned and read correctly. promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.match with no matching entries promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.match with URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.match with Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.match with multiple cache hits promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.match with new Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.match with HEAD promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.match with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.match with ignoreSearch option (request with search parameter) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.match supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.match with URL containing fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.match with string fragment "http" as query promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.match with responses containing "Vary" header promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.match with Request and Response objects with different URLs promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     16FAIL Cache.match invoked multiple times for the same Request/Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     17FAIL Cache.match blob should be sliceable promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     18FAIL Cache.match with POST Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     19FAIL Cache.match with a non-2xx Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     20FAIL Cache.match with a network error Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     21FAIL Cache produces large Responses that can be cloned and read correctly. promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    2222
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-matchAll.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.matchAll with no matching entries promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.matchAll with URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.matchAll with Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.matchAll with new Request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.matchAll with HEAD promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.matchAll with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.matchAll with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.matchAll supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.matchAll supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.matchAll with URL containing fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.matchAll with string fragment "http" as query promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.matchAll without parameters promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.matchAll with responses containing "Vary" header promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.matchAll with multiple vary pairs promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.matchAll with no matching entries promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.matchAll with URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.matchAll with Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.matchAll with new Request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.matchAll with HEAD promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.matchAll with ignoreSearch option (request with no search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.matchAll with ignoreSearch option (request with search parameters) promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.matchAll supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.matchAll supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.matchAll with URL containing fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.matchAll with string fragment "http" as query promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.matchAll without parameters promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.matchAll with responses containing "Vary" header promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.matchAll with multiple vary pairs promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1616
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-put.https-expected.txt

    r220311 r220758  
    11
    2 FAIL Cache.put called with simple Request and Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL Cache.put called with Request and Response from fetch() promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL Cache.put with Request without a body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL Cache.put with Response without a body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL Cache.put with a Response containing an empty URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL Cache.put with an empty response body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL Cache.put with synthetic 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL Cache.put with HTTP 206 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL Cache.put with HTTP 500 response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.put called twice with matching Requests and different Responses promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL Cache.put called twice with request URLs that differ only by a fragment promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    13 FAIL Cache.put with a string request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    14 FAIL Cache.put with an invalid response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    15 FAIL Cache.put with a non-HTTP/HTTPS request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    16 FAIL Cache.put with a relative URL promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    17 FAIL Cache.put with a non-GET request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    18 FAIL Cache.put with a null response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    19 FAIL Cache.put with a POST request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    20 FAIL Cache.put with a used response body promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    21 FAIL getReader() after Cache.put promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    22 FAIL Cache.put with a VARY:* Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    23 FAIL Cache.put with an embedded VARY:* Response promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    24 FAIL Cache.put should store Response.redirect() correctly promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL Cache.put called with simple Request and Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL Cache.put called with Request and Response from fetch() promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL Cache.put with Request without a body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL Cache.put with Response without a body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL Cache.put with a Response containing an empty URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL Cache.put with an empty response body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL Cache.put with synthetic 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL Cache.put with HTTP 206 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL Cache.put with HTTP 500 response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.put called twice with matching Requests and different Responses promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL Cache.put called twice with request URLs that differ only by a fragment promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     13FAIL Cache.put with a string request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     14FAIL Cache.put with an invalid response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     15FAIL Cache.put with a non-HTTP/HTTPS request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     16FAIL Cache.put with a relative URL promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     17FAIL Cache.put with a non-GET request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     18FAIL Cache.put with a null response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     19FAIL Cache.put with a POST request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     20FAIL Cache.put with a used response body promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     21FAIL getReader() after Cache.put promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     22FAIL Cache.put with a VARY:* Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     23FAIL Cache.put with an embedded VARY:* Response promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     24FAIL Cache.put should store Response.redirect() correctly promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    2525
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-storage-keys.https-expected.txt

    r220311 r220758  
    11
    2 FAIL CacheStorage keys promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL CacheStorage keys promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https-expected.txt

    r220311 r220758  
    11
    2 FAIL CacheStorageMatch with no cache name provided promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL CacheStorageMatch from one of many caches promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL CacheStorageMatch from one of many caches by name promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    5 FAIL CacheStorageMatch a string request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    6 FAIL CacheStorageMatch a HEAD request promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL CacheStorageMatch with no cached entry promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL CacheStorageMatch with no caches available but name provided promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL CacheStorageMatch with empty cache name provided promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL CacheStorageMatch supports ignoreSearch promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    12 FAIL CacheStorageMatch supports ignoreVary promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL CacheStorageMatch with no cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL CacheStorageMatch from one of many caches promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL CacheStorageMatch from one of many caches by name promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     5FAIL CacheStorageMatch a string request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     6FAIL CacheStorageMatch a HEAD request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7FAIL CacheStorageMatch with no cached entry promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     8FAIL CacheStorageMatch with no caches available but name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL CacheStorageMatch with empty cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10FAIL CacheStorageMatch supports ignoreSearch promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     11FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     12FAIL CacheStorageMatch supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1313
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-storage.https-expected.txt

    r220311 r220758  
    11
    2 FAIL CacheStorage.open promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    3 FAIL CacheStorage.delete dooms, but does not delete immediately promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    4 FAIL CacheStorage.open with an empty name promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     2FAIL CacheStorage.open promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     3FAIL CacheStorage.delete dooms, but does not delete immediately promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     4FAIL CacheStorage.open with an empty name promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    55PASS CacheStorage.open with no arguments
    6 FAIL CacheStorage.has with existing cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    7 FAIL CacheStorage.has with nonexistent cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    8 FAIL CacheStorage.open with existing cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    9 FAIL CacheStorage.delete with existing cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    10 FAIL CacheStorage.delete with nonexistent cache promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
    11 FAIL CacheStorage names are DOMStrings not USVStrings promise_test: Unhandled rejection with value: object "TypeError: Not implemented"
     6FAIL CacheStorage.has with existing cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     7PASS CacheStorage.has with nonexistent cache
     8FAIL CacheStorage.open with existing cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     9FAIL CacheStorage.delete with existing cache promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
     10PASS CacheStorage.delete with nonexistent cache
     11FAIL CacheStorage names are DOMStrings not USVStrings promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented"
    1212
  • trunk/Source/WebCore/CMakeLists.txt

    r220751 r220758  
    897897    Modules/cache/Cache.cpp
    898898    Modules/cache/CacheStorage.cpp
     899    Modules/cache/CacheStorageConnection.cpp
    899900    Modules/cache/DOMWindowCaches.cpp
    900901    Modules/cache/WorkerGlobalScopeCaches.cpp
  • trunk/Source/WebCore/ChangeLog

    r220751 r220758  
     12017-08-15  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Adding generic support for CacheStorage and Cache methods
     4        https://bugs.webkit.org/show_bug.cgi?id=175455
     5
     6        Reviewed by Chris Dumez.
     7
     8        Covered by existing tests.
     9
     10        Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection.
     11        The CacheStorageProvider is accessed from the page for Document calls.
     12        The CacheStorageConnection is responsible to implement the read/write operations on the cache database.
     13        At the moment, it does nothing but return not implemented errors.
     14
     15        Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on.
     16        CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache.
     17        The CacheStorageConnection is a generic connection and not tied to any document/context.
     18        CacheStorage objects are manipulated by providing to the connection the origin of the context.
     19        CacheStorage are global to all contexts with the same origin.
     20        Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object.
     21
     22        Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation.
     23
     24        * Modules/cache/Cache.cpp:
     25        (WebCore::Cache::Cache):
     26        (WebCore::Cache::~Cache):
     27        The CacheStorageConnection is a generic connection and not tied to any document/context.
     28        (WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match.
     29        Redirect to matchAll as per spec.
     30        (WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll.
     31        Checks for request as per spec. Then either refresh the request to response map and return all responses.
     32        Or call the query cache algorithm and return copies of the responses (using clone).
     33        (WebCore::Cache::put):
     34        Check the request and response as per spec.
     35        Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now.
     36        Call the batch put operation.
     37        (WebCore::Cache::remove):
     38        Check the request and response as per spec.
     39        Call the batch delete operation.
     40        (WebCore::Cache::keys):
     41        Refresh the request to response map and return corresponding requests.
     42        Making sure to reuse the same request objects as per spec.
     43        As per spec, the request to response map is ordered. We implement it as a Vector.
     44        (WebCore::Cache::refreshRequestToResponseMap):
     45        Use the cache storage connection to get an up-to-date list of cached records.
     46        (WebCore::Cache::queryCacheMatch):
     47        Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm.
     48        This is split for queryCache as cache storage engine will need to use it when implementing the delete operation.
     49        (WebCore::Cache::queryCache):
     50        Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument.
     51        (WebCore::Cache::queryCacheWithTargetStorage):
     52        Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument.
     53        (WebCore::Cache::batchDeleteOperation):
     54        Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation.
     55        Delete operation are always done one at a time.
     56        (WebCore::Cache::batchPutOperation):
     57        Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation.
     58        Put operation takes one record for put but can take several records in the case of addAll, hence the current design.
     59        (WebCore::Cache::updateRequestToResponseMap):
     60        Update the cache request to response map based on the records retrieved from the cache storage connection.
     61        * Modules/cache/Cache.h:
     62        (WebCore::Cache::create):
     63        (WebCore::Cache::name const):
     64        * Modules/cache/Cache.idl:
     65        * Modules/cache/CacheStorage.cpp:
     66        (WebCore::CacheStorage::origin const):
     67        Computing the cache origin that is passed to the CacheStorageConnection.
     68        (WebCore::CacheStorage::has):
     69        Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has.
     70        Call the cache storage connection to refresh its cache map.
     71        Then use it to check whether a cache exists.
     72        (WebCore::CacheStorage::refreshCacheMap):
     73        Use the cache storage connection to get the list of existing caches.
     74        (WebCore::CacheStorage::open):
     75        Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open.
     76        Refreshing the cache map so as to return a pre-existing cache if any.
     77        (WebCore::CacheStorage::remove):
     78        Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method.
     79        Refreshing the cache map so as to do nothing if there is no cache to remove.
     80        (WebCore::CacheStorage::keys):
     81        Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method.
     82        Refreshing the cache map and returnin its keys.
     83        As per spec, the cache map is ordered. We implement it as a Vector.
     84        (WebCore::CacheStorage::cacheMap):
     85        Get the list of cache objects, used as a private accessor for JS built-ins.
     86        * Modules/cache/CacheStorage.h:
     87        (WebCore::CacheStorage::create):
     88        (WebCore::CacheStorage::CacheStorage):
     89        * Modules/cache/CacheStorageConnection.cpp: Added.
     90        (WebCore::CacheStorageConnection::exceptionFromError):
     91        * Modules/cache/CacheStorageConnection.h: Added.
     92        Makes the link between Web facing Cache API and the cache storage engine.
     93        Envisioned implementation are:
     94        - One main thread connection used by all documents in the given process.
     95        - One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards.
     96        (WebCore::CacheStorageConnection::create):
     97        (WebCore::CacheStorageConnection::open):
     98        (WebCore::CacheStorageConnection::remove):
     99        (WebCore::CacheStorageConnection::refreshCacheMap):
     100        (WebCore::CacheStorageConnection::refreshRequestToResponseMap):
     101        (WebCore::CacheStorageConnection::batchDeleteOperation):
     102        (WebCore::CacheStorageConnection::batchPutOperation):
     103        * Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective.
     104        * Modules/cache/DOMWindowCaches.cpp:
     105        (WebCore::DOMWindowCaches::caches const):
     106        * Modules/cache/WorkerGlobalScopeCaches.cpp:
     107        (WebCore::WorkerGlobalScopeCaches::from):
     108        (WebCore::WorkerGlobalScopeCaches::caches const):
     109        * Modules/cache/WorkerGlobalScopeCaches.h:
     110        (WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches):
     111        * Modules/fetch/FetchBodyOwner.h:
     112        (WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API.
     113        * Modules/fetch/FetchHeaders.h:
     114        (WebCore::FetchHeaders::create): Add another create as used by the cache API.
     115        (WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine.
     116        * Modules/fetch/FetchLoader.cpp:
     117        (WebCore::FetchLoader::start):
     118        * Modules/fetch/FetchRequest.cpp:
     119        (WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value.
     120        Add a check so that no value at all is the same as a null/undefined value.
     121        (WebCore::FetchRequest::resourceRequest const):
     122        * Modules/fetch/FetchRequest.h:
     123        * Modules/fetch/FetchResponse.h:
     124        * WebCore.xcodeproj/project.pbxproj:
     125        * inspector/InspectorOverlay.cpp:
     126        (WebCore::InspectorOverlay::overlayPage):
     127        * page/CacheStorageProvider.h: Added.
     128        Interface to create main thread cache storage connection for the given page.
     129        There will be one provider for each process.
     130        Passing a sessionID so that we will create a connection per session.
     131        * page/Page.cpp:
     132        (WebCore::Page::Page):
     133        * page/Page.h:
     134        (WebCore::Page::cacheStorageProvider):
     135        * page/PageConfiguration.cpp:
     136        (WebCore::PageConfiguration::PageConfiguration):
     137        * page/PageConfiguration.h:
     138        * svg/graphics/SVGImage.cpp:
     139        (WebCore::SVGImage::dataChanged):
     140
    11412017-08-15  Chris Dumez  <cdumez@apple.com>
    2142
  • trunk/Source/WebCore/Modules/cache/Cache.cpp

    r220311 r220758  
    2727#include "Cache.h"
    2828
     29#include "CacheQueryOptions.h"
     30#include "FetchResponse.h"
     31#include "HTTPParsers.h"
     32#include "JSFetchRequest.h"
     33#include "JSFetchResponse.h"
     34#include "ScriptExecutionContext.h"
     35#include "URL.h"
     36
    2937namespace WebCore {
    3038
    31 void Cache::match(RequestInfo&&, std::optional<CacheQueryOptions>&&, Ref<DeferredPromise>&& promise)
    32 {
    33     promise->reject(Exception { TypeError, ASCIILiteral("Not implemented")});
    34 }
    35 
    36 void Cache::matchAll(std::optional<RequestInfo>&&, std::optional<CacheQueryOptions>&&, MatchAllPromise&& promise)
    37 {
    38     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     39Cache::Cache(ScriptExecutionContext& context, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&& connection)
     40    : ActiveDOMObject(&context)
     41    , m_name(WTFMove(name))
     42    , m_identifier(identifier)
     43    , m_connection(WTFMove(connection))
     44{
     45    suspendIfNeeded();
     46}
     47
     48Cache::~Cache()
     49{
     50}
     51
     52void Cache::match(RequestInfo&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise)
     53{
     54    doMatch(WTFMove(info), WTFMove(options), WTFMove(promise), MatchType::OnlyFirst);
     55}
     56
     57void Cache::matchAll(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise)
     58{
     59    doMatch(WTFMove(info), WTFMove(options), WTFMove(promise), MatchType::All);
     60}
     61
     62void Cache::doMatch(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise, MatchType matchType)
     63{
     64    RefPtr<FetchRequest> request;
     65    if (info) {
     66        if (WTF::holds_alternative<RefPtr<FetchRequest>>(info.value())) {
     67            request = WTF::get<RefPtr<FetchRequest>>(info.value()).releaseNonNull();
     68            if (request->method() != "GET" && !options.ignoreMethod) {
     69                if (matchType == MatchType::OnlyFirst) {
     70                    promise->resolve();
     71                    return;
     72                }
     73                promise->resolve<IDLSequence<IDLInterface<FetchResponse>>>(Vector<Ref<FetchResponse>> { });
     74                return;
     75            }
     76        } else {
     77            if (UNLIKELY(!scriptExecutionContext()))
     78                return;
     79            request = FetchRequest::create(*scriptExecutionContext(), WTFMove(info.value()), { }).releaseReturnValue();
     80        }
     81    }
     82
     83    if (!request) {
     84        ASSERT(matchType == MatchType::All);
     85        retrieveRecords([this, promise = WTFMove(promise)]() {
     86            Vector<Ref<FetchResponse>> responses;
     87            responses.reserveInitialCapacity(m_records.size());
     88            for (auto& record : m_records)
     89                responses.uncheckedAppend(record.response->cloneForJS());
     90            promise->resolve<IDLSequence<IDLInterface<FetchResponse>>>(responses);
     91        });
     92        return;
     93    }
     94    queryCache(request.releaseNonNull(), WTFMove(options), [matchType, promise = WTFMove(promise)](const Vector<CacheStorageRecord>& records) mutable {
     95        if (matchType == MatchType::OnlyFirst) {
     96            if (records.size()) {
     97                promise->resolve<IDLInterface<FetchResponse>>(records[0].response->cloneForJS());
     98                return;
     99            }
     100            promise->resolve();
     101            return;
     102        }
     103
     104        Vector<Ref<FetchResponse>> responses;
     105        responses.reserveInitialCapacity(records.size());
     106        for (auto& record : records)
     107            responses.uncheckedAppend(record.response->cloneForJS());
     108        promise->resolve<IDLSequence<IDLInterface<FetchResponse>>>(responses);
     109    });
    39110}
    40111
    41112void Cache::add(RequestInfo&&, DOMPromiseDeferred<void>&& promise)
    42113{
    43     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     114    promise.reject(Exception { NotSupportedError, ASCIILiteral("Not implemented")});
    44115}
    45116
    46117void Cache::addAll(Vector<RequestInfo>&&, DOMPromiseDeferred<void>&& promise)
    47118{
    48     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
    49 }
    50 
    51 void Cache::put(RequestInfo&&, Ref<FetchResponse>&&, DOMPromiseDeferred<void>&& promise)
    52 {
    53     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
    54 }
    55 
    56 void Cache::remove(RequestInfo&&, std::optional<CacheQueryOptions>&&, DOMPromiseDeferred<IDLBoolean>&& promise)
    57 {
    58     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
    59 }
    60 
    61 void Cache::keys(std::optional<RequestInfo>&&, std::optional<CacheQueryOptions>&&, KeysPromise&& promise)
    62 {
    63     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     119    promise.reject(Exception { NotSupportedError, ASCIILiteral("Not implemented")});
     120}
     121
     122void Cache::put(RequestInfo&& info, Ref<FetchResponse>&& response, DOMPromiseDeferred<void>&& promise)
     123{
     124    RefPtr<FetchRequest> request;
     125    if (WTF::holds_alternative<RefPtr<FetchRequest>>(info)) {
     126        request = WTF::get<RefPtr<FetchRequest>>(info).releaseNonNull();
     127        if (request->method() != "GET") {
     128            promise.reject(Exception { TypeError, ASCIILiteral("Request method is not GET") });
     129            return;
     130        }
     131    } else {
     132        if (UNLIKELY(!scriptExecutionContext()))
     133            return;
     134        request = FetchRequest::create(*scriptExecutionContext(), WTFMove(info), { }).releaseReturnValue();
     135    }
     136
     137    if (!protocolIsInHTTPFamily(request->url())) {
     138        promise.reject(Exception { TypeError, ASCIILiteral("Request url is not HTTP/HTTPS") });
     139        return;
     140    }
     141
     142    // FIXME: This is inefficient, we should be able to split and trim whitespaces at the same time.
     143    auto varyValue = response->headers().internalHeaders().get(WebCore::HTTPHeaderName::Vary);
     144    Vector<String> varyHeaderNames;
     145    varyValue.split(',', false, varyHeaderNames);
     146    for (auto& name : varyHeaderNames) {
     147        if (stripLeadingAndTrailingHTTPSpaces(name) == "*") {
     148            promise.reject(Exception { TypeError, ASCIILiteral("Response has a '*' Vary header value") });
     149            return;
     150        }
     151    }
     152
     153    if (response->isDisturbed()) {
     154        promise.reject(Exception { TypeError, ASCIILiteral("Response is disturbed or locked") });
     155        return;
     156    }
     157
     158    if (response->status() == 206) {
     159        promise.reject(Exception { TypeError, ASCIILiteral("Response is a 206 partial") });
     160        return;
     161    }
     162
     163    // FIXME: Add support for being loaded responses.
     164    if (response->isLoading()) {
     165        promise.reject(Exception { NotSupportedError, ASCIILiteral("Caching a loading Response is not yet supported") });
     166        return;
     167    }
     168
     169    // FIXME: Add support for ReadableStream.
     170    if (response->isReadableStreamBody()) {
     171        promise.reject(Exception { NotSupportedError, ASCIILiteral("Caching a Response with data stored in a ReadableStream is not yet supported") });
     172        return;
     173    }
     174
     175    batchPutOperation(*request, response.get(), [promise = WTFMove(promise)](CacheStorageConnection::Error error) mutable {
     176        if (error != CacheStorageConnection::Error::None) {
     177            promise.reject(CacheStorageConnection::exceptionFromError(error));
     178            return;
     179        }
     180        promise.resolve();
     181    });
     182}
     183
     184void Cache::remove(RequestInfo&& info, CacheQueryOptions&& options, DOMPromiseDeferred<IDLBoolean>&& promise)
     185{
     186    RefPtr<FetchRequest> request;
     187    if (WTF::holds_alternative<RefPtr<FetchRequest>>(info)) {
     188        request = WTF::get<RefPtr<FetchRequest>>(info).releaseNonNull();
     189        if (request->method() != "GET" && !options.ignoreMethod) {
     190            promise.resolve(false);
     191            return;
     192        }
     193    } else {
     194        if (UNLIKELY(!scriptExecutionContext()))
     195            return;
     196        request = FetchRequest::create(*scriptExecutionContext(), WTFMove(info), { }).releaseReturnValue();
     197    }
     198
     199    batchDeleteOperation(*request, WTFMove(options), [promise = WTFMove(promise)](bool didDelete, CacheStorageConnection::Error error) mutable {
     200        if (error !=  CacheStorageConnection::Error::None) {
     201            promise.reject(CacheStorageConnection::exceptionFromError(error));
     202            return;
     203        }
     204        promise.resolve(didDelete);
     205    });
     206}
     207
     208void Cache::keys(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, KeysPromise&& promise)
     209{
     210    RefPtr<FetchRequest> request;
     211    if (info) {
     212        if (WTF::holds_alternative<RefPtr<FetchRequest>>(info.value())) {
     213            request = WTF::get<RefPtr<FetchRequest>>(info.value()).releaseNonNull();
     214            if (request->method() != "GET" && !options.ignoreMethod) {
     215                promise.resolve(Vector<Ref<FetchRequest>> { });
     216                return;
     217            }
     218        } else {
     219            if (UNLIKELY(!scriptExecutionContext()))
     220                return;
     221            request = FetchRequest::create(*scriptExecutionContext(), WTFMove(info.value()), { }).releaseReturnValue();
     222        }
     223    }
     224
     225    if (!request) {
     226        retrieveRecords([this, promise = WTFMove(promise)]() mutable {
     227            Vector<Ref<FetchRequest>> requests;
     228            requests.reserveInitialCapacity(m_records.size());
     229            for (auto& record : m_records)
     230                requests.uncheckedAppend(record.request.copyRef());
     231            promise.resolve(requests);
     232        });
     233        return;
     234    }
     235
     236    queryCache(request.releaseNonNull(), WTFMove(options), [promise = WTFMove(promise)](const Vector<CacheStorageRecord>& records) mutable {
     237        Vector<Ref<FetchRequest>> requests;
     238        requests.reserveInitialCapacity(records.size());
     239        for (auto& record : records)
     240            requests.uncheckedAppend(record.request.copyRef());
     241        promise.resolve(requests);
     242    });
     243}
     244
     245void Cache::retrieveRecords(WTF::Function<void()>&& callback)
     246{
     247    setPendingActivity(this);
     248    m_connection->retrieveRecords(m_identifier, [this, callback = WTFMove(callback)](Vector<CacheStorageConnection::Record>&& records) {
     249        if (!m_isStopped) {
     250            updateRecords(WTFMove(records));
     251            callback();
     252        }
     253        unsetPendingActivity(this);
     254    });
     255}
     256
     257void Cache::queryCache(Ref<FetchRequest>&& request, CacheQueryOptions&& options, WTF::Function<void(const Vector<CacheStorageRecord>&)>&& callback)
     258{
     259    retrieveRecords([this, request = WTFMove(request), options = WTFMove(options), callback = WTFMove(callback)]() mutable {
     260        callback(queryCacheWithTargetStorage(request.get(), options, m_records));
     261    });
     262}
     263
     264static inline bool queryCacheMatch(const FetchRequest& request, const FetchRequest& cachedRequest, const ResourceResponse& cachedResponse, const CacheQueryOptions& options)
     265{
     266    // We need to pass the resource request with all correct headers hence why we call resourceRequest().
     267    return CacheStorageConnection::queryCacheMatch(request.resourceRequest(), cachedRequest.resourceRequest(), cachedResponse, options);
     268}
     269
     270Vector<CacheStorageRecord> Cache::queryCacheWithTargetStorage(const FetchRequest& request, const CacheQueryOptions& options, const Vector<CacheStorageRecord>& targetStorage)
     271{
     272    if (!options.ignoreMethod && request.method() != "GET")
     273        return { };
     274
     275    Vector<CacheStorageRecord> records;
     276    for (auto& record : targetStorage) {
     277        if (queryCacheMatch(request, record.request.get(), record.response->resourceResponse(), options))
     278            records.append({ record.identifier, record.request.copyRef(), record.response.copyRef() });
     279    }
     280    return records;
     281}
     282
     283void Cache::batchDeleteOperation(const FetchRequest& request, CacheQueryOptions&& options, WTF::Function<void(bool didRemoval, CacheStorageConnection::Error error)>&& callback)
     284{
     285    setPendingActivity(this);
     286    m_connection->batchDeleteOperation(m_identifier, request.internalRequest(), WTFMove(options), [this, callback = WTFMove(callback)](Vector<uint64_t>&& records, CacheStorageConnection::Error error) {
     287        if (!m_isStopped) {
     288            if (error == CacheStorageConnection::Error::None)
     289                m_records.removeAllMatching([&](const auto& item) { return records.contains(item.identifier); });
     290
     291            callback(!records.isEmpty(), error);
     292        }
     293        unsetPendingActivity(this);
     294    });
     295}
     296
     297static inline CacheStorageConnection::Record toConnectionRecord(const FetchRequest& request, FetchResponse& response)
     298{
     299    // FIXME: Add a setHTTPHeaderFields on ResourceResponseBase.
     300    ResourceResponse cachedResponse = response.resourceResponse();
     301    for (auto& header : response.headers().internalHeaders())
     302        cachedResponse.setHTTPHeaderField(header.key, header.value);
     303
     304    ResourceRequest cachedRequest = request.internalRequest();
     305    cachedRequest.setHTTPHeaderFields(request.headers().internalHeaders());
     306
     307    return { 0,
     308        request.headers().guard(), WTFMove(cachedRequest), request.fetchOptions(), request.internalRequestReferrer(),
     309        response.headers().guard(), WTFMove(cachedResponse)
     310    };
     311}
     312
     313void Cache::batchPutOperation(const FetchRequest& request, FetchResponse& response, WTF::Function<void(CacheStorageConnection::Error)>&& callback)
     314{
     315    Vector<CacheStorageConnection::Record> records;
     316    records.append(toConnectionRecord(request, response));
     317
     318    setPendingActivity(this);
     319    m_connection->batchPutOperation(m_identifier, WTFMove(records), [this, callback = WTFMove(callback)](Vector<uint64_t>&&, CacheStorageConnection::Error error) {
     320        if (!m_isStopped)
     321            callback(error);
     322
     323        unsetPendingActivity(this);
     324    });
     325}
     326
     327void Cache::updateRecords(Vector<CacheStorageConnection::Record>&& records)
     328{
     329    ASSERT(scriptExecutionContext());
     330    Vector<CacheStorageRecord> newRecords;
     331
     332    for (auto& record : records) {
     333        size_t index = m_records.findMatching([&](const auto& item) { return item.identifier == record.identifier; });
     334        if (index != notFound)
     335            newRecords.append(WTFMove(m_records[index]));
     336        else {
     337            auto requestHeaders = FetchHeaders::create(record.requestHeadersGuard, HTTPHeaderMap { record.request.httpHeaderFields() });
     338            FetchRequest::InternalRequest internalRequest = { WTFMove(record.request), WTFMove(record.options), WTFMove(record.referrer) };
     339            auto request = FetchRequest::create(*scriptExecutionContext(), std::nullopt, WTFMove(requestHeaders), WTFMove(internalRequest));
     340
     341            auto responseHeaders = FetchHeaders::create(record.responseHeadersGuard, HTTPHeaderMap { record.response.httpHeaderFields() });
     342            auto response = FetchResponse::create(*scriptExecutionContext(), std::nullopt, WTFMove(responseHeaders), WTFMove(record.response));
     343
     344            newRecords.append(CacheStorageRecord { record.identifier, WTFMove(request), WTFMove(response) });
     345        }
     346    }
     347    m_records = WTFMove(newRecords);
     348}
     349
     350void Cache::stop()
     351{
     352    m_isStopped = true;
     353}
     354
     355const char* Cache::activeDOMObjectName() const
     356{
     357    return "Cache";
     358}
     359
     360bool Cache::canSuspendForDocumentSuspension() const
     361{
     362    return m_records.isEmpty() && !hasPendingActivity();
    64363}
    65364
  • trunk/Source/WebCore/Modules/cache/Cache.h

    r220311 r220758  
    2626#pragma once
    2727
    28 #include "FetchRequest.h"
     28#include "ActiveDOMObject.h"
     29#include "CacheStorageConnection.h"
     30#include "CacheStorageRecord.h"
    2931
    3032namespace WebCore {
    3133
    32 class FetchResponse;
     34class ScriptExecutionContext;
    3335
    34 struct CacheQueryOptions;
    35 
    36 class Cache : public RefCounted<Cache> {
     36class Cache final : public RefCounted<Cache>, public ActiveDOMObject {
    3737public:
    38     static Ref<Cache> create(String&& name) { return adoptRef(*new Cache(WTFMove(name))); }
     38    static Ref<Cache> create(ScriptExecutionContext& context, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&& connection) { return adoptRef(*new Cache(context, WTFMove(name), identifier, WTFMove(connection))); }
     39    ~Cache();
    3940
    4041    using RequestInfo = FetchRequest::Info;
    4142
    42     using MatchAllPromise = DOMPromiseDeferred<IDLSequence<IDLInterface<FetchResponse>>>;
    4343    using KeysPromise = DOMPromiseDeferred<IDLSequence<IDLInterface<FetchRequest>>>;
    4444
    45     void match(RequestInfo&&, std::optional<CacheQueryOptions>&&, Ref<DeferredPromise>&&);
    46     void matchAll(std::optional<RequestInfo>&&, std::optional<CacheQueryOptions>&&, MatchAllPromise&&);
     45    void match(RequestInfo&&, CacheQueryOptions&&, Ref<DeferredPromise>&&);
     46    void matchAll(std::optional<RequestInfo>&&, CacheQueryOptions&&, Ref<DeferredPromise>&&);
    4747    void add(RequestInfo&&, DOMPromiseDeferred<void>&&);
    4848
    4949    void addAll(Vector<RequestInfo>&&, DOMPromiseDeferred<void>&&);
    5050    void put(RequestInfo&&, Ref<FetchResponse>&&, DOMPromiseDeferred<void>&&);
    51     void remove(RequestInfo&&, std::optional<CacheQueryOptions>&&, DOMPromiseDeferred<IDLBoolean>&&);
    52     void keys(std::optional<RequestInfo>&&, std::optional<CacheQueryOptions>&&, KeysPromise&&);
     51    void remove(RequestInfo&&, CacheQueryOptions&&, DOMPromiseDeferred<IDLBoolean>&&);
     52    void keys(std::optional<RequestInfo>&&, CacheQueryOptions&&, KeysPromise&&);
     53
     54    const String& name() const { return m_name; }
     55    uint64_t identifier() const { return m_identifier; }
    5356
    5457private:
    55     explicit Cache(String&& name) : m_name(WTFMove(name)) { }
     58    Cache(ScriptExecutionContext&, String&& name, uint64_t identifier, Ref<CacheStorageConnection>&&);
     59
     60    enum class MatchType { All, OnlyFirst };
     61    void doMatch(std::optional<RequestInfo>&&, CacheQueryOptions&&, Ref<DeferredPromise>&&, MatchType);
     62
     63    // ActiveDOMObject
     64    void stop() final;
     65    const char* activeDOMObjectName() const final;
     66    bool canSuspendForDocumentSuspension() const final;
     67
     68    void retrieveRecords(WTF::Function<void()>&&);
     69    Vector<CacheStorageRecord> queryCacheWithTargetStorage(const FetchRequest&, const CacheQueryOptions&, const Vector<CacheStorageRecord>&);
     70    void queryCache(Ref<FetchRequest>&&, CacheQueryOptions&&, WTF::Function<void(const Vector<CacheStorageRecord>&)>&&);
     71    void batchDeleteOperation(const FetchRequest&, CacheQueryOptions&&, WTF::Function<void(bool didRemoval, CacheStorageConnection::Error)>&&);
     72    void batchPutOperation(const FetchRequest&, FetchResponse&, WTF::Function<void(CacheStorageConnection::Error)>&&);
     73
     74    void updateRecords(Vector<CacheStorageConnection::Record>&&);
    5675
    5776    String m_name;
     77    uint64_t m_identifier;
     78    Ref<CacheStorageConnection> m_connection;
     79
     80    Vector<CacheStorageRecord> m_records;
     81    bool m_isStopped { false };
    5882};
    5983
  • trunk/Source/WebCore/Modules/cache/Cache.idl

    r220311 r220758  
    3030    Exposed=(Window,Worker),
    3131    EnabledAtRuntime=CacheAPI,
    32     ImplementationLacksVTable,
    3332] interface Cache {
    3433    [NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
  • trunk/Source/WebCore/Modules/cache/CacheStorage.cpp

    r220311 r220758  
    2727#include "CacheStorage.h"
    2828
     29#include "CacheQueryOptions.h"
     30#include "JSCache.h"
     31#include "ScriptExecutionContext.h"
     32
    2933namespace WebCore {
    3034
    31 void CacheStorage::match(RequestInfo&&, std::optional<CacheQueryOptions>&&, Ref<DeferredPromise>&& promise)
     35CacheStorage::CacheStorage(ScriptExecutionContext& context, Ref<CacheStorageConnection>&& connection)
     36    : ActiveDOMObject(&context)
     37    , m_connection(WTFMove(connection))
    3238{
    33     promise->reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     39    suspendIfNeeded();
    3440}
    3541
    36 void CacheStorage::has(const String&, DOMPromiseDeferred<IDLBoolean>&& promise)
     42String CacheStorage::origin() const
    3743{
    38     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     44    // FIXME: Do we really need to check for origin being null?
     45    auto* origin = scriptExecutionContext() ? scriptExecutionContext()->securityOrigin() : nullptr;
     46    return origin ? origin->toString() : String();
    3947}
    4048
    41 void CacheStorage::open(const String&, DOMPromiseDeferred<IDLInterface<Cache>>&& promise)
     49void CacheStorage::match(Cache::RequestInfo&&, CacheQueryOptions&&, Ref<DeferredPromise>&& promise)
    4250{
    43     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     51    promise->reject(Exception { NotSupportedError, ASCIILiteral("Not implemented")});
    4452}
    4553
    46 void CacheStorage::remove(const String&, DOMPromiseDeferred<IDLBoolean>&& promise)
     54void CacheStorage::has(const String& name, DOMPromiseDeferred<IDLBoolean>&& promise)
    4755{
    48     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     56    retrieveCaches([this, name, promise = WTFMove(promise)]() mutable {
     57        promise.resolve(m_caches.findMatching([&](auto& item) { return item->name() == name; }) != notFound);
     58    });
     59}
     60
     61void CacheStorage::retrieveCaches(WTF::Function<void()>&& callback)
     62{
     63    String origin = this->origin();
     64    if (origin.isNull())
     65        return;
     66
     67    setPendingActivity(this);
     68    m_connection->retrieveCaches(origin, [this, callback = WTFMove(callback)](Vector<CacheStorageConnection::CacheInfo>&& cachesInfo) {
     69        if (!m_isStopped) {
     70            ASSERT(scriptExecutionContext());
     71            m_caches.removeAllMatching([&](auto& cache) {
     72                return cachesInfo.findMatching([&](const auto& info) { return info.identifier == cache->identifier(); }) == notFound;
     73            });
     74            for (auto& info : cachesInfo) {
     75                if (m_caches.findMatching([&](const auto& cache) { return info.identifier == cache->identifier(); }) == notFound)
     76                    m_caches.append(Cache::create(*scriptExecutionContext(), WTFMove(info.name), info.identifier, m_connection.copyRef()));
     77            }
     78
     79            std::sort(m_caches.begin(), m_caches.end(), [&](auto& a, auto& b) {
     80                return a->identifier() < b->identifier();
     81            });
     82
     83            callback();
     84        }
     85        unsetPendingActivity(this);
     86    });
     87}
     88
     89void CacheStorage::open(const String& name, DOMPromiseDeferred<IDLInterface<Cache>>&& promise)
     90{
     91    retrieveCaches([this, name, promise = WTFMove(promise)]() mutable {
     92        auto position = m_caches.findMatching([&](auto& item) { return item->name() == name; });
     93        if (position != notFound) {
     94            auto& cache = m_caches[position];
     95            promise.resolve(Cache::create(*scriptExecutionContext(), String { cache->name() }, cache->identifier(), m_connection.copyRef()));
     96            return;
     97        }
     98
     99        String origin = this->origin();
     100        ASSERT(!origin.isNull());
     101
     102        setPendingActivity(this);
     103        m_connection->open(origin, name, [this, name, promise = WTFMove(promise)](uint64_t cacheIdentifier, CacheStorageConnection::Error error) mutable {
     104            if (!m_isStopped) {
     105                if (error != CacheStorageConnection::Error::None)
     106                    promise.reject(CacheStorageConnection::exceptionFromError(error));
     107                else {
     108                    auto cache = Cache::create(*scriptExecutionContext(), String { name }, cacheIdentifier, m_connection.copyRef());
     109                    promise.resolve(cache);
     110                    m_caches.append(WTFMove(cache));
     111                }
     112            }
     113            unsetPendingActivity(this);
     114        });
     115    });
     116}
     117
     118void CacheStorage::remove(const String& name, DOMPromiseDeferred<IDLBoolean>&& promise)
     119{
     120    retrieveCaches([this, name, promise = WTFMove(promise)]() mutable {
     121        auto position = m_caches.findMatching([&](auto& item) { return item->name() == name; });
     122        if (position == notFound) {
     123            promise.resolve(false);
     124            return;
     125        }
     126
     127        String origin = this->origin();
     128        ASSERT(!origin.isNull());
     129
     130        setPendingActivity(this);
     131        m_connection->remove(m_caches[position]->identifier(), [this, name, promise = WTFMove(promise)](uint64_t cacheIdentifier, CacheStorageConnection::Error error) mutable {
     132            UNUSED_PARAM(cacheIdentifier);
     133            if (!m_isStopped) {
     134                if (error != CacheStorageConnection::Error::None)
     135                    promise.reject(CacheStorageConnection::exceptionFromError(error));
     136                else
     137                    promise.resolve(true);
     138            }
     139            unsetPendingActivity(this);
     140        });
     141        m_caches.remove(position);
     142    });
    49143}
    50144
    51145void CacheStorage::keys(KeysPromise&& promise)
    52146{
    53     promise.reject(Exception { TypeError, ASCIILiteral("Not implemented")});
     147    retrieveCaches([this, promise = WTFMove(promise)]() mutable {
     148        Vector<String> keys;
     149        keys.reserveInitialCapacity(m_caches.size());
     150        for (auto& cache : m_caches)
     151            keys.uncheckedAppend(cache->name());
     152        promise.resolve(keys);
     153    });
     154}
     155
     156void CacheStorage::stop()
     157{
     158    m_isStopped = true;
     159}
     160
     161const char* CacheStorage::activeDOMObjectName() const
     162{
     163    return "CacheStorage";
     164}
     165
     166bool CacheStorage::canSuspendForDocumentSuspension() const
     167{
     168    return !hasPendingActivity();
    54169}
    55170
  • trunk/Source/WebCore/Modules/cache/CacheStorage.h

    r220311 r220758  
    2626#pragma once
    2727
     28#include "Cache.h"
     29#include "CacheStorageConnection.h"
    2830#include "FetchRequest.h"
     31#include <wtf/Forward.h>
    2932
    3033namespace WebCore {
    3134
    32 class Cache;
     35class CacheStorage : public RefCounted<CacheStorage>, public ActiveDOMObject {
     36public:
     37    static Ref<CacheStorage> create(ScriptExecutionContext& context, Ref<CacheStorageConnection>&& connection) { return adoptRef(*new CacheStorage(context, WTFMove(connection))); }
    3338
    34 struct CacheQueryOptions;
    35 
    36 class CacheStorage : public RefCounted<CacheStorage> {
    37 public:
    38     static Ref<CacheStorage> create() { return adoptRef(*new CacheStorage()); }
    39 
    40     using RequestInfo = FetchRequest::Info;
    4139    using KeysPromise = DOMPromiseDeferred<IDLSequence<IDLDOMString>>;
    4240
    43     void match(RequestInfo&&, std::optional<CacheQueryOptions>&&, Ref<DeferredPromise>&&);
     41    void match(Cache::RequestInfo&&, CacheQueryOptions&&, Ref<DeferredPromise>&&);
    4442    void has(const String&, DOMPromiseDeferred<IDLBoolean>&&);
    4543    void open(const String&, DOMPromiseDeferred<IDLInterface<Cache>>&&);
     
    4846
    4947private:
    50     CacheStorage() = default;
     48    CacheStorage(ScriptExecutionContext&, Ref<CacheStorageConnection>&&);
     49
     50    // ActiveDOMObject
     51    void stop() final;
     52    const char* activeDOMObjectName() const final;
     53    bool canSuspendForDocumentSuspension() const final;
     54
     55    void retrieveCaches(WTF::Function<void()>&&);
     56    String origin() const;
     57
     58    Vector<Ref<Cache>> m_caches;
     59    Ref<CacheStorageConnection> m_connection;
     60    bool m_isStopped { false };
    5161};
    5262
  • trunk/Source/WebCore/Modules/cache/CacheStorage.idl

    r220311 r220758  
    3030    Exposed=(Window,Worker),
    3131    EnabledAtRuntime=CacheAPI,
    32     ImplementationLacksVTable,
    3332] interface CacheStorage {
    3433    [NewObject] Promise<any> match(RequestInfo request, optional CacheQueryOptions options);
  • trunk/Source/WebCore/Modules/cache/CacheStorageRecord.h

    r220754 r220758  
    2626#pragma once
    2727
    28 #include "Supplementable.h"
     28#include "FetchRequest.h"
     29#include "FetchResponse.h"
    2930
    3031namespace WebCore {
    3132
    32 class CacheStorage;
    33 class WorkerGlobalScope;
     33struct CacheStorageRecord {
     34    uint64_t identifier;
    3435
    35 class WorkerGlobalScopeCaches : public Supplement<WorkerGlobalScope> {
    36 public:
    37     WorkerGlobalScopeCaches() = default;
    38 
    39     static CacheStorage* caches(WorkerGlobalScope&);
    40 
    41 private:
    42     static WorkerGlobalScopeCaches* from(WorkerGlobalScope&);
    43     static const char* supplementName();
    44     CacheStorage* caches() const;
    45 
    46     mutable RefPtr<CacheStorage> m_caches;
     36    Ref<FetchRequest> request;
     37    Ref<FetchResponse> response;
    4738};
    4839
    4940} // namespace WebCore
    50 
  • trunk/Source/WebCore/Modules/cache/DOMWindowCaches.cpp

    r220311 r220758  
    2828
    2929#include "CacheStorage.h"
     30#include "CacheStorageProvider.h"
    3031#include "DOMWindow.h"
     32#include "Document.h"
     33#include "Frame.h"
     34#include "Page.h"
    3135
    3236namespace WebCore {
     
    5559CacheStorage* DOMWindowCaches::caches(DOMWindow& window)
    5660{
     61    if (!window.isCurrentlyDisplayedInFrame())
     62        return nullptr;
     63
    5764    return DOMWindowCaches::from(&window)->caches();
    5865}
     
    6067CacheStorage* DOMWindowCaches::caches() const
    6168{
    62     if (!m_caches && frame())
    63         m_caches = CacheStorage::create();
     69    ASSERT(frame());
     70    ASSERT(frame()->document());
     71    if (!m_caches && frame()->page())
     72        m_caches = CacheStorage::create(*frame()->document(), frame()->page()->cacheStorageProvider().createCacheStorageConnection(frame()->page()->sessionID()));
    6473    return m_caches.get();
    6574}
  • trunk/Source/WebCore/Modules/cache/WorkerGlobalScopeCaches.cpp

    r220311 r220758  
    4141    auto* supplement = static_cast<WorkerGlobalScopeCaches*>(Supplement<WorkerGlobalScope>::from(&scope, supplementName()));
    4242    if (!supplement) {
    43         auto newSupplement = std::make_unique<WorkerGlobalScopeCaches>();
     43        auto newSupplement = std::make_unique<WorkerGlobalScopeCaches>(scope);
    4444        supplement = newSupplement.get();
    4545        provideTo(&scope, supplementName(), WTFMove(newSupplement));
     
    5656{
    5757    if (!m_caches)
    58         m_caches = CacheStorage::create();
     58        m_caches = CacheStorage::create(m_scope, CacheStorageConnection::create());
    5959    return m_caches.get();
    6060}
  • trunk/Source/WebCore/Modules/cache/WorkerGlobalScopeCaches.h

    r220311 r220758  
    3535class WorkerGlobalScopeCaches : public Supplement<WorkerGlobalScope> {
    3636public:
    37     WorkerGlobalScopeCaches() = default;
     37    explicit WorkerGlobalScopeCaches(WorkerGlobalScope& scope)
     38        : m_scope(scope)
     39    {
     40    }
    3841
    3942    static CacheStorage* caches(WorkerGlobalScope&);
     
    4447    CacheStorage* caches() const;
    4548
     49    WorkerGlobalScope& m_scope;
    4650    mutable RefPtr<CacheStorage> m_caches;
    4751};
  • trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.h

    r220751 r220758  
    5858    bool isActive() const { return !!m_blobLoader; }
    5959
     60    bool isReadableStreamBody() const { return m_body && m_body->isReadableStream(); }
     61
    6062protected:
    6163    const FetchBody& body() const { return *m_body; }
  • trunk/Source/WebCore/Modules/fetch/FetchHeaders.h

    r220241 r220758  
    3131#include "ExceptionOr.h"
    3232#include "HTTPHeaderMap.h"
     33#include <wtf/EnumTraits.h>
    3334#include <wtf/HashTraits.h>
    3435#include <wtf/Variant.h>
     
    5051    static ExceptionOr<Ref<FetchHeaders>> create(std::optional<Init>&&);
    5152
    52     static Ref<FetchHeaders> create(Guard guard = Guard::None) { return adoptRef(*new FetchHeaders { guard }); }
     53    static Ref<FetchHeaders> create(Guard guard = Guard::None, HTTPHeaderMap&& headers = { }) { return adoptRef(*new FetchHeaders { guard, WTFMove(headers) }); }
    5354    static Ref<FetchHeaders> create(const FetchHeaders& headers) { return adoptRef(*new FetchHeaders { headers }); }
    5455
     
    8384
    8485    void setGuard(Guard);
     86    Guard guard() const { return m_guard; }
    8587
    8688private:
    87     explicit FetchHeaders(Guard guard, HTTPHeaderMap&& headers = { });
     89    FetchHeaders(Guard, HTTPHeaderMap&&);
    8890    FetchHeaders(const FetchHeaders&);
    8991
     
    112114
    113115} // namespace WebCore
     116
     117namespace WTF {
     118
     119template<> struct EnumTraits<WebCore::FetchHeaders::Guard> {
     120    using values = EnumValues<
     121    WebCore::FetchHeaders::Guard,
     122    WebCore::FetchHeaders::Guard::None,
     123    WebCore::FetchHeaders::Guard::Immutable,
     124    WebCore::FetchHeaders::Guard::Request,
     125    WebCore::FetchHeaders::Guard::RequestNoCors,
     126    WebCore::FetchHeaders::Guard::Response
     127    >;
     128};
     129
     130}
  • trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp

    r220751 r220758  
    8282    options.sameOriginDataURLFlag = SameOriginDataURLFlag::Set;
    8383
    84     ResourceRequest fetchRequest = request.internalRequest();
     84    ResourceRequest fetchRequest = request.resourceRequest();
    8585
    8686    ASSERT(context.contentSecurityPolicy());
  • trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp

    r220244 r220758  
    7575static std::optional<Exception> buildOptions(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const FetchRequest::Init& init)
    7676{
    77     if (!init.window.isUndefinedOrNull())
     77    if (!init.window.isUndefinedOrNull() && !init.window.isEmpty())
    7878        return Exception { TypeError, ASCIILiteral("Window can only be null.") };
    7979
     
    258258}
    259259
    260 const String& FetchRequest::url() const
     260const String& FetchRequest::urlString() const
    261261{
    262262    if (m_requestURL.isNull())
     
    265265}
    266266
    267 ResourceRequest FetchRequest::internalRequest() const
     267ResourceRequest FetchRequest::resourceRequest() const
    268268{
    269269    ASSERT(scriptExecutionContext());
  • trunk/Source/WebCore/Modules/fetch/FetchRequest.h

    r220244 r220758  
    5454    using Type = FetchOptions::Type;
    5555
     56    struct InternalRequest {
     57        ResourceRequest request;
     58        FetchOptions options;
     59        String referrer;
     60    };
     61
    5662    static ExceptionOr<Ref<FetchRequest>> create(ScriptExecutionContext&, Info&&, Init&&);
     63    static Ref<FetchRequest> create(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, InternalRequest&& request) { return adoptRef(*new FetchRequest(context, WTFMove(body), WTFMove(headers), WTFMove(request))); }
    5764
    5865    const String& method() const { return m_internalRequest.request.httpMethod(); }
    59     const String& url() const;
     66    const String& urlString() const;
    6067    FetchHeaders& headers() { return m_headers.get(); }
     68    const FetchHeaders& headers() const { return m_headers.get(); }
    6169
    6270    Type type() const;
     
    7482    ExceptionOr<Ref<FetchRequest>> clone(ScriptExecutionContext&);
    7583
    76     struct InternalRequest {
    77         ResourceRequest request;
    78         FetchOptions options;
    79         String referrer;
    80     };
    81 
    8284    const FetchOptions& fetchOptions() const { return m_internalRequest.options; }
    83     ResourceRequest internalRequest() const;
     85    const ResourceRequest& internalRequest() const { return m_internalRequest.request; }
     86    const String& internalRequestReferrer() const { return m_internalRequest.referrer; }
     87    const URL& url() const { return m_internalRequest.request.url(); }
    8488    bool isBodyReadableStream() const { return !isBodyNull() && body().isReadableStream(); }
    8589
    86     const String& internalRequestReferrer() const { return m_internalRequest.referrer; }
     90    ResourceRequest resourceRequest() const;
    8791
    8892private:
  • trunk/Source/WebCore/Modules/fetch/FetchRequest.idl

    r220244 r220758  
    4545] interface FetchRequest {
    4646    readonly attribute ByteString method;
    47     readonly attribute USVString url;
     47    [ImplementedAs=urlString] readonly attribute USVString url;
    4848    readonly attribute FetchHeaders headers; // FIXME: Should be [SameObject].
    4949
  • trunk/Source/WebCore/Modules/fetch/FetchResponse.h

    r220751 r220758  
    5858    static ExceptionOr<Ref<FetchResponse>> redirect(ScriptExecutionContext&, const String& url, int status);
    5959
     60    static Ref<FetchResponse> create(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response) { return adoptRef(*new FetchResponse(context, WTFMove(body), WTFMove(headers), WTFMove(response))); }
     61
    6062    using FetchPromise = DOMPromiseDeferred<IDLInterface<FetchResponse>>;
    6163    static void fetch(ScriptExecutionContext&, FetchRequest&, FetchPromise&&);
     
    7981    const String& statusText() const { return m_response.httpStatusText(); }
    8082
     83    const FetchHeaders& headers() const { return m_headers; }
    8184    FetchHeaders& headers() { return m_headers; }
    8285    Ref<FetchResponse> cloneForJS();
     
    9093
    9194    bool isLoading() const { return !!m_bodyLoader; }
     95
     96    const ResourceResponse& resourceResponse() const { return m_response; }
    9297
    9398private:
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r220751 r220758  
    17851785                41D015CA0F4B5C71004A662F /* ContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 41D015C80F4B5C71004A662F /* ContentType.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17861786                41D015CB0F4B5C71004A662F /* ContentType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41D015C90F4B5C71004A662F /* ContentType.cpp */; };
     1787                41D129CE1F3D0EF600D15E47 /* WorkerGlobalScopeCaches.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FB278D1F34C28200795487 /* WorkerGlobalScopeCaches.h */; };
     1788                41D129CF1F3D0EFE00D15E47 /* CacheStorageConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41D129C91F3D0EE300D15E47 /* CacheStorageConnection.cpp */; };
     1789                41D129D01F3D0F0500D15E47 /* CacheQueryOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FB279B1F34CEF000795487 /* CacheQueryOptions.h */; };
     1790                41D129D11F3D0F0E00D15E47 /* DOMWindowCaches.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FB278C1F34C28200795487 /* DOMWindowCaches.h */; };
     1791                41D129D21F3D0F1200D15E47 /* CacheStorageRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 41D129CA1F3D0EE300D15E47 /* CacheStorageRecord.h */; };
     1792                41D129D31F3D0F1600D15E47 /* CacheStorageConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 41D129CC1F3D0EE300D15E47 /* CacheStorageConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1793                41D129D51F3D0F6900D15E47 /* CacheStorageProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41D129D41F3D0F6600D15E47 /* CacheStorageProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1794                41D129DB1F3D143800D15E47 /* FetchHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F54F831C50C4F600338488 /* FetchHeaders.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17871795                41DEFCB51E56C1BD000D9E5F /* JSDOMMapLike.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41DEFCB31E56C1B9000D9E5F /* JSDOMMapLike.cpp */; };
    17881796                41DEFCB61E56C1BD000D9E5F /* JSDOMMapLike.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DEFCB41E56C1B9000D9E5F /* JSDOMMapLike.h */; };
     
    94639471                41D015C80F4B5C71004A662F /* ContentType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentType.h; sourceTree = "<group>"; };
    94649472                41D015C90F4B5C71004A662F /* ContentType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentType.cpp; sourceTree = "<group>"; };
     9473                41D129C91F3D0EE300D15E47 /* CacheStorageConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CacheStorageConnection.cpp; sourceTree = "<group>"; };
     9474                41D129CA1F3D0EE300D15E47 /* CacheStorageRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CacheStorageRecord.h; sourceTree = "<group>"; };
     9475                41D129CC1F3D0EE300D15E47 /* CacheStorageConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CacheStorageConnection.h; sourceTree = "<group>"; };
     9476                41D129D41F3D0F6600D15E47 /* CacheStorageProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CacheStorageProvider.h; sourceTree = "<group>"; };
    94659477                41D51BB21E4E2E8100131A5B /* LibWebRTCAudioFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCAudioFormat.h; path = libwebrtc/LibWebRTCAudioFormat.h; sourceTree = "<group>"; };
    94669478                41DEFCB21E56C1B9000D9E5F /* JSDOMBindingInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = JSDOMBindingInternals.js; sourceTree = "<group>"; };
     
    1766817680                                41380C221F34369000155FDA /* CacheStorage.h */,
    1766917681                                41380C241F34369700155FDA /* CacheStorage.idl */,
     17682                                41D129C91F3D0EE300D15E47 /* CacheStorageConnection.cpp */,
     17683                                41D129CC1F3D0EE300D15E47 /* CacheStorageConnection.h */,
     17684                                41D129CA1F3D0EE300D15E47 /* CacheStorageRecord.h */,
    1767017685                                41FB278E1F34C28200795487 /* DOMWindowCaches.cpp */,
    1767117686                                41FB278C1F34C28200795487 /* DOMWindowCaches.h */,
     
    1926619281                                460BB6131D0A1BEC00221812 /* Base64Utilities.cpp */,
    1926719282                                460BB6141D0A1BEC00221812 /* Base64Utilities.h */,
     19283                                41D129D41F3D0F6600D15E47 /* CacheStorageProvider.h */,
    1926819284                                072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */,
    1926919285                                079D0867162F20E800DB8658 /* CaptionUserPreferences.h */,
     
    2677726793                                BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
    2677826794                                93F1995008245E59001E9ABC /* CachePolicy.h in Headers */,
     26795                                41D129D01F3D0F0500D15E47 /* CacheQueryOptions.h in Headers */,
    2677926796                                41380C291F3436AC00155FDA /* CacheStorage.h in Headers */,
     26797                                41D129D31F3D0F1600D15E47 /* CacheStorageConnection.h in Headers */,
     26798                                41D129D51F3D0F6900D15E47 /* CacheStorageProvider.h in Headers */,
     26799                                41D129D21F3D0F1200D15E47 /* CacheStorageRecord.h in Headers */,
    2678026800                                E43AF8E71AC5B7EC00CA717E /* CacheValidation.h in Headers */,
    2678126801                                49AE2D97134EE5F90072920A /* CalculationValue.h in Headers */,
     
    2725527275                                CD9DE18217AAD6A400EA386D /* DOMURLMediaSource.h in Headers */,
    2725627276                                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
     27277                                41D129D11F3D0F0E00D15E47 /* DOMWindowCaches.h in Headers */,
    2725727278                                51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */,
    2725827279                                5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */,
     
    2735027371                                84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */,
    2735127372                                84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
     27373                                41D129DB1F3D143800D15E47 /* FetchHeaders.h in Headers */,
    2735227374                                416E6FE81BBD12DF000A6023 /* FetchInternalsBuiltins.h in Headers */,
    2735327375                                41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */,
     
    3027630298                                A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */,
    3027730299                                2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */,
     30300                                41D129CE1F3D0EF600D15E47 /* WorkerGlobalScopeCaches.h in Headers */,
    3027830301                                5185FCB41BB4C4E80012898F /* WorkerGlobalScopeIndexedDatabase.h in Headers */,
    3027930302                                2E43464B0F546A8200B0F1BA /* WorkerGlobalScopeProxy.h in Headers */,
     
    3088830911                                BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */,
    3088930912                                41380C281F3436AC00155FDA /* CacheStorage.cpp in Sources */,
     30913                                41D129CF1F3D0EFE00D15E47 /* CacheStorageConnection.cpp in Sources */,
    3089030914                                E43AF8E61AC5B7E800CA717E /* CacheValidation.cpp in Sources */,
    3089130915                                49AE2D96134EE5F90072920A /* CalculationValue.cpp in Sources */,
  • trunk/Source/WebCore/inspector/InspectorOverlay.cpp

    r217724 r220758  
    3030#include "InspectorOverlay.h"
    3131
     32#include "CacheStorageProvider.h"
    3233#include "DocumentLoader.h"
    3334#include "EditorClient.h"
     
    866867        createEmptyEditorClient(),
    867868        SocketProvider::create(),
    868         makeUniqueRef<LibWebRTCProvider>()
     869        makeUniqueRef<LibWebRTCProvider>(),
     870        CacheStorageProvider::create()
    869871    );
    870872    fillWithEmptyClients(pageConfiguration);
  • trunk/Source/WebCore/page/CacheStorageProvider.h

    r220754 r220758  
    2626#pragma once
    2727
    28 #include "Supplementable.h"
     28#include "CacheStorageConnection.h"
     29#include "SessionID.h"
     30#include <wtf/RefCounted.h>
    2931
    3032namespace WebCore {
    3133
    32 class CacheStorage;
    33 class WorkerGlobalScope;
     34class WEBCORE_EXPORT CacheStorageProvider : public RefCounted<CacheStorageProvider> {
     35public:
     36    static Ref<CacheStorageProvider> create() { return adoptRef(*new CacheStorageProvider); }
     37    virtual Ref<CacheStorageConnection> createCacheStorageConnection(SessionID) { return CacheStorageConnection::create(); }
     38    virtual ~CacheStorageProvider() { };
    3439
    35 class WorkerGlobalScopeCaches : public Supplement<WorkerGlobalScope> {
    36 public:
    37     WorkerGlobalScopeCaches() = default;
    38 
    39     static CacheStorage* caches(WorkerGlobalScope&);
    40 
    41 private:
    42     static WorkerGlobalScopeCaches* from(WorkerGlobalScope&);
    43     static const char* supplementName();
    44     CacheStorage* caches() const;
    45 
    46     mutable RefPtr<CacheStorage> m_caches;
     40protected:
     41    CacheStorageProvider() = default;
    4742};
    4843
    49 } // namespace WebCore
    50 
     44}
  • trunk/Source/WebCore/page/Page.cpp

    r220730 r220758  
    2727#include "BackForwardController.h"
    2828#include "CSSAnimationController.h"
     29#include "CacheStorageProvider.h"
    2930#include "Chrome.h"
    3031#include "ChromeClient.h"
     
    223224    , m_socketProvider(WTFMove(pageConfiguration.socketProvider))
    224225    , m_applicationCacheStorage(*WTFMove(pageConfiguration.applicationCacheStorage))
     226    , m_cacheStorageProvider(WTFMove(pageConfiguration.cacheStorageProvider))
    225227    , m_databaseProvider(*WTFMove(pageConfiguration.databaseProvider))
    226228    , m_pluginInfoProvider(*WTFMove(pageConfiguration.pluginInfoProvider))
  • trunk/Source/WebCore/page/Page.h

    r220730 r220758  
    7878class BackForwardController;
    7979class BackForwardClient;
     80class CacheStorageProvider;
    8081class Chrome;
    8182class ChromeClient;
     
    496497    ApplicationCacheStorage& applicationCacheStorage() { return m_applicationCacheStorage; }
    497498    DatabaseProvider& databaseProvider() { return m_databaseProvider; }
     499    CacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider; }
    498500    SocketProvider& socketProvider() { return m_socketProvider; }
    499501
     
    766768    Ref<SocketProvider> m_socketProvider;
    767769    Ref<ApplicationCacheStorage> m_applicationCacheStorage;
     770    Ref<CacheStorageProvider> m_cacheStorageProvider;
    768771    Ref<DatabaseProvider> m_databaseProvider;
    769772    Ref<PluginInfoProvider> m_pluginInfoProvider;
  • trunk/Source/WebCore/page/PageConfiguration.cpp

    r217737 r220758  
    2929#include "ApplicationCacheStorage.h"
    3030#include "BackForwardClient.h"
     31#include "CacheStorageProvider.h"
    3132#include "DatabaseProvider.h"
    3233#include "DiagnosticLoggingClient.h"
     
    4445namespace WebCore {
    4546
    46 PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider)
     47PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider)
    4748    : editorClient(WTFMove(editorClient))
    4849    , socketProvider(WTFMove(socketProvider))
    4950    , libWebRTCProvider(WTFMove(libWebRTCProvider))
     51    , cacheStorageProvider(WTFMove(cacheStorageProvider))
    5052{
    5153}
  • trunk/Source/WebCore/page/PageConfiguration.h

    r217737 r220758  
    3535class ApplicationCacheStorage;
    3636class BackForwardClient;
     37class CacheStorageProvider;
    3738class ChromeClient;
    3839class ContextMenuClient;
     
    5960    WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
    6061public:
    61     WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&);
     62    WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&);
    6263    WEBCORE_EXPORT ~PageConfiguration();
    6364
     
    8889    RefPtr<ApplicationCacheStorage> applicationCacheStorage;
    8990    RefPtr<DatabaseProvider> databaseProvider;
     91    Ref<CacheStorageProvider> cacheStorageProvider;
    9092    RefPtr<PluginInfoProvider> pluginInfoProvider;
    9193    RefPtr<StorageNamespaceProvider> storageNamespaceProvider;
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r220503 r220758  
    2929#include "SVGImage.h"
    3030
     31#include "CacheStorageProvider.h"
    3132#include "Chrome.h"
    3233#include "CommonVM.h"
     
    430431            createEmptyEditorClient(),
    431432            SocketProvider::create(),
    432             makeUniqueRef<LibWebRTCProvider>()
     433            makeUniqueRef<LibWebRTCProvider>(),
     434            CacheStorageProvider::create()
    433435        );
    434436        fillWithEmptyClients(pageConfiguration);
  • trunk/Source/WebKit/CMakeLists.txt

    r220734 r220758  
    5353    "${WEBKIT2_DIR}/WebProcess/ApplicationCache"
    5454    "${WEBKIT2_DIR}/WebProcess/Automation"
     55    "${WEBKIT2_DIR}/WebProcess/Cache"
    5556    "${WEBKIT2_DIR}/WebProcess/Cookies"
    5657    "${WEBKIT2_DIR}/WebProcess/Databases"
  • trunk/Source/WebKit/ChangeLog

    r220742 r220758  
     12017-08-15  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Adding generic support for CacheStorage and Cache methods
     4        https://bugs.webkit.org/show_bug.cgi?id=175455
     5
     6        Reviewed by Chris Dumez.
     7
     8        * WebKit.xcodeproj/project.pbxproj:
     9        * WebProcess/Cache/WebCacheStorageProvider.h: Added.
     10        * WebProcess/WebPage/WebPage.cpp:
     11        (WebKit::m_cpuLimit):
     12        * WebProcess/WebProcess.cpp:
     13        (WebKit::WebProcess::WebProcess):
     14        * WebProcess/WebProcess.h:
     15        (WebKit::WebProcess::cacheStorageProvider):
     16
    1172017-08-15  Michael Catanzaro  <mcatanzaro@igalia.com>
    218
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r220539 r220758  
    892892                413075B31DE85F580039EC69 /* LibWebRTCProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 413075A71DE85EE70039EC69 /* LibWebRTCProvider.cpp */; };
    893893                413075B41DE85F580039EC69 /* LibWebRTCProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 413075A81DE85EE70039EC69 /* LibWebRTCProvider.h */; };
     894                41D129DA1F3D101800D15E47 /* WebCacheStorageProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41D129D91F3D101400D15E47 /* WebCacheStorageProvider.h */; };
    894895                41DC45961E3D6E2200B11F51 /* NetworkRTCProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DC45941E3D6E1E00B11F51 /* NetworkRTCProvider.h */; };
    895896                41DC45971E3D6E2200B11F51 /* NetworkRTCProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41DC45951E3D6E1E00B11F51 /* NetworkRTCProvider.cpp */; };
     
    31433144                413075A81DE85EE70039EC69 /* LibWebRTCProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = LibWebRTCProvider.h; path = Network/webrtc/LibWebRTCProvider.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
    31443145                41AC86811E042E5300303074 /* WebRTCResolver.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; name = WebRTCResolver.messages.in; path = Network/webrtc/WebRTCResolver.messages.in; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = "<none>"; };
     3146                41D129D91F3D101400D15E47 /* WebCacheStorageProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebCacheStorageProvider.h; sourceTree = "<group>"; };
    31453147                41DC45941E3D6E1E00B11F51 /* NetworkRTCProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkRTCProvider.h; path = NetworkProcess/webrtc/NetworkRTCProvider.h; sourceTree = "<group>"; };
    31463148                41DC45951E3D6E1E00B11F51 /* NetworkRTCProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkRTCProvider.cpp; path = NetworkProcess/webrtc/NetworkRTCProvider.cpp; sourceTree = "<group>"; };
     
    59135915                        sourceTree = "<group>";
    59145916                };
     5917                41D129D81F3D101400D15E47 /* Cache */ = {
     5918                        isa = PBXGroup;
     5919                        children = (
     5920                                41D129D91F3D101400D15E47 /* WebCacheStorageProvider.h */,
     5921                        );
     5922                        path = Cache;
     5923                        sourceTree = "<group>";
     5924                };
    59155925                4450AEBE1DC3FAAC009943F2 /* cocoa */ = {
    59165926                        isa = PBXGroup;
     
    65936603                                1AB1F7701D1B2F5D007C9BD1 /* ApplePay */,
    65946604                                1C0A19431C8FF1A800FE0EBB /* Automation */,
     6605                                41D129D81F3D101400D15E47 /* Cache */,
    65956606                                7C6E70F818B2D47E00F24E2E /* cocoa */,
    65966607                                3309344B1315B93A0097A7BC /* Cookies */,
     
    86908701                                518D2CAE12D5153B003BB93B /* WebBackForwardListItem.h in Headers */,
    86918702                                BC72B9FB11E6476B001EB4EA /* WebBackForwardListProxy.h in Headers */,
     8703                                41D129DA1F3D101800D15E47 /* WebCacheStorageProvider.h in Headers */,
    86928704                                BCF50728124329AA005955AE /* WebCertificateInfo.h in Headers */,
    86938705                                BC032D7510F4378D0058C15A /* WebChromeClient.h in Headers */,
     
    88328844                                1A1E093418861D3800D2DC49 /* WebProgressTrackerClient.h in Headers */,
    88338845                                512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */,
    8834                                 51BEB62C1F3A5AD7005029B9 /* WebServiceWorkerProvider.h in Headers */,
    88358846                                37948404150C350600E52CE9 /* WebRenderLayer.h in Headers */,
    88368847                                3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */,
     
    88448855                                7C361D731927FA360036A59D /* WebScriptMessageHandler.h in Headers */,
    88458856                                D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
     8857                                51BEB62C1F3A5AD7005029B9 /* WebServiceWorkerProvider.h in Headers */,
    88468858                                1A4832D71A9CDF96008B4DFE /* WebsiteData.h in Headers */,
    88478859                                1A4832D11A9BDC2F008B4DFE /* WebsiteDataRecord.h in Headers */,
     
    1037210384                                C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */,
    1037310385                                1A6280F31919982A006AD9F9 /* WebKit.m in Sources */,
    10374                                 51BEB62B1F3A5AD7005029B9 /* WebServiceWorkerProvider.cpp in Sources */,
    1037510386                                BC9BA5041697C45300E44616 /* WebKit2Initialize.cpp in Sources */,
    1037610387                                465250E61ECF52DC002025CB /* WebKit2InitializeCocoa.mm in Sources */,
     
    1047010481                                7C361D721927FA360036A59D /* WebScriptMessageHandler.cpp in Sources */,
    1047110482                                D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */,
     10483                                51BEB62B1F3A5AD7005029B9 /* WebServiceWorkerProvider.cpp in Sources */,
    1047210484                                1A4832D61A9CDF96008B4DFE /* WebsiteData.cpp in Sources */,
    1047310485                                1A4832D91A9D1FD2008B4DFE /* WebsiteDataRecord.cpp in Sources */,
  • trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h

    r220754 r220758  
    2626#pragma once
    2727
    28 #include "Supplementable.h"
     28#include <WebCore/CacheStorageProvider.h>
    2929
    30 namespace WebCore {
     30namespace WebKit {
    3131
    32 class CacheStorage;
    33 class WorkerGlobalScope;
    34 
    35 class WorkerGlobalScopeCaches : public Supplement<WorkerGlobalScope> {
     32class WebCacheStorageProvider final : public WebCore::CacheStorageProvider {
    3633public:
    37     WorkerGlobalScopeCaches() = default;
    38 
    39     static CacheStorage* caches(WorkerGlobalScope&);
     34    static Ref<WebCacheStorageProvider> create() { return adoptRef(*new WebCacheStorageProvider); }
    4035
    4136private:
    42     static WorkerGlobalScopeCaches* from(WorkerGlobalScope&);
    43     static const char* supplementName();
    44     CacheStorage* caches() const;
    45 
    46     mutable RefPtr<CacheStorage> m_caches;
     37    WebCacheStorageProvider() = default;
    4738};
    4839
    49 } // namespace WebCore
    50 
     40}
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r220734 r220758  
    6969#include "WebBackForwardListItem.h"
    7070#include "WebBackForwardListProxy.h"
     71#include "WebCacheStorageProvider.h"
    7172#include "WebChromeClient.h"
    7273#include "WebColorChooser.h"
     
    368369        makeUniqueRef<WebEditorClient>(this),
    369370        WebSocketProvider::create(),
    370         makeUniqueRef<WebKit::LibWebRTCProvider>()
     371        makeUniqueRef<WebKit::LibWebRTCProvider>(),
     372        WebProcess::singleton().cacheStorageProvider()
    371373    );
    372374    pageConfiguration.chromeClient = new WebChromeClient(*this);
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r220539 r220758  
    4545#include "UserData.h"
    4646#include "WebAutomationSessionProxy.h"
     47#include "WebCacheStorageProvider.h"
    4748#include "WebConnectionToUIProcess.h"
    4849#include "WebCookieManager.h"
     
    161162    , m_webInspectorInterruptDispatcher(WebInspectorInterruptDispatcher::create())
    162163    , m_webLoaderStrategy(*new WebLoaderStrategy)
     164    , m_cacheStorageProvider(WebCacheStorageProvider::create())
    163165    , m_dnsPrefetchHystereris([this](HysteresisState state) { if (state == HysteresisState::Stopped) m_dnsPrefetchedHosts.clear(); })
    164166#if ENABLE(NETSCAPE_PLUGIN_API)
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r220412 r220758  
    8181class WaylandCompositorDisplay;
    8282class WebAutomationSessionProxy;
     83class WebCacheStorageProvider;
    8384class WebConnectionToUIProcess;
    8485class WebFrame;
     
    222223
    223224    WebAutomationSessionProxy* automationSessionProxy() { return m_automationSessionProxy.get(); }
     225
     226    WebCacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider.get(); }
    224227
    225228private:
     
    376379    WebLoaderStrategy& m_webLoaderStrategy;
    377380
     381    Ref<WebCacheStorageProvider> m_cacheStorageProvider;
     382
    378383#if USE(LIBWEBRTC)
    379384    std::unique_ptr<LibWebRTCNetwork> m_libWebRTCNetwork;
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r220734 r220758  
     12017-08-15  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Adding generic support for CacheStorage and Cache methods
     4        https://bugs.webkit.org/show_bug.cgi?id=175455
     5
     6        Reviewed by Chris Dumez.
     7
     8        * WebView/WebView.mm:
     9        (-[WebView _commonInitializationWithFrameName:groupName:]):
     10
    1112017-08-14  Simon Fraser  <simon.fraser@apple.com>
    212
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r220627 r220758  
    125125#import <WebCore/BackForwardController.h>
    126126#import <WebCore/CSSAnimationController.h>
     127#import <WebCore/CacheStorageProvider.h>
    127128#import <WebCore/Chrome.h>
    128129#import <WebCore/ColorMac.h>
     
    14141415        makeUniqueRef<WebEditorClient>(self),
    14151416        SocketProvider::create(),
    1416         makeUniqueRef<WebCore::LibWebRTCProvider>()
     1417        makeUniqueRef<WebCore::LibWebRTCProvider>(),
     1418        WebCore::CacheStorageProvider::create()
    14171419    );
    14181420#if !PLATFORM(IOS)
     
    16771679        makeUniqueRef<WebEditorClient>(self),
    16781680        SocketProvider::create(),
    1679         makeUniqueRef<WebCore::LibWebRTCProvider>()
     1681        makeUniqueRef<WebCore::LibWebRTCProvider>(),
     1682        WebCore::CacheStorageProvider::create()
    16801683    );
    16811684    pageConfiguration.chromeClient = new WebChromeClientIOS(self);
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r220639 r220758  
     12017-08-15  Youenn Fablet  <youenn@apple.com>
     2
     3        [Cache API] Adding generic support for CacheStorage and Cache methods
     4        https://bugs.webkit.org/show_bug.cgi?id=175455
     5
     6        Reviewed by Chris Dumez.
     7
     8        * WebView.cpp:
     9        (WebView::initWithFrame):
     10
    1112017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
    212
  • trunk/Source/WebKitLegacy/win/WebView.cpp

    r220639 r220758  
    8585#include <WebCore/BackForwardController.h>
    8686#include <WebCore/BitmapInfo.h>
     87#include <WebCore/CacheStorageProvider.h>
    8788#include <WebCore/Chrome.h>
    8889#include <WebCore/ContextMenu.h>
     
    31033104        makeUniqueRef<WebEditorClient>(this),
    31043105        SocketProvider::create(),
    3105         makeUniqueRef<LibWebRTCProvider>()
     3106        makeUniqueRef<LibWebRTCProvider>(),
     3107        WebCore::CacheStorageProvider::create()
    31063108    );
    31073109    configuration.backForwardClient = BackForwardList::create();
Note: See TracChangeset for help on using the changeset viewer.