| 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/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/Dispatcher.h" | 8 #include "platform/inspector_protocol/Dispatcher.h" |
| 9 #include "platform/inspector_protocol/TypeBuilder.h" | 9 #include "platform/inspector_protocol/TypeBuilder.h" |
| 10 #include "platform/inspector_protocol/Values.h" | 10 #include "platform/inspector_protocol/Values.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 GetCacheForRequestData(const DataRequestParams& params, PassOwnPtr<RequestEn
triesCallback> callback) | 296 GetCacheForRequestData(const DataRequestParams& params, PassOwnPtr<RequestEn
triesCallback> callback) |
| 297 : m_params(params) | 297 : m_params(params) |
| 298 , m_callback(callback) | 298 , m_callback(callback) |
| 299 { | 299 { |
| 300 } | 300 } |
| 301 ~GetCacheForRequestData() override { } | 301 ~GetCacheForRequestData() override { } |
| 302 | 302 |
| 303 void onSuccess(WebPassOwnPtr<WebServiceWorkerCache> cache) override | 303 void onSuccess(WebPassOwnPtr<WebServiceWorkerCache> cache) override |
| 304 { | 304 { |
| 305 auto* cacheRequest = new GetCacheKeysForRequestData(m_params, cache.rele
ase(), m_callback.release()); | 305 auto* cacheRequest = new GetCacheKeysForRequestData(m_params, cache.rele
ase(), m_callback.release()); |
| 306 cacheRequest->cache()->dispatchKeys(cacheRequest, nullptr, WebServiceWor
kerCache::QueryParams()); | 306 cacheRequest->cache()->dispatchKeys(cacheRequest, WebServiceWorkerReques
t(), WebServiceWorkerCache::QueryParams()); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void onError(WebServiceWorkerCacheError error) override | 309 void onError(WebServiceWorkerCacheError error) override |
| 310 { | 310 { |
| 311 m_callback->sendFailure(String::format("Error requesting cache %s: %s",
m_params.cacheName.utf8().data(), serviceWorkerCacheErrorString(error).data())); | 311 m_callback->sendFailure(String::format("Error requesting cache %s: %s",
m_params.cacheName.utf8().data(), serviceWorkerCacheErrorString(error).data())); |
| 312 } | 312 } |
| 313 | 313 |
| 314 private: | 314 private: |
| 315 DataRequestParams m_params; | 315 DataRequestParams m_params; |
| 316 OwnPtr<RequestEntriesCallback> m_callback; | 316 OwnPtr<RequestEntriesCallback> m_callback; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId(
errorString, cacheId, &cacheName); | 464 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId(
errorString, cacheId, &cacheName); |
| 465 if (!cache) { | 465 if (!cache) { |
| 466 callback->sendFailure(*errorString); | 466 callback->sendFailure(*errorString); |
| 467 return; | 467 return; |
| 468 } | 468 } |
| 469 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, callback)
, WebString(cacheName)); | 469 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, callback)
, WebString(cacheName)); |
| 470 } | 470 } |
| 471 | 471 |
| 472 | 472 |
| 473 } // namespace blink | 473 } // namespace blink |
| OLD | NEW |