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

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

Issue 433793002: Introducing the WebServiceWorkerCache. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: cleaner and oilpan Created 6 years, 3 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
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef Cache_h 5 #ifndef Cache_h
6 #define Cache_h 6 #define Cache_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptWrappable.h" 9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
11 #include "public/platform/WebServiceWorkerCache.h"
11 #include "public/platform/WebServiceWorkerCacheError.h" 12 #include "public/platform/WebServiceWorkerCacheError.h"
12 #include "wtf/Forward.h" 13 #include "wtf/Forward.h"
13 #include "wtf/Noncopyable.h" 14 #include "wtf/Noncopyable.h"
15 #include "wtf/OwnPtr.h"
14 #include "wtf/Vector.h" 16 #include "wtf/Vector.h"
15 #include "wtf/text/WTFString.h" 17 #include "wtf/text/WTFString.h"
16 #include <v8.h>
17 18
18 namespace blink { 19 namespace blink {
19 20
20 class Dictionary; 21 class Dictionary;
21 class Response; 22 class Response;
22 class Request; 23 class Request;
23 class ScriptState; 24 class ScriptState;
24 class WebServiceWorkerCache;
25 25
26 class Cache FINAL : public GarbageCollected<Cache>, public ScriptWrappable { 26 class Cache FINAL : public GarbageCollectedFinalized<Cache>, public ScriptWrappa ble {
27 DEFINE_WRAPPERTYPEINFO(); 27 DEFINE_WRAPPERTYPEINFO();
28 WTF_MAKE_NONCOPYABLE(Cache); 28 WTF_MAKE_NONCOPYABLE(Cache);
29 public: 29 public:
30 static Cache* create(WebServiceWorkerCache*); 30 static Cache* create(WebServiceWorkerCache*);
31 31
32 // From Cache.idl: 32 // From Cache.idl:
33 ScriptPromise match(ScriptState*, Request*, const Dictionary& queryParams); 33 ScriptPromise match(ScriptState*, Request*, const Dictionary& queryParams);
34 ScriptPromise match(ScriptState*, const String&, const Dictionary& queryPara ms); 34 ScriptPromise match(ScriptState*, const String&, const Dictionary& queryPara ms);
35 ScriptPromise matchAll(ScriptState*, Request*, const Dictionary& queryParams ); 35 ScriptPromise matchAll(ScriptState*, Request*, const Dictionary& queryParams );
36 ScriptPromise matchAll(ScriptState*, const String&, const Dictionary& queryP arams); 36 ScriptPromise matchAll(ScriptState*, const String&, const Dictionary& queryP arams);
37 ScriptPromise add(ScriptState*, Request*); 37 ScriptPromise add(ScriptState*, Request*);
38 ScriptPromise add(ScriptState*, const String&); 38 ScriptPromise add(ScriptState*, const String&);
39 ScriptPromise addAll(ScriptState*, const Vector<ScriptValue>&); 39 ScriptPromise addAll(ScriptState*, const Vector<ScriptValue>&);
40 ScriptPromise deleteFunction(ScriptState*, Request*, const Dictionary& query Params); 40 ScriptPromise deleteFunction(ScriptState*, Request*, const Dictionary& query Params);
41 ScriptPromise deleteFunction(ScriptState*, const String&, const Dictionary& queryParams); 41 ScriptPromise deleteFunction(ScriptState*, const String&, const Dictionary& queryParams);
42 ScriptPromise put(ScriptState*, Request*, Response*); 42 ScriptPromise put(ScriptState*, Request*, Response*);
43 ScriptPromise put(ScriptState*, const String&, Response*); 43 ScriptPromise put(ScriptState*, const String&, Response*);
44 ScriptPromise keys(ScriptState*); 44 ScriptPromise keys(ScriptState*);
45 ScriptPromise keys(ScriptState*, Request*, const Dictionary& queryParams); 45 ScriptPromise keys(ScriptState*, Request*, const Dictionary& queryParams);
46 ScriptPromise keys(ScriptState*, const String&, const Dictionary& queryParam s); 46 ScriptPromise keys(ScriptState*, const String&, const Dictionary& queryParam s);
47 47
48 static PassRefPtrWillBeRawPtr<DOMException> domExceptionForCacheError(WebSer viceWorkerCacheError);
49
48 void trace(Visitor*) { } 50 void trace(Visitor*) { }
49 51
50 static PassRefPtrWillBeRawPtr<DOMException> domExceptionForCacheError(WebSer viceWorkerCacheError); 52 private:
53 explicit Cache(WebServiceWorkerCache*);
51 54
52 private: 55 ScriptPromise matchImpl(ScriptState*, Request*, const Dictionary& queryParam s);
53 explicit Cache(WebServiceWorkerCache* webCache); 56 ScriptPromise matchAllImpl(ScriptState*, Request*, const Dictionary& queryPa rams);
57 ScriptPromise addImpl(ScriptState*, Request*);
58 ScriptPromise addAllImpl(ScriptState*, Vector<Request*>);
59 ScriptPromise deleteImpl(ScriptState*, Request*, const Dictionary& queryPara ms);
60 ScriptPromise putImpl(ScriptState*, Request*, Response*);
61 ScriptPromise keysImpl(ScriptState*);
62 ScriptPromise keysImpl(ScriptState*, Request*, const Dictionary& queryParams );
54 63
55 WebServiceWorkerCache const* ALLOW_UNUSED m_webCache; 64 OwnPtr<WebServiceWorkerCache> m_webCache;
56 }; 65 };
57 66
58 } // namespace blink 67 } // namespace blink
59 68
60 #endif // Cache_h 69 #endif // Cache_h
OLDNEW
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698