Changeset 220984 in webkit
- Timestamp:
- Aug 21, 2017 2:58:58 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r220971 r220984 1 2017-08-21 Youenn Fablet <youenn@apple.com> 2 3 [Cache API] Add support for CacheStorage.match 4 https://bugs.webkit.org/show_bug.cgi?id=175747 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/service-workers/cache-storage/window/cache-delete.https-expected.txt: 9 * web-platform-tests/service-workers/cache-storage/window/cache-keys.https-expected.txt: 10 * web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt: 11 * web-platform-tests/service-workers/cache-storage/window/cache-matchAll.https-expected.txt: 12 * web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt: 13 * web-platform-tests/service-workers/cache-storage/window/cache-storage-match.https-expected.txt: 14 * web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https-expected.txt: 15 1 16 2017-08-21 Andy Estes <aestes@apple.com> 2 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-delete.https-expected.txt
r220917 r220984 3 3 PASS Cache.delete called with a string URL 4 4 PASS Cache.delete called with a Request object 5 FAIL Cache.delete called with a HEAD request assert_equals: Cache.delete should leave non-matching response in the cache. Attributes differ: status. expected 200 but got 0 6 FAIL Cache.delete supports ignoreVary assert_false: Cache.delete should not delete if vary does not match unless ignoreVary is true expected false got true 5 PASS Cache.delete called with a HEAD request 6 PASS Cache.delete supports ignoreVary 7 7 PASS Cache.delete with a non-existent entry 8 FAIL Cache.delete with ignoreSearch option (request with search parameters) assert_equals: undefined : object[0] Attributes differ: status. expected 200 but got 0 9 FAIL Cache.delete with ignoreSearch option (when it is specified as false) assert_equals: undefined : object[0] Attributes differ: status. expected 200 but got 0 8 PASS Cache.delete with ignoreSearch option (request with search parameters) 9 PASS Cache.delete with ignoreSearch option (when it is specified as false) 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-keys.https-expected.txt
r220917 r220984 8 8 PASS Cache.keys with ignoreSearch option (request with search parameters) 9 9 PASS Cache.keys supports ignoreMethod 10 FAIL Cache.keys supports ignoreVary assert_equals: Cache.keys should resolve with an empty array with a mismatched vary. expected 0 but got 1 10 PASS Cache.keys supports ignoreVary 11 11 PASS Cache.keys with URL containing fragment 12 12 PASS Cache.keys with string fragment "http" as query -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-match.https-expected.txt
r220928 r220984 1 1 2 2 PASS Cache.match with no matching entries 3 FAIL Cache.match with URL assert_equals: Cache.match should match by URL. Attributes differ: status. expected 200 but got 0 4 FAIL Cache.match with Request assert_equals: Cache.match should match by Request. Attributes differ: status. expected 200 but got 0 5 FAIL Cache.match with multiple cache hits assert_equals: Cache.match should match the first cache. Attributes differ: status. expected 200 but got 0 6 FAIL Cache.match with new Request assert_equals: Cache.match should match by Request. Attributes differ: status. expected 200 but got 0 3 PASS Cache.match with URL 4 PASS Cache.match with Request 5 PASS Cache.match with multiple cache hits 6 PASS Cache.match with new Request 7 7 PASS Cache.match with HEAD 8 FAIL Cache.match with ignoreSearch option (request with no search parameters) assert_true: Cache.match with ignoreSearch should ignore the search parameters of cached request. expected true got false 9 FAIL Cache.match with ignoreSearch option (request with search parameter) assert_true: Cache.match with ignoreSearch should ignore the search parameters of request. expected true got false 10 FAIL Cache.match supports ignoreMethod assert_equals: Cache.match with ignoreMethod should ignore the method of request. Attributes differ: status. expected 200 but got 0 11 FAIL Cache.match supports ignoreVary assert_equals: Cache.match should resolve as undefined with a mismatched vary. expected (undefined) undefined but got (object) object "[object Response]" 12 FAIL Cache.match with URL containing fragment assert_equals: Cache.match should ignore URL fragment. Attributes differ: status. expected 200 but got 0 8 PASS Cache.match with ignoreSearch option (request with no search parameters) 9 PASS Cache.match with ignoreSearch option (request with search parameter) 10 PASS Cache.match supports ignoreMethod 11 PASS Cache.match supports ignoreVary 12 PASS Cache.match with URL containing fragment 13 13 PASS Cache.match with string fragment "http" as query 14 FAIL Cache.match with responses containing "Vary" header assert_true: Cache.match should honor "Vary" header. expected true got false 14 PASS Cache.match with responses containing "Vary" header 15 15 PASS Cache.match with Request and Response objects with different URLs 16 16 PASS Cache.match invoked multiple times for the same Request/Response 17 17 PASS Cache.match blob should be sliceable 18 18 PASS Cache.match with POST Request 19 FAIL Cache.match with a non-2xx Response assert_equals: Cache.match should return a Response object that has the same properties as a stored non-2xx response. Attributes differ: status. expected 404 but got 0 19 PASS Cache.match with a non-2xx Response 20 20 PASS Cache.match with a network error Response 21 21 PASS Cache produces large Responses that can be cloned and read correctly. -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-matchAll.https-expected.txt
r220917 r220984 1 1 2 2 PASS Cache.matchAll with no matching entries 3 FAIL Cache.matchAll with URL assert_equals: Cache.matchAll should match by URL. : object[0] Attributes differ: status. expected 200 but got 0 4 FAIL Cache.matchAll with Request assert_equals: Cache.matchAll should match by Request. : object[0] Attributes differ: status. expected 200 but got 0 5 FAIL Cache.matchAll with new Request assert_equals: Cache.matchAll should match by Request. : object[0] Attributes differ: status. expected 200 but got 0 3 PASS Cache.matchAll with URL 4 PASS Cache.matchAll with Request 5 PASS Cache.matchAll with new Request 6 6 PASS Cache.matchAll with HEAD 7 FAIL Cache.matchAll with ignoreSearch option (request with no search parameters) assert_equals: Cache.matchAll with ignoreSearch should ignore the search parameters of cached request. : object[0] Attributes differ: status. expected 200 but got 0 8 FAIL Cache.matchAll with ignoreSearch option (request with search parameters) assert_equals: Cache.matchAll with ignoreSearch should ignore the search parameters of request. : object[0] Attributes differ: status. expected 200 but got 0 9 FAIL Cache.matchAll supports ignoreMethod assert_equals: Cache.matchAll with ignoreMethod should ignore the method of request. : object[0] Attributes differ: status. expected 200 but got 0 10 FAIL Cache.matchAll supports ignoreVary assert_equals: Cache.matchAll should resolve as undefined with a mismatched vary. expected 0 but got 1 11 FAIL Cache.matchAll with URL containing fragment assert_equals: Cache.matchAll should ignore URL fragment. : object[0] Attributes differ: status. expected 200 but got 0 7 PASS Cache.matchAll with ignoreSearch option (request with no search parameters) 8 PASS Cache.matchAll with ignoreSearch option (request with search parameters) 9 PASS Cache.matchAll supports ignoreMethod 10 PASS Cache.matchAll supports ignoreVary 11 PASS Cache.matchAll with URL containing fragment 12 12 PASS Cache.matchAll with string fragment "http" as query 13 FAIL Cache.matchAll without parameters assert_equals: Cache.matchAll without parameters should match all entries. : object[0] Attributes differ: status. expected 200 but got 0 14 FAIL Cache.matchAll with responses containing "Vary" header assert_equals: Cache.matchAll should exclude matches if a vary header is missing in the query request, but is present in the cached request. : object[0] Attributes differ: status. expected 200 but got 0 15 FAIL Cache.matchAll with multiple vary pairs assert_equals: Cache.matchAll should support multiple vary request/response pairs. expected 3 but got 1 13 PASS Cache.matchAll without parameters 14 PASS Cache.matchAll with responses containing "Vary" header 15 PASS Cache.matchAll with multiple vary pairs 16 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-put.https-expected.txt
r220928 r220984 4 4 PASS Cache.put with Request without a body 5 5 PASS Cache.put with Response without a body 6 FAIL Cache.put with a Response containing an empty URL assert_equals: Cache.put should update the cache with new Request and Response. Attributes differ: status. expected 200 but got 0 7 FAIL Cache.put with an empty response body assert_equals: Cache.put should store status. expected 200 but got 0 6 PASS Cache.put with a Response containing an empty URL 7 PASS Cache.put with an empty response body 8 8 PASS Cache.put with synthetic 206 response 9 9 PASS Cache.put with HTTP 206 response 10 10 PASS Cache.put with HTTP 500 response 11 FAIL Cache.put called twice with matching Requests and different Responses assert_equals: Cache .put should replace existing response with new response. Attributes differ: status. expected 200 but got 012 FAIL Cache.put called twice with request URLs that differ only by a fragment assert_equals: Cache .put should replace existing response with new response. Attributes differ: status. expected 200 but got 011 FAIL Cache.put called twice with matching Requests and different Responses assert_equals: Cache put should store new response body. expected "New body" but got "Old body" 12 FAIL Cache.put called twice with request URLs that differ only by a fragment assert_equals: Cache put should store new response body. expected "New body" but got "Old body" 13 13 PASS Cache.put with a string request 14 14 PASS Cache.put with an invalid response 15 15 PASS Cache.put with a non-HTTP/HTTPS request 16 FAIL Cache.put with a relative URL assert_equals: Cache.put should accept a relative URL as the request. Attributes differ: status. expected 200 but got 0 16 PASS Cache.put with a relative URL 17 17 PASS Cache.put with a non-GET request 18 18 PASS Cache.put with a null response … … 22 22 PASS Cache.put with a VARY:* Response 23 23 PASS Cache.put with an embedded VARY:* Response 24 FAIL Cache.put should store Response.redirect() correctly assert_equals: Redirect response is reproduced by the Cache API Attributes differ: status. expected 302 but got 0 24 PASS Cache.put should store Response.redirect() correctly 25 25 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-storage-match.https-expected.txt
r220758 r220984 1 1 2 FAIL CacheStorageMatch with no cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 3 FAIL CacheStorageMatch from one of many caches promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 4 FAIL CacheStorageMatch from one of many caches by name promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 5 FAIL CacheStorageMatch a string request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 6 FAIL CacheStorageMatch a HEAD request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 7 FAIL CacheStorageMatch with no cached entry promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 8 FAIL CacheStorageMatch with no caches available but name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 9 FAIL CacheStorageMatch with empty cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 10 FAIL CacheStorageMatch supports ignoreSearch promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 11 FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 12 FAIL CacheStorageMatch supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 2 PASS CacheStorageMatch with no cache name provided 3 PASS CacheStorageMatch from one of many caches 4 PASS CacheStorageMatch from one of many caches by name 5 PASS CacheStorageMatch a string request 6 PASS CacheStorageMatch a HEAD request 7 PASS CacheStorageMatch with no cached entry 8 PASS CacheStorageMatch with no caches available but name provided 9 PASS CacheStorageMatch with empty cache name provided 10 PASS CacheStorageMatch supports ignoreSearch 11 PASS Cache.match supports ignoreMethod 12 PASS CacheStorageMatch supports ignoreVary 13 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https-expected.txt
r220758 r220984 1 1 2 FAIL CacheStorageMatch with no cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 3 FAIL CacheStorageMatch from one of many caches promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 4 FAIL CacheStorageMatch from one of many caches by name promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 5 FAIL CacheStorageMatch a string request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 6 FAIL CacheStorageMatch a HEAD request promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 7 FAIL CacheStorageMatch with no cached entry promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 8 FAIL CacheStorageMatch with no caches available but name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 9 FAIL CacheStorageMatch with empty cache name provided promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 10 FAIL CacheStorageMatch supports ignoreSearch promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 11 FAIL Cache.match supports ignoreMethod promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 12 FAIL CacheStorageMatch supports ignoreVary promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" 2 PASS CacheStorageMatch with no cache name provided 3 PASS CacheStorageMatch from one of many caches 4 PASS CacheStorageMatch from one of many caches by name 5 PASS CacheStorageMatch a string request 6 PASS CacheStorageMatch a HEAD request 7 PASS CacheStorageMatch with no cached entry 8 PASS CacheStorageMatch with no caches available but name provided 9 PASS CacheStorageMatch with empty cache name provided 10 PASS CacheStorageMatch supports ignoreSearch 11 PASS Cache.match supports ignoreMethod 12 PASS CacheStorageMatch supports ignoreVary 13 13 -
trunk/Source/WebCore/ChangeLog
r220983 r220984 1 2017-08-21 Youenn Fablet <youenn@apple.com> 2 3 [Cache API] Add support for CacheStorage.match 4 https://bugs.webkit.org/show_bug.cgi?id=175747 5 6 Reviewed by Chris Dumez. 7 8 Covered by rebased tests. 9 10 Introducing Cache::doMatch so that CacheStorage can use it. 11 Make Cache::match use Cache::doMatch as well. 12 13 Implementing CacheStorage.match as per spec: 14 - If name is provided, query only the cache with the given name. 15 - Otherwise pick the first matching response in the caches. 16 The sequential asynchronous search is done in doSequentialMatch. 17 18 Making sure that response with a status code are returning false to isNull. 19 This allows passing more tests. 20 21 * Modules/cache/Cache.cpp: 22 (WebCore::Cache::match): 23 (WebCore::Cache::doMatch): 24 (WebCore::Cache::matchAll): 25 (WebCore::toConnectionRecord): 26 * Modules/cache/Cache.h: 27 * Modules/cache/CacheStorage.cpp: 28 (WebCore::doSequentialMatch): 29 (WebCore::copyCaches): 30 (WebCore::CacheStorage::match): 31 * platform/network/ResourceResponseBase.cpp: 32 (WebCore::ResourceResponseBase::setHTTPStatusCode): 33 1 34 2017-08-21 Dean Jackson <dino@apple.com> 2 35 -
trunk/Source/WebCore/Modules/cache/Cache.cpp
r220948 r220984 52 52 void Cache::match(RequestInfo&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise) 53 53 { 54 doMatch(WTFMove(info), WTFMove(options), WTFMove(promise), MatchType::OnlyFirst); 55 } 56 57 void Cache::matchAll(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise) 58 { 59 doMatch(WTFMove(info), WTFMove(options), WTFMove(promise), MatchType::All); 60 } 61 62 void Cache::doMatch(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise, MatchType matchType) 54 doMatch(WTFMove(info), WTFMove(options), [promise = WTFMove(promise)](FetchResponse* result) mutable { 55 if (!result) { 56 promise->resolve(); 57 return; 58 } 59 promise->resolve<IDLInterface<FetchResponse>>(*result); 60 }); 61 } 62 63 void Cache::doMatch(RequestInfo&& info, CacheQueryOptions&& options, MatchCallback&& callback) 64 { 65 RefPtr<FetchRequest> request; 66 if (WTF::holds_alternative<RefPtr<FetchRequest>>(info)) { 67 request = WTF::get<RefPtr<FetchRequest>>(info).releaseNonNull(); 68 if (request->method() != "GET" && !options.ignoreMethod) { 69 callback(nullptr); 70 return; 71 } 72 } else { 73 if (UNLIKELY(!scriptExecutionContext())) 74 return; 75 request = FetchRequest::create(*scriptExecutionContext(), WTFMove(info), { }).releaseReturnValue(); 76 } 77 78 queryCache(request.releaseNonNull(), WTFMove(options), [callback = WTFMove(callback)](const Vector<CacheStorageRecord>& records) mutable { 79 if (records.isEmpty()) { 80 callback(nullptr); 81 return; 82 } 83 callback(records[0].response->cloneForJS().ptr()); 84 }); 85 } 86 87 void Cache::matchAll(std::optional<RequestInfo>&& info, CacheQueryOptions&& options, MatchAllPromise&& promise) 63 88 { 64 89 RefPtr<FetchRequest> request; … … 67 92 request = WTF::get<RefPtr<FetchRequest>>(info.value()).releaseNonNull(); 68 93 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>> { }); 94 promise.resolve({ }); 74 95 return; 75 96 } … … 82 103 83 104 if (!request) { 84 ASSERT(matchType == MatchType::All); 85 retrieveRecords([this, promise = WTFMove(promise)]() { 105 retrieveRecords([this, promise = WTFMove(promise)]() mutable { 86 106 Vector<Ref<FetchResponse>> responses; 87 107 responses.reserveInitialCapacity(m_records.size()); 88 108 for (auto& record : m_records) 89 109 responses.uncheckedAppend(record.response->cloneForJS()); 90 promise ->resolve<IDLSequence<IDLInterface<FetchResponse>>>(responses);110 promise.resolve(responses); 91 111 }); 92 112 return; 93 113 } 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 114 queryCache(request.releaseNonNull(), WTFMove(options), [promise = WTFMove(promise)](const Vector<CacheStorageRecord>& records) mutable { 104 115 Vector<Ref<FetchResponse>> responses; 105 116 responses.reserveInitialCapacity(records.size()); 106 117 for (auto& record : records) 107 118 responses.uncheckedAppend(record.response->cloneForJS()); 108 promise ->resolve<IDLSequence<IDLInterface<FetchResponse>>>(responses);119 promise.resolve(responses); 109 120 }); 110 121 } … … 306 317 cachedRequest.setHTTPHeaderFields(request.headers().internalHeaders()); 307 318 319 ASSERT(!cachedRequest.isNull()); 320 ASSERT(!cachedResponse.isNull()); 321 308 322 return { 0, 309 323 request.headers().guard(), WTFMove(cachedRequest), request.fetchOptions(), request.internalRequestReferrer(), -
trunk/Source/WebCore/Modules/cache/Cache.h
r220948 r220984 44 44 45 45 void match(RequestInfo&&, CacheQueryOptions&&, Ref<DeferredPromise>&&); 46 void matchAll(std::optional<RequestInfo>&&, CacheQueryOptions&&, Ref<DeferredPromise>&&); 46 47 using MatchAllPromise = DOMPromiseDeferred<IDLSequence<IDLInterface<FetchResponse>>>; 48 void matchAll(std::optional<RequestInfo>&&, CacheQueryOptions&&, MatchAllPromise&&); 47 49 void add(RequestInfo&&, DOMPromiseDeferred<void>&&); 48 50 … … 55 57 uint64_t identifier() const { return m_identifier; } 56 58 59 using MatchCallback = WTF::Function<void(FetchResponse*)>; 60 void doMatch(RequestInfo&&, CacheQueryOptions&&, MatchCallback&&); 61 57 62 private: 58 63 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 64 63 65 // ActiveDOMObject -
trunk/Source/WebCore/Modules/cache/CacheStorage.cpp
r220863 r220984 29 29 #include "CacheQueryOptions.h" 30 30 #include "JSCache.h" 31 #include "JSFetchResponse.h" 31 32 #include "ScriptExecutionContext.h" 32 33 … … 47 48 } 48 49 49 void CacheStorage::match(Cache::RequestInfo&&, CacheQueryOptions&&, Ref<DeferredPromise>&& promise) 50 { 51 promise->reject(Exception { NotSupportedError, ASCIILiteral("Not implemented")}); 50 static void doSequentialMatch(size_t index, Vector<Ref<Cache>>&& caches, Cache::RequestInfo&& info, CacheQueryOptions&& options, Cache::MatchCallback&& completionHandler) 51 { 52 if (index >= caches.size()) { 53 completionHandler(nullptr); 54 return; 55 } 56 57 caches[index]->doMatch(WTFMove(info), WTFMove(options), [caches = WTFMove(caches), info, options, completionHandler = WTFMove(completionHandler), index](FetchResponse* value) mutable { 58 if (value) { 59 completionHandler(value); 60 return; 61 } 62 doSequentialMatch(++index, WTFMove(caches), WTFMove(info), WTFMove(options), WTFMove(completionHandler)); 63 }); 64 } 65 66 static inline void startSequentialMatch(Vector<Ref<Cache>>&& caches, Cache::RequestInfo&& info, CacheQueryOptions&& options, Cache::MatchCallback&& completionHandler) 67 { 68 doSequentialMatch(0, WTFMove(caches), WTFMove(info), WTFMove(options), WTFMove(completionHandler)); 69 } 70 71 static inline Vector<Ref<Cache>> copyCaches(const Vector<Ref<Cache>>& caches) 72 { 73 Vector<Ref<Cache>> copy; 74 copy.reserveInitialCapacity(caches.size()); 75 for (auto& cache : caches) 76 copy.uncheckedAppend(cache.copyRef()); 77 return copy; 78 } 79 80 void CacheStorage::match(Cache::RequestInfo&& info, CacheQueryOptions&& options, Ref<DeferredPromise>&& promise) 81 { 82 retrieveCaches([this, info = WTFMove(info), options = WTFMove(options), promise = WTFMove(promise)]() mutable { 83 if (!options.cacheName.isNull()) { 84 auto position = m_caches.findMatching([&](auto& item) { return item->name() == options.cacheName; }); 85 if (position != notFound) { 86 m_caches[position]->match(WTFMove(info), WTFMove(options), WTFMove(promise)); 87 return; 88 } 89 promise->resolve(); 90 return; 91 } 92 93 setPendingActivity(this); 94 startSequentialMatch(copyCaches(m_caches), WTFMove(info), WTFMove(options), [this, promise = WTFMove(promise)](FetchResponse* result) mutable { 95 if (!m_isStopped) { 96 if (!result) 97 promise->resolve(); 98 else 99 promise->resolve<IDLInterface<FetchResponse>>(*result); 100 } 101 unsetPendingActivity(this); 102 }); 103 }); 52 104 } 53 105 -
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
r220764 r220984 282 282 283 283 m_httpStatusCode = statusCode; 284 m_isNull = false; 284 285 285 286 // FIXME: Should invalidate or update platform response if present.
Note: See TracChangeset
for help on using the changeset viewer.