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 "modules/cachestorage/Cache.h" | 5 #include "modules/cachestorage/Cache.h" |
6 | 6 |
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 barrierCallback->onSuccess(i, batchOperation); | 595 barrierCallback->onSuccess(i, batchOperation); |
596 } | 596 } |
597 | 597 |
598 return promise; | 598 return promise; |
599 } | 599 } |
600 | 600 |
601 ScriptPromise Cache::keysImpl(ScriptState* scriptState) | 601 ScriptPromise Cache::keysImpl(ScriptState* scriptState) |
602 { | 602 { |
603 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 603 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
604 const ScriptPromise promise = resolver->promise(); | 604 const ScriptPromise promise = resolver->promise(); |
605 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, WebSer
viceWorkerCache::QueryParams()); | 605 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), WebServic
eWorkerRequest(), WebServiceWorkerCache::QueryParams()); |
606 return promise; | 606 return promise; |
607 } | 607 } |
608 | 608 |
609 ScriptPromise Cache::keysImpl(ScriptState* scriptState, const Request* request,
const CacheQueryOptions& options) | 609 ScriptPromise Cache::keysImpl(ScriptState* scriptState, const Request* request,
const CacheQueryOptions& options) |
610 { | 610 { |
611 WebServiceWorkerRequest webRequest; | 611 WebServiceWorkerRequest webRequest; |
612 request->populateWebServiceWorkerRequest(webRequest); | 612 request->populateWebServiceWorkerRequest(webRequest); |
613 checkCacheQueryOptions(options, scriptState->executionContext()); | 613 checkCacheQueryOptions(options, scriptState->executionContext()); |
614 | 614 |
615 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 615 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
616 const ScriptPromise promise = resolver->promise(); | 616 const ScriptPromise promise = resolver->promise(); |
617 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, toWebQ
ueryParams(options)); | 617 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), webReques
t, toWebQueryParams(options)); |
618 return promise; | 618 return promise; |
619 } | 619 } |
620 | 620 |
621 WebServiceWorkerCache* Cache::webCache() const | 621 WebServiceWorkerCache* Cache::webCache() const |
622 { | 622 { |
623 return m_webCache.get(); | 623 return m_webCache.get(); |
624 } | 624 } |
625 | 625 |
626 } // namespace blink | 626 } // namespace blink |
OLD | NEW |