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 #ifndef InspectorCacheStorageAgent_h | 5 #ifndef InspectorCacheStorageAgent_h |
6 #define InspectorCacheStorageAgent_h | 6 #define InspectorCacheStorageAgent_h |
7 | 7 |
8 #include "core/InspectorFrontend.h" | 8 #include "core/InspectorFrontend.h" |
9 #include "core/inspector/InspectorBaseAgent.h" | 9 #include "core/inspector/InspectorBaseAgent.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 typedef String ErrorString; | 16 typedef String ErrorString; |
17 | 17 |
| 18 class ExecutionContext; |
| 19 class Page; |
| 20 class SecurityOrigin; |
| 21 class WebServiceWorkerCacheStorage; |
| 22 |
18 class MODULES_EXPORT InspectorCacheStorageAgent final : public InspectorBaseAgen
t<InspectorCacheStorageAgent, InspectorFrontend::CacheStorage>, public Inspector
BackendDispatcher::CacheStorageCommandHandler { | 23 class MODULES_EXPORT InspectorCacheStorageAgent final : public InspectorBaseAgen
t<InspectorCacheStorageAgent, InspectorFrontend::CacheStorage>, public Inspector
BackendDispatcher::CacheStorageCommandHandler { |
19 WTF_MAKE_NONCOPYABLE(InspectorCacheStorageAgent); | 24 WTF_MAKE_NONCOPYABLE(InspectorCacheStorageAgent); |
20 | 25 |
21 public: | 26 public: |
22 static PassOwnPtrWillBeRawPtr<InspectorCacheStorageAgent> create() | 27 static PassOwnPtrWillBeRawPtr<InspectorCacheStorageAgent> create(Page* page) |
23 { | 28 { |
24 return adoptPtrWillBeNoop(new InspectorCacheStorageAgent()); | 29 return adoptPtrWillBeNoop(new InspectorCacheStorageAgent(page)); |
25 } | 30 } |
26 | 31 |
27 virtual ~InspectorCacheStorageAgent(); | 32 virtual ~InspectorCacheStorageAgent(); |
28 | 33 |
29 DECLARE_VIRTUAL_TRACE(); | 34 DECLARE_VIRTUAL_TRACE(); |
30 | 35 |
31 virtual void requestCacheNames(ErrorString*, const String& securityOrigin, P
assRefPtrWillBeRawPtr<RequestCacheNamesCallback>) override; | 36 virtual void requestCacheNames(ErrorString*, const String& securityOrigin, P
assRefPtrWillBeRawPtr<RequestCacheNamesCallback>) override; |
32 virtual void requestEntries(ErrorString*, const String& cacheId, int skipCou
nt, int pageSize, PassRefPtrWillBeRawPtr<RequestEntriesCallback>) override; | 37 virtual void requestEntries(ErrorString*, const String& cacheId, int skipCou
nt, int pageSize, PassRefPtrWillBeRawPtr<RequestEntriesCallback>) override; |
33 virtual void deleteCache(ErrorString*, const String& cacheId, PassRefPtrWill
BeRawPtr<DeleteCacheCallback>) override; | 38 virtual void deleteCache(ErrorString*, const String& cacheId, PassRefPtrWill
BeRawPtr<DeleteCacheCallback>) override; |
34 virtual void deleteEntry(ErrorString*, const String& cacheId, const String&
request, PassRefPtrWillBeRawPtr<DeleteEntryCallback>) override; | 39 virtual void deleteEntry(ErrorString*, const String& cacheId, const String&
request, PassRefPtrWillBeRawPtr<DeleteEntryCallback>) override; |
35 | 40 |
36 private: | 41 private: |
37 explicit InspectorCacheStorageAgent(); | 42 explicit InspectorCacheStorageAgent(Page*); |
| 43 |
| 44 ExecutionContext* assertExecutionContextForOrigin(ErrorString*, SecurityOrig
in*); |
| 45 PassOwnPtr<WebServiceWorkerCacheStorage> assertCacheStorage(ErrorString*, co
nst String& securityOrigin); |
| 46 PassOwnPtr<WebServiceWorkerCacheStorage> assertCacheStorageAndNameForId(Erro
rString*, const String& cacheId, String* cacheName); |
| 47 |
| 48 RawPtrWillBeMember<Page> m_page; |
38 }; | 49 }; |
39 | 50 |
40 } // namespace blink | 51 } // namespace blink |
41 | 52 |
42 #endif // InspectorCacheStorageAgent_h | 53 #endif // InspectorCacheStorageAgent_h |
OLD | NEW |