| 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 #include "platform/heap/Handle.h" | 6 #include "platform/heap/Handle.h" |
| 7 #include "platform/inspector_protocol/Dispatcher.h" | 7 #include "platform/inspector_protocol/Dispatcher.h" |
| 8 #include "platform/inspector_protocol/TypeBuilder.h" | 8 #include "platform/inspector_protocol/TypeBuilder.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 16 matching lines...) Expand all Loading... |
| 27 #include "wtf/Vector.h" | 27 #include "wtf/Vector.h" |
| 28 #include "wtf/text/StringBuilder.h" | 28 #include "wtf/text/StringBuilder.h" |
| 29 | 29 |
| 30 #include <algorithm> | 30 #include <algorithm> |
| 31 #include <memory> | 31 #include <memory> |
| 32 | 32 |
| 33 using blink::protocol::Array; | 33 using blink::protocol::Array; |
| 34 using blink::protocol::CacheStorage::Cache; | 34 using blink::protocol::CacheStorage::Cache; |
| 35 using blink::protocol::CacheStorage::DataEntry; | 35 using blink::protocol::CacheStorage::DataEntry; |
| 36 | 36 |
| 37 typedef blink::protocol::Backend::CacheStorage::DeleteCacheCallback DeleteCacheC
allback; | 37 typedef blink::protocol::CacheStorage::Backend::DeleteCacheCallback DeleteCacheC
allback; |
| 38 typedef blink::protocol::Backend::CacheStorage::DeleteEntryCallback DeleteEntryC
allback; | 38 typedef blink::protocol::CacheStorage::Backend::DeleteEntryCallback DeleteEntryC
allback; |
| 39 typedef blink::protocol::Backend::CacheStorage::RequestCacheNamesCallback Reques
tCacheNamesCallback; | 39 typedef blink::protocol::CacheStorage::Backend::RequestCacheNamesCallback Reques
tCacheNamesCallback; |
| 40 typedef blink::protocol::Backend::CacheStorage::RequestEntriesCallback RequestEn
triesCallback; | 40 typedef blink::protocol::CacheStorage::Backend::RequestEntriesCallback RequestEn
triesCallback; |
| 41 typedef blink::protocol::Dispatcher::CallbackBase RequestCallback; | |
| 42 typedef blink::WebServiceWorkerCache::BatchOperation BatchOperation; | 41 typedef blink::WebServiceWorkerCache::BatchOperation BatchOperation; |
| 43 | 42 |
| 44 namespace blink { | 43 namespace blink { |
| 45 | 44 |
| 46 namespace { | 45 namespace { |
| 47 | 46 |
| 48 String buildCacheId(const String& securityOrigin, const String& cacheName) | 47 String buildCacheId(const String& securityOrigin, const String& cacheName) |
| 49 { | 48 { |
| 50 String id(securityOrigin); | 49 String id(securityOrigin); |
| 51 id.append("|"); | 50 id.append("|"); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 392 |
| 394 private: | 393 private: |
| 395 String m_requestSpec; | 394 String m_requestSpec; |
| 396 String m_cacheName; | 395 String m_cacheName; |
| 397 std::unique_ptr<DeleteEntryCallback> m_callback; | 396 std::unique_ptr<DeleteEntryCallback> m_callback; |
| 398 }; | 397 }; |
| 399 | 398 |
| 400 } // namespace | 399 } // namespace |
| 401 | 400 |
| 402 InspectorCacheStorageAgent::InspectorCacheStorageAgent() | 401 InspectorCacheStorageAgent::InspectorCacheStorageAgent() |
| 403 : InspectorBaseAgent<InspectorCacheStorageAgent, protocol::Frontend::CacheSt
orage>("CacheStorage") | 402 : InspectorBaseAgent<InspectorCacheStorageAgent, protocol::CacheStorage::Fro
ntend>("CacheStorage") |
| 404 { | 403 { |
| 405 } | 404 } |
| 406 | 405 |
| 407 InspectorCacheStorageAgent::~InspectorCacheStorageAgent() { } | 406 InspectorCacheStorageAgent::~InspectorCacheStorageAgent() { } |
| 408 | 407 |
| 409 DEFINE_TRACE(InspectorCacheStorageAgent) | 408 DEFINE_TRACE(InspectorCacheStorageAgent) |
| 410 { | 409 { |
| 411 InspectorBaseAgent::trace(visitor); | 410 InspectorBaseAgent::trace(visitor); |
| 412 } | 411 } |
| 413 | 412 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId(
errorString, cacheId, &cacheName); | 461 OwnPtr<WebServiceWorkerCacheStorage> cache = assertCacheStorageAndNameForId(
errorString, cacheId, &cacheName); |
| 463 if (!cache) { | 462 if (!cache) { |
| 464 callback->sendFailure(*errorString); | 463 callback->sendFailure(*errorString); |
| 465 return; | 464 return; |
| 466 } | 465 } |
| 467 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, std::move
(callback)), WebString(cacheName)); | 466 cache->dispatchOpen(new GetCacheForDeleteEntry(request, cacheName, std::move
(callback)), WebString(cacheName)); |
| 468 } | 467 } |
| 469 | 468 |
| 470 | 469 |
| 471 } // namespace blink | 470 } // namespace blink |
| OLD | NEW |