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

Unified Diff: Source/modules/serviceworkers/Cache.h

Issue 433793002: Introducing the WebServiceWorkerCache. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remediate to dominicc review 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/Cache.h
diff --git a/Source/modules/serviceworkers/Cache.h b/Source/modules/serviceworkers/Cache.h
index 63c378014647473e7e018b19fa06d8c554544291..536de99fcde75b9736e8cd495ca3c21a035a0fc1 100644
--- a/Source/modules/serviceworkers/Cache.h
+++ b/Source/modules/serviceworkers/Cache.h
@@ -8,12 +8,13 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/DOMException.h"
+#include "public/platform/WebServiceWorkerCache.h"
#include "public/platform/WebServiceWorkerCacheError.h"
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
-#include <v8.h>
namespace blink {
@@ -21,9 +22,8 @@ class Dictionary;
class Response;
class Request;
class ScriptState;
-class WebServiceWorkerCache;
-class Cache FINAL : public GarbageCollected<Cache>, public ScriptWrappable {
+class Cache FINAL : public GarbageCollectedFinalized<Cache>, public ScriptWrappable, public WebServiceWorkerCache::ProxyInterface {
DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(Cache);
public:
@@ -39,8 +39,8 @@ public:
ScriptPromise addAll(ScriptState*, const Vector<ScriptValue>&);
ScriptPromise deleteFunction(ScriptState*, Request*, const Dictionary& queryParams);
ScriptPromise deleteFunction(ScriptState*, const String&, const Dictionary& queryParams);
- ScriptPromise put(ScriptState*, Request*, Response*);
- ScriptPromise put(ScriptState*, const String&, Response*);
+ ScriptPromise put(ScriptState*, Request*, const Response*);
+ ScriptPromise put(ScriptState*, const String&, const Response*);
ScriptPromise keys(ScriptState*);
ScriptPromise keys(ScriptState*, Request*, const Dictionary& queryParams);
ScriptPromise keys(ScriptState*, const String&, const Dictionary& queryParams);
@@ -50,9 +50,20 @@ public:
static PassRefPtrWillBeRawPtr<DOMException> domExceptionForCacheError(WebServiceWorkerCacheError);
private:
- explicit Cache(WebServiceWorkerCache* webCache);
+ explicit Cache(WebServiceWorkerCache*);
- WebServiceWorkerCache const* ALLOW_UNUSED m_webCache;
+ static Cache* create(WebServiceWorkerCache*);
+
+ ScriptPromise matchImpl(ScriptState*, Request*, const Dictionary& queryParams);
+ ScriptPromise matchAllImpl(ScriptState*, Request*, const Dictionary& queryParams);
+ ScriptPromise addImpl(ScriptState*, Request*);
+ ScriptPromise addAllImpl(ScriptState*, Vector<Request*>);
+ ScriptPromise deleteImpl(ScriptState*, Request*, const Dictionary& queryParams);
+ ScriptPromise putImpl(ScriptState*, Request*, const Response*);
+ ScriptPromise keysImpl(ScriptState*);
+ ScriptPromise keysImpl(ScriptState*, Request*, const Dictionary& queryParams);
+
+ OwnPtr<WebServiceWorkerCache> m_webCache;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698