Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Side by Side Diff: third_party/WebKit/Source/modules/cachestorage/Cache.cpp

Issue 1719103002: CacheStorage: Expand cache.keys() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 barrierCallback->onSuccess(i, batchOperation); 597 barrierCallback->onSuccess(i, batchOperation);
598 } 598 }
599 599
600 return promise; 600 return promise;
601 } 601 }
602 602
603 ScriptPromise Cache::keysImpl(ScriptState* scriptState) 603 ScriptPromise Cache::keysImpl(ScriptState* scriptState)
604 { 604 {
605 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 605 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
606 const ScriptPromise promise = resolver->promise(); 606 const ScriptPromise promise = resolver->promise();
607 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, WebSer viceWorkerCache::QueryParams()); 607 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), WebServic eWorkerRequest(), WebServiceWorkerCache::QueryParams());
608 return promise; 608 return promise;
609 } 609 }
610 610
611 ScriptPromise Cache::keysImpl(ScriptState* scriptState, const Request* request, const CacheQueryOptions& options) 611 ScriptPromise Cache::keysImpl(ScriptState* scriptState, const Request* request, const CacheQueryOptions& options)
612 { 612 {
613 WebServiceWorkerRequest webRequest; 613 WebServiceWorkerRequest webRequest;
614 request->populateWebServiceWorkerRequest(webRequest); 614 request->populateWebServiceWorkerRequest(webRequest);
615 checkCacheQueryOptions(options, scriptState->getExecutionContext()); 615 checkCacheQueryOptions(options, scriptState->getExecutionContext());
616 616
617 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 617 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
618 const ScriptPromise promise = resolver->promise(); 618 const ScriptPromise promise = resolver->promise();
619 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, toWebQ ueryParams(options)); 619 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), webReques t, toWebQueryParams(options));
620 return promise; 620 return promise;
621 } 621 }
622 622
623 WebServiceWorkerCache* Cache::webCache() const 623 WebServiceWorkerCache* Cache::webCache() const
624 { 624 {
625 return m_webCache.get(); 625 return m_webCache.get();
626 } 626 }
627 627
628 } // namespace blink 628 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698