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

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

Issue 521513002: Service Worker: Simplify rejection code in Cache implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « no previous file | 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"
(...skipping 16 matching lines...) Expand all
27 class WebServiceWorkerCache; 27 class WebServiceWorkerCache;
28 28
29 class Cache FINAL : public RefCountedWillBeGarbageCollected<Cache>, public Scrip tWrappable, public WebServiceWorkerCache::ProxyInterface { 29 class Cache FINAL : public RefCountedWillBeGarbageCollected<Cache>, public Scrip tWrappable, public WebServiceWorkerCache::ProxyInterface {
30 WTF_MAKE_NONCOPYABLE(Cache); 30 WTF_MAKE_NONCOPYABLE(Cache);
31 public: 31 public:
32 static PassRefPtrWillBeRawPtr<Cache> fromWebServiceWorkerCache(WebServiceWor kerCache*); 32 static PassRefPtrWillBeRawPtr<Cache> fromWebServiceWorkerCache(WebServiceWor kerCache*);
33 33
34 virtual ~Cache(); 34 virtual ~Cache();
35 35
36 // From Cache.idl: 36 // From Cache.idl:
37 ScriptPromise match(ScriptState*, Request*, const Dictionary& queryParams); 37 ScriptPromise match(ScriptState*, Request*, const Dictionary& queryParams, E xceptionState&);
38 ScriptPromise match(ScriptState*, const String&, const Dictionary& queryPara ms); 38 ScriptPromise match(ScriptState*, const String&, const Dictionary& queryPara ms, ExceptionState&);
39 ScriptPromise matchAll(ScriptState*, Request*, const Dictionary& queryParams ); 39 ScriptPromise matchAll(ScriptState*, Request*, const Dictionary& queryParams , ExceptionState&);
40 ScriptPromise matchAll(ScriptState*, const String&, const Dictionary& queryP arams); 40 ScriptPromise matchAll(ScriptState*, const String&, const Dictionary& queryP arams, ExceptionState&);
41 ScriptPromise add(ScriptState*, Request*); 41 ScriptPromise add(ScriptState*, Request*, ExceptionState&);
42 ScriptPromise add(ScriptState*, const String&); 42 ScriptPromise add(ScriptState*, const String&, ExceptionState&);
43 ScriptPromise addAll(ScriptState*, const Vector<ScriptValue>&); 43 ScriptPromise addAll(ScriptState*, const Vector<ScriptValue>&, ExceptionStat e&);
44 ScriptPromise deleteFunction(ScriptState*, Request*, const Dictionary& query Params); 44 ScriptPromise deleteFunction(ScriptState*, Request*, const Dictionary& query Params, ExceptionState&);
45 ScriptPromise deleteFunction(ScriptState*, const String&, const Dictionary& queryParams); 45 ScriptPromise deleteFunction(ScriptState*, const String&, const Dictionary& queryParams, ExceptionState&);
46 ScriptPromise put(ScriptState*, Request*, Response*); 46 ScriptPromise put(ScriptState*, Request*, Response*, ExceptionState&);
47 ScriptPromise put(ScriptState*, const String&, Response*); 47 ScriptPromise put(ScriptState*, const String&, Response*, ExceptionState&);
48 ScriptPromise keys(ScriptState*); 48 ScriptPromise keys(ScriptState*, ExceptionState&);
49 ScriptPromise keys(ScriptState*, Request*, const Dictionary& queryParams); 49 ScriptPromise keys(ScriptState*, Request*, const Dictionary& queryParams, Ex ceptionState&);
50 ScriptPromise keys(ScriptState*, const String&, const Dictionary& queryParam s); 50 ScriptPromise keys(ScriptState*, const String&, const Dictionary& queryParam s, ExceptionState&);
51 51
52 void trace(Visitor*) { } 52 void trace(Visitor*) { }
53 53
54 static PassRefPtrWillBeRawPtr<DOMException> domExceptionForCacheError(WebSer viceWorkerCacheError); 54 static PassRefPtrWillBeRawPtr<DOMException> domExceptionForCacheError(WebSer viceWorkerCacheError);
55 55
56 private: 56 private:
57 explicit Cache(WebServiceWorkerCache*); 57 explicit Cache(WebServiceWorkerCache*);
58 58
59 static PassRefPtrWillBeRawPtr<Cache> create(WebServiceWorkerCache*); 59 static PassRefPtrWillBeRawPtr<Cache> create(WebServiceWorkerCache*);
60 60
61 ScriptPromise matchImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, const Dictionary& queryParams); 61 ScriptPromise matchImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, const Dictionary& queryParams);
62 ScriptPromise matchAllImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, co nst Dictionary& queryParams); 62 ScriptPromise matchAllImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, co nst Dictionary& queryParams);
63 ScriptPromise addImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>); 63 ScriptPromise addImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, Excepti onState&);
64 ScriptPromise addAllImpl(ScriptState*, Vector<RefPtrWillBeRawPtr<Request> >) ; 64 ScriptPromise addAllImpl(ScriptState*, Vector<RefPtrWillBeRawPtr<Request> >, ExceptionState&);
65 ScriptPromise deleteImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, cons t Dictionary& queryParams); 65 ScriptPromise deleteImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, cons t Dictionary& queryParams);
66 ScriptPromise putImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, Respons e*); 66 ScriptPromise putImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, Respons e*);
67 ScriptPromise keysImpl(ScriptState*); 67 ScriptPromise keysImpl(ScriptState*);
68 ScriptPromise keysImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, const Dictionary& queryParams); 68 ScriptPromise keysImpl(ScriptState*, PassRefPtrWillBeRawPtr<Request>, const Dictionary& queryParams);
69 69
70 OwnPtr<WebServiceWorkerCache> m_webCache; 70 OwnPtr<WebServiceWorkerCache> m_webCache;
71 }; 71 };
72 72
73 } // namespace blink 73 } // namespace blink
74 74
75 #endif // Cache_h 75 #endif // Cache_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698