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

Side by Side Diff: Source/modules/serviceworkers/CacheStorage.h

Issue 1055543004: Move Cache Storage API implementation to modules/cachestorage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CacheStorage_h
6 #define CacheStorage_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "modules/serviceworkers/Cache.h"
12 #include "modules/serviceworkers/CacheQueryOptions.h"
13 #include "public/platform/WebServiceWorkerCacheStorage.h"
14 #include "wtf/Forward.h"
15 #include "wtf/HashMap.h"
16 #include "wtf/Noncopyable.h"
17
18 namespace blink {
19
20 class Cache;
21 class WebServiceWorkerCacheStorage;
22
23 class CacheStorage final : public GarbageCollectedFinalized<CacheStorage>, publi c ScriptWrappable {
24 DEFINE_WRAPPERTYPEINFO();
25 WTF_MAKE_NONCOPYABLE(CacheStorage);
26 public:
27 static CacheStorage* create(WebServiceWorkerCacheStorage*);
28
29 ScriptPromise open(ScriptState*, const String& cacheName);
30 ScriptPromise has(ScriptState*, const String& cacheName);
31 ScriptPromise deleteFunction(ScriptState*, const String& cacheName);
32 ScriptPromise keys(ScriptState*);
33 ScriptPromise match(ScriptState*, const RequestInfo&, const CacheQueryOption s&, ExceptionState&);
34
35
36 DECLARE_TRACE();
37
38 private:
39 class Callbacks;
40 class WithCacheCallbacks;
41 class DeleteCallbacks;
42 class KeysCallbacks;
43 class MatchCallbacks;
44
45 friend class WithCacheCallbacks;
46 friend class DeleteCallbacks;
47
48 explicit CacheStorage(PassOwnPtr<WebServiceWorkerCacheStorage>);
49 ScriptPromise matchImpl(ScriptState*, const Request*, const CacheQueryOption s&);
50
51 OwnPtr<WebServiceWorkerCacheStorage> m_webCacheStorage;
52 HeapHashMap<String, Member<Cache>> m_nameToCacheMap;
53 };
54
55 } // namespace blink
56
57 #endif // CacheStorage_h
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/CacheQueryOptions.idl ('k') | Source/modules/serviceworkers/CacheStorage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698