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

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: Created 4 years, 9 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698