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

Side by Side Diff: third_party/WebKit/Source/modules/cachestorage/InspectorCacheStorageAgent.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/InspectorCacheStorageAgent.h" 5 #include "modules/cachestorage/InspectorCacheStorageAgent.h"
6 6
7 #include "platform/heap/Handle.h" 7 #include "platform/heap/Handle.h"
8 #include "platform/inspector_protocol/DispatcherBase.h" 8 #include "platform/inspector_protocol/DispatcherBase.h"
9 #include "platform/inspector_protocol/Values.h" 9 #include "platform/inspector_protocol/Values.h"
10 #include "platform/weborigin/KURL.h" 10 #include "platform/weborigin/KURL.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 GetCacheForRequestData(const DataRequestParams& params, std::unique_ptr<Requ estEntriesCallback> callback) 292 GetCacheForRequestData(const DataRequestParams& params, std::unique_ptr<Requ estEntriesCallback> callback)
293 : m_params(params) 293 : m_params(params)
294 , m_callback(std::move(callback)) 294 , m_callback(std::move(callback))
295 { 295 {
296 } 296 }
297 ~GetCacheForRequestData() override { } 297 ~GetCacheForRequestData() override { }
298 298
299 void onSuccess(std::unique_ptr<WebServiceWorkerCache> cache) override 299 void onSuccess(std::unique_ptr<WebServiceWorkerCache> cache) override
300 { 300 {
301 auto* cacheRequest = new GetCacheKeysForRequestData(m_params, wrapUnique (cache.release()), std::move(m_callback)); 301 auto* cacheRequest = new GetCacheKeysForRequestData(m_params, wrapUnique (cache.release()), std::move(m_callback));
302 cacheRequest->cache()->dispatchKeys(cacheRequest, nullptr, WebServiceWor kerCache::QueryParams()); 302 cacheRequest->cache()->dispatchKeys(cacheRequest, WebServiceWorkerReques t(), WebServiceWorkerCache::QueryParams());
303 } 303 }
304 304
305 void onError(WebServiceWorkerCacheError error) override 305 void onError(WebServiceWorkerCacheError error) override
306 { 306 {
307 m_callback->sendFailure(String::format("Error requesting cache %s: %s", m_params.cacheName.utf8().data(), serviceWorkerCacheErrorString(error).data())); 307 m_callback->sendFailure(String::format("Error requesting cache %s: %s", m_params.cacheName.utf8().data(), serviceWorkerCacheErrorString(error).data()));
308 } 308 }
309 309
310 private: 310 private:
311 DataRequestParams m_params; 311 DataRequestParams m_params;
312 std::unique_ptr<RequestEntriesCallback> m_callback; 312 std::unique_ptr<RequestEntriesCallback> m_callback;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 std::unique_ptr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndN ameForId(errorString, cacheId, &cacheName); 457 std::unique_ptr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndN ameForId(errorString, cacheId, &cacheName);
458 if (!cache) { 458 if (!cache) {
459 callback->sendFailure(*errorString); 459 callback->sendFailure(*errorString);
460 return; 460 return;
461 } 461 }
462 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, std::move (callback)), WebString(cacheName)); 462 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, std::move (callback)), WebString(cacheName));
463 } 463 }
464 464
465 465
466 } // namespace blink 466 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698