Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/serviceworkers/Cache.h" | 6 #include "modules/serviceworkers/Cache.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| 11 #include "bindings/core/v8/V8ThrowException.h" | |
| 12 #include "core/dom/DOMException.h" | |
| 13 #include "modules/serviceworkers/Request.h" | |
| 14 #include "modules/serviceworkers/Response.h" | |
| 15 #include "public/platform/WebServiceWorkerCache.h" | |
| 10 | 16 |
| 11 namespace blink { | 17 namespace blink { |
| 12 | 18 |
| 13 namespace { | 19 namespace { |
| 14 | 20 |
| 21 WebServiceWorkerCache::QueryParams queryParamsFromDictionary(const Dictionary& d ictionary) | |
| 22 { | |
| 23 WebServiceWorkerCache::QueryParams queryParams; | |
| 24 DictionaryHelper::get(dictionary, "ignoreSearch", queryParams.ignoreSearch); | |
| 25 DictionaryHelper::get(dictionary, "ignoreMethod", queryParams.ignoreMethod); | |
| 26 DictionaryHelper::get(dictionary, "ignoreVary", queryParams.ignoreVary); | |
| 27 DictionaryHelper::get(dictionary, "prefixMatch", queryParams.prefixMatch); | |
| 28 { | |
| 29 String cacheName; | |
| 30 DictionaryHelper::get(dictionary, "cacheName", cacheName); | |
| 31 queryParams.cacheName = cacheName; | |
| 32 } | |
| 33 return queryParams; | |
| 34 } | |
| 35 | |
| 36 class CacheMatchCallbacks : public WebServiceWorkerCache::CacheMatchCallbacks { | |
| 37 WTF_MAKE_NONCOPYABLE(CacheMatchCallbacks); | |
| 38 public: | |
| 39 CacheMatchCallbacks(PassRefPtr<ScriptPromiseResolver> resolver) | |
| 40 : m_resolver(resolver) { } | |
| 41 | |
| 42 virtual void onSuccess(WebServiceWorkerResponse* webResponse) OVERRIDE | |
| 43 { | |
| 44 m_resolver->resolve(Response::create(m_resolver->scriptState()->executio nContext(), *webResponse)); | |
| 45 m_resolver.clear(); | |
| 46 } | |
| 47 | |
| 48 virtual void onError(WebServiceWorkerCacheError* reason) OVERRIDE | |
| 49 { | |
| 50 m_resolver->reject(Cache::domExceptionForCacheError(*reason)); | |
| 51 m_resolver.clear(); | |
| 52 } | |
| 53 | |
| 54 private: | |
| 55 RefPtr<ScriptPromiseResolver> m_resolver; | |
| 56 }; | |
| 57 | |
| 58 class CacheWithResponsesCallbacks : public WebServiceWorkerCache::CacheWithRespo nsesCallbacks { | |
| 59 WTF_MAKE_NONCOPYABLE(CacheWithResponsesCallbacks); | |
| 60 public: | |
| 61 CacheWithResponsesCallbacks(PassRefPtr<ScriptPromiseResolver> resolver) | |
| 62 : m_resolver(resolver) { } | |
| 63 | |
| 64 virtual void onSuccess(WebVector<WebServiceWorkerResponse>* webResponses) OV ERRIDE | |
| 65 { | |
| 66 Vector<Response*> responses; | |
| 67 for (size_t i = 0; i < webResponses->size(); ++i) | |
| 68 responses.append(Response::create(m_resolver->scriptState()->executi onContext(), (*webResponses)[i])); | |
| 69 m_resolver->resolve(responses); | |
| 70 m_resolver.clear(); | |
| 71 } | |
| 72 | |
| 73 virtual void onError(WebServiceWorkerCacheError* reason) OVERRIDE | |
| 74 { | |
| 75 m_resolver->reject(Cache::domExceptionForCacheError(*reason)); | |
| 76 m_resolver.clear(); | |
| 77 } | |
| 78 | |
| 79 private: | |
| 80 RefPtr<ScriptPromiseResolver> m_resolver; | |
| 81 }; | |
| 82 | |
| 83 class CacheWithRequestsCallbacks : public WebServiceWorkerCache::CacheWithReques tsCallbacks { | |
| 84 WTF_MAKE_NONCOPYABLE(CacheWithRequestsCallbacks); | |
| 85 public: | |
| 86 CacheWithRequestsCallbacks(PassRefPtr<ScriptPromiseResolver> resolver) | |
| 87 : m_resolver(resolver) { } | |
| 88 | |
| 89 virtual void onSuccess(WebVector<WebServiceWorkerRequest>* webRequests) OVER RIDE | |
| 90 { | |
| 91 Vector<Request*> requests; | |
| 92 for (size_t i = 0; i < webRequests->size(); ++i) | |
| 93 requests.append(Request::create(m_resolver->scriptState()->execution Context(), (*webRequests)[i])); | |
| 94 m_resolver->resolve(requests); | |
| 95 m_resolver.clear(); | |
| 96 } | |
| 97 | |
| 98 virtual void onError(WebServiceWorkerCacheError* reason) OVERRIDE | |
| 99 { | |
| 100 m_resolver->reject(Cache::domExceptionForCacheError(*reason)); | |
| 101 m_resolver.clear(); | |
| 102 } | |
| 103 | |
| 104 private: | |
| 105 RefPtr<ScriptPromiseResolver> m_resolver; | |
| 106 }; | |
| 107 | |
| 108 ScriptPromise rejectForCacheError(ScriptState* scriptState, WebServiceWorkerCach eError error) | |
| 109 { | |
| 110 return ScriptPromise::rejectWithDOMException(scriptState, Cache::domExceptio nForCacheError(error)); | |
| 111 } | |
| 112 | |
| 15 ScriptPromise rejectAsNotImplemented(ScriptState* scriptState) | 113 ScriptPromise rejectAsNotImplemented(ScriptState* scriptState) |
| 16 { | 114 { |
| 115 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::crea te(NotSupportedError, "Cache is not implemented")); | |
| 116 } | |
| 117 | |
| 118 } // namespace | |
| 119 | |
| 120 Cache* Cache::fromWebServiceWorkerCache(WebServiceWorkerCache* webCache) | |
| 121 { | |
| 122 if (Cache* cache = static_cast<Cache*>(webCache->proxyInterface())) | |
| 123 return cache; | |
| 124 return new Cache(webCache); | |
| 125 } | |
| 126 | |
| 127 ScriptPromise Cache::match(ScriptState* scriptState, Request* originalRequest, c onst Dictionary& queryParamsDict) | |
| 128 { | |
| 129 TrackExceptionState exceptionState; | |
| 130 Request* request = Request::create(scriptState->executionContext(), original Request, exceptionState); | |
|
dominicc (has gone to gerrit)
2014/09/17 12:53:58
Why does this one have this V8 exception stuff her
gavinp
2014/09/17 15:41:52
These should be rethrown. NotFound is arbitrary; i
jsbell
2014/09/18 21:45:00
The alternate approach I suggested back in #c15 -
| |
| 131 if (exceptionState.hadException()) | |
| 132 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 133 return matchImpl(scriptState, request, queryParamsDict); | |
| 134 } | |
| 135 | |
| 136 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString , const Dictionary& queryParamsDict) | |
| 137 { | |
| 138 TrackExceptionState exceptionState; | |
| 139 Request* request = Request::create(scriptState->executionContext(), requestS tring, exceptionState); | |
| 140 if (exceptionState.hadException()) | |
| 141 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 142 return matchImpl(scriptState, request, queryParamsDict); | |
| 143 } | |
| 144 | |
| 145 ScriptPromise Cache::matchAll(ScriptState* scriptState, Request* originalRequest , const Dictionary& queryParamsDict) | |
| 146 { | |
| 147 TrackExceptionState exceptionState; | |
| 148 Request* request = Request::create(scriptState->executionContext(), original Request, exceptionState); | |
| 149 if (exceptionState.hadException()) | |
| 150 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 151 return matchAllImpl(scriptState, request, queryParamsDict); | |
| 152 } | |
| 153 | |
| 154 ScriptPromise Cache::matchAll(ScriptState* scriptState, const String& requestStr ing, const Dictionary& queryParamsDict) | |
| 155 { | |
| 156 TrackExceptionState exceptionState; | |
| 157 Request* request = Request::create(scriptState->executionContext(), requestS tring, exceptionState); | |
| 158 if (exceptionState.hadException()) | |
| 159 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 160 return matchAllImpl(scriptState, request, queryParamsDict); | |
| 161 } | |
| 162 | |
| 163 ScriptPromise Cache::add(ScriptState* scriptState, Request* originalRequest) | |
| 164 { | |
| 165 TrackExceptionState exceptionState; | |
| 166 Request* request = Request::create(scriptState->executionContext(), original Request, exceptionState); | |
| 167 if (exceptionState.hadException()) | |
| 168 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 169 return addImpl(scriptState, request); | |
| 170 } | |
| 171 | |
| 172 ScriptPromise Cache::add(ScriptState* scriptState, const String& requestString) | |
| 173 { | |
| 174 TrackExceptionState exceptionState; | |
| 175 Request* request = Request::create(scriptState->executionContext(), requestS tring, exceptionState); | |
| 176 if (exceptionState.hadException()) | |
| 177 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 178 return addImpl(scriptState, request); | |
| 179 } | |
| 180 | |
| 181 ScriptPromise Cache::addAll(ScriptState* scriptState, const Vector<ScriptValue>& rawRequests) | |
| 182 { | |
| 183 // FIXME: Implement this. | |
| 184 return rejectAsNotImplemented(scriptState); | |
| 185 } | |
| 186 | |
| 187 ScriptPromise Cache::deleteFunction(ScriptState* scriptState, Request* originalR equest, const Dictionary& queryParamsDict) | |
| 188 { | |
| 189 TrackExceptionState exceptionState; | |
| 190 Request* request = Request::create(scriptState->executionContext(), original Request, exceptionState); | |
| 191 if (exceptionState.hadException()) | |
| 192 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 193 return deleteImpl(scriptState, request, queryParamsDict); | |
| 194 } | |
| 195 | |
| 196 ScriptPromise Cache::deleteFunction(ScriptState* scriptState, const String& requ estString, const Dictionary& queryParamsDict) | |
| 197 { | |
| 198 TrackExceptionState exceptionState; | |
| 199 Request* request = Request::create(scriptState->executionContext(), requestS tring, exceptionState); | |
| 200 if (exceptionState.hadException()) | |
| 201 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 202 return deleteImpl(scriptState, request, queryParamsDict); | |
| 203 } | |
| 204 | |
| 205 ScriptPromise Cache::put(ScriptState* scriptState, Request* originalRequest, con st Response* response) | |
| 206 { | |
| 207 TrackExceptionState exceptionState; | |
| 208 Request* request = Request::create(scriptState->executionContext(), original Request, exceptionState); | |
| 209 if (exceptionState.hadException()) | |
| 210 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 211 return putImpl(scriptState, request, response); | |
| 212 } | |
| 213 | |
| 214 ScriptPromise Cache::put(ScriptState* scriptState, const String& requestString, const Response* response) | |
| 215 { | |
| 216 TrackExceptionState exceptionState; | |
| 217 Request* request = Request::create(scriptState->executionContext(), requestS tring, exceptionState); | |
| 218 if (exceptionState.hadException()) | |
| 219 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 220 return putImpl(scriptState, request, response); | |
| 221 } | |
| 222 | |
| 223 ScriptPromise Cache::keys(ScriptState* scriptState) | |
| 224 { | |
| 225 return keysImpl(scriptState); | |
| 226 } | |
| 227 | |
| 228 ScriptPromise Cache::keys(ScriptState* scriptState, Request* originalRequest, co nst Dictionary& queryParamsDict) | |
| 229 { | |
| 230 TrackExceptionState exceptionState; | |
| 231 Request* request = Request::create(scriptState->executionContext(), original Request, exceptionState); | |
| 232 if (exceptionState.hadException()) | |
| 233 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 234 return keysImpl(scriptState, request, queryParamsDict); | |
| 235 } | |
| 236 | |
| 237 ScriptPromise Cache::keys(ScriptState* scriptState, const String& requestString, const Dictionary& queryParamsDict) | |
| 238 { | |
| 239 TrackExceptionState exceptionState; | |
| 240 Request* request = Request::create(scriptState->executionContext(), requestS tring, exceptionState); | |
| 241 if (exceptionState.hadException()) | |
| 242 return rejectForCacheError(scriptState, WebServiceWorkerCacheErrorNotFou nd); | |
| 243 return keysImpl(scriptState, request, queryParamsDict); | |
| 244 } | |
| 245 | |
| 246 Cache::Cache(WebServiceWorkerCache* webCache) | |
| 247 : m_webCache(adoptPtr(webCache)) | |
| 248 { | |
| 249 ASSERT(!m_webCache->proxyInterface()); | |
| 250 m_webCache->setProxyInterface(this); | |
| 251 } | |
| 252 | |
| 253 Cache* Cache::create(WebServiceWorkerCache* webCache) | |
| 254 { | |
| 255 return new Cache(webCache); | |
| 256 } | |
| 257 | |
| 258 ScriptPromise Cache::matchImpl(ScriptState* scriptState, Request* request, const Dictionary& queryParamsDict) | |
| 259 { | |
| 260 WebServiceWorkerRequest webRequest; | |
| 261 request->populateWebServiceWorkerRequest(webRequest); | |
| 262 | |
| 17 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); | 263 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); |
| 18 const ScriptPromise promise = resolver->promise(); | 264 const ScriptPromise promise = resolver->promise(); |
| 19 resolver->reject(DOMException::create(NotSupportedError, "Cache is not imple mented")); | 265 m_webCache->dispatchMatch(new CacheMatchCallbacks(resolver), webRequest, que ryParamsFromDictionary(queryParamsDict)); |
| 20 return promise; | 266 return promise; |
| 21 } | 267 } |
| 22 | 268 |
| 23 } | 269 ScriptPromise Cache::matchAllImpl(ScriptState* scriptState, Request* request, co nst Dictionary& queryParamsDict) |
| 24 | 270 { |
| 25 Cache* Cache::fromWebServiceWorkerCache(WebServiceWorkerCache* webCache) | 271 WebServiceWorkerRequest webRequest; |
| 26 { | 272 request->populateWebServiceWorkerRequest(webRequest); |
| 27 return new Cache(webCache); | 273 |
| 28 } | 274 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); |
| 29 | 275 const ScriptPromise promise = resolver->promise(); |
| 30 // FIXME: Implement these methods. | 276 m_webCache->dispatchMatchAll(new CacheWithResponsesCallbacks(resolver), webR equest, queryParamsFromDictionary(queryParamsDict)); |
| 31 ScriptPromise Cache::match(ScriptState* scriptState, Request* request, const Dic tionary& queryParams) | 277 return promise; |
| 32 { | 278 } |
| 279 | |
| 280 ScriptPromise Cache::addImpl(ScriptState* scriptState, Request*) | |
| 281 { | |
| 282 // FIXME: Implement this. | |
| 33 return rejectAsNotImplemented(scriptState); | 283 return rejectAsNotImplemented(scriptState); |
| 34 } | 284 } |
| 35 | 285 |
| 36 ScriptPromise Cache::match(ScriptState* scriptState, const String& requestString , const Dictionary& queryParams) | 286 ScriptPromise Cache::addAllImpl(ScriptState* scriptState, Vector<Request*>) |
| 37 { | 287 { |
| 288 // FIXME: Implement this. | |
| 38 return rejectAsNotImplemented(scriptState); | 289 return rejectAsNotImplemented(scriptState); |
| 39 } | 290 } |
| 40 | 291 |
| 41 ScriptPromise Cache::matchAll(ScriptState* scriptState, Request* request, const Dictionary& queryParams) | |
| 42 { | |
| 43 return rejectAsNotImplemented(scriptState); | |
| 44 } | |
| 45 | |
| 46 ScriptPromise Cache::matchAll(ScriptState* scriptState, const String& requestStr ing, const Dictionary& queryParams) | |
| 47 { | |
| 48 return rejectAsNotImplemented(scriptState); | |
| 49 } | |
| 50 | |
| 51 ScriptPromise Cache::add(ScriptState* scriptState, Request* request) | |
| 52 { | |
| 53 return rejectAsNotImplemented(scriptState); | |
| 54 } | |
| 55 | |
| 56 ScriptPromise Cache::add(ScriptState* scriptState, const String& requestString) | |
| 57 { | |
| 58 return rejectAsNotImplemented(scriptState); | |
| 59 } | |
| 60 | |
| 61 ScriptPromise Cache::addAll(ScriptState* scriptState, const Vector<ScriptValue>& rawRequests) | |
| 62 { | |
| 63 return rejectAsNotImplemented(scriptState); | |
| 64 } | |
| 65 | |
| 66 ScriptPromise Cache::deleteFunction(ScriptState* scriptState, Request* request, const Dictionary& queryParams) | |
| 67 { | |
| 68 return rejectAsNotImplemented(scriptState); | |
| 69 } | |
| 70 | |
| 71 ScriptPromise Cache::deleteFunction(ScriptState* scriptState, const String& requ estString, const Dictionary& queryParams) | |
| 72 { | |
| 73 return rejectAsNotImplemented(scriptState); | |
| 74 } | |
| 75 | |
| 76 ScriptPromise Cache::put(ScriptState* scriptState, Request* request, Response*) | |
| 77 { | |
| 78 return rejectAsNotImplemented(scriptState); | |
| 79 } | |
| 80 | |
| 81 ScriptPromise Cache::put(ScriptState* scriptState, const String& requestString, Response*) | |
| 82 { | |
| 83 return rejectAsNotImplemented(scriptState); | |
| 84 } | |
| 85 | |
| 86 ScriptPromise Cache::keys(ScriptState* scriptState) | |
| 87 { | |
| 88 return rejectAsNotImplemented(scriptState); | |
| 89 } | |
| 90 | |
| 91 ScriptPromise Cache::keys(ScriptState* scriptState, Request* request, const Dict ionary& queryParams) | |
| 92 { | |
| 93 return rejectAsNotImplemented(scriptState); | |
| 94 } | |
| 95 | |
| 96 ScriptPromise Cache::keys(ScriptState* scriptState, const String& requestString, const Dictionary& queryParams) | |
| 97 { | |
| 98 return rejectAsNotImplemented(scriptState); | |
| 99 } | |
| 100 | |
| 101 PassRefPtrWillBeRawPtr<DOMException> Cache::domExceptionForCacheError(WebService WorkerCacheError reason) | 292 PassRefPtrWillBeRawPtr<DOMException> Cache::domExceptionForCacheError(WebService WorkerCacheError reason) |
| 102 { | 293 { |
| 103 switch (reason) { | 294 switch (reason) { |
| 104 case WebServiceWorkerCacheErrorNotImplemented: | 295 case WebServiceWorkerCacheErrorNotImplemented: |
| 105 return DOMException::create(NotSupportedError, "Method is not implemente d."); | 296 return DOMException::create(NotSupportedError, "Method is not implemente d."); |
| 106 case WebServiceWorkerCacheErrorNotFound: | 297 case WebServiceWorkerCacheErrorNotFound: |
| 107 return DOMException::create(NotFoundError, "Entry was not found."); | 298 return DOMException::create(NotFoundError, "Entry was not found."); |
| 108 case WebServiceWorkerCacheErrorExists: | 299 case WebServiceWorkerCacheErrorExists: |
| 109 return DOMException::create(InvalidAccessError, "Entry already exists.") ; | 300 return DOMException::create(InvalidAccessError, "Entry already exists.") ; |
| 110 default: | 301 default: |
| 111 ASSERT_NOT_REACHED(); | 302 ASSERT_NOT_REACHED(); |
| 112 return DOMException::create(NotSupportedError, "Unknown error."); | 303 return DOMException::create(NotSupportedError, "Unknown error."); |
| 113 } | 304 } |
| 114 } | 305 } |
| 115 | 306 |
| 116 Cache::Cache(WebServiceWorkerCache* webCache) : m_webCache(webCache) | 307 ScriptPromise Cache::deleteImpl(ScriptState* scriptState, Request* request, cons t Dictionary& queryParamsDict) |
| 117 { | 308 { |
| 309 WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1)); | |
| 310 batchOperations[0].operationType = WebServiceWorkerCache::WebServiceWorkerCa cheOperationTypeDelete; | |
| 311 request->populateWebServiceWorkerRequest(batchOperations[0].request); | |
| 312 batchOperations[0].matchParams = queryParamsFromDictionary(queryParamsDict); | |
| 313 | |
| 314 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); | |
| 315 const ScriptPromise promise = resolver->promise(); | |
| 316 m_webCache->dispatchBatch(new CacheWithResponsesCallbacks(resolver), batchOp erations); | |
| 317 return promise; | |
| 318 } | |
| 319 | |
| 320 ScriptPromise Cache::putImpl(ScriptState* scriptState, Request* request, const R esponse* response) | |
| 321 { | |
| 322 WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1)); | |
| 323 batchOperations[0].operationType = WebServiceWorkerCache::WebServiceWorkerCa cheOperationTypePut; | |
| 324 request->populateWebServiceWorkerRequest(batchOperations[0].request); | |
| 325 response->populateWebServiceWorkerResponse(batchOperations[0].response); | |
| 326 | |
| 327 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); | |
| 328 const ScriptPromise promise = resolver->promise(); | |
| 329 m_webCache->dispatchBatch(new CacheWithResponsesCallbacks(resolver), batchOp erations); | |
| 330 return promise; | |
| 331 } | |
| 332 | |
| 333 ScriptPromise Cache::keysImpl(ScriptState* scriptState) | |
| 334 { | |
| 335 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); | |
| 336 const ScriptPromise promise = resolver->promise(); | |
| 337 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, WebSer viceWorkerCache::QueryParams()); | |
| 338 return promise; | |
| 339 } | |
| 340 | |
| 341 ScriptPromise Cache::keysImpl(ScriptState* scriptState, Request* request, const Dictionary& queryParamsDict) | |
| 342 { | |
| 343 WebServiceWorkerRequest webRequest; | |
| 344 request->populateWebServiceWorkerRequest(webRequest); | |
| 345 | |
| 346 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); | |
| 347 const ScriptPromise promise = resolver->promise(); | |
| 348 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, queryP aramsFromDictionary(queryParamsDict)); | |
| 349 return promise; | |
| 118 } | 350 } |
| 119 | 351 |
| 120 } // namespace blink | 352 } // namespace blink |
| OLD | NEW |