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

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

Issue 929953002: CachedMetadata support for ServiceWorker script. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated tkent's comment Created 5 years, 10 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/ServiceWorkerScriptCachedMetadataHandler.h
diff --git a/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h b/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h
new file mode 100644
index 0000000000000000000000000000000000000000..8ef062cc7d46d1533e50343e36d82a09bf506227
--- /dev/null
+++ b/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ServiceWorkerScriptCachedMetadataHandler_h
+#define ServiceWorkerScriptCachedMetadataHandler_h
+
+#include "core/fetch/CachedMetadataHandler.h"
+#include "platform/weborigin/KURL.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+class WorkerGlobalScope;
+class CachedMetadata;
+
+class ServiceWorkerScriptCachedMetadataHandler : public CachedMetadataHandler {
+public:
+ static PassOwnPtr<ServiceWorkerScriptCachedMetadataHandler> create(WorkerGlobalScope* workerGlobalScope, const KURL& scriptURL, const Vector<char>* metaData)
+ {
+ return adoptPtr(new ServiceWorkerScriptCachedMetadataHandler(workerGlobalScope, scriptURL, metaData));
+ }
+ ~ServiceWorkerScriptCachedMetadataHandler() override;
+ void setCachedMetadata(unsigned dataTypeID, const char*, size_t, CacheType) override;
+ void clearCachedMetadata(CacheType) override;
+ CachedMetadata* cachedMetadata(unsigned dataTypeID) const override;
+ String encoding() const override;
+
+private:
+ ServiceWorkerScriptCachedMetadataHandler(WorkerGlobalScope*, const KURL& scriptURL, const Vector<char>* metaData);
+
+ WorkerGlobalScope* m_workerGlobalScope;
+ KURL m_scriptURL;
+ RefPtr<CachedMetadata> m_cachedMetadata;
+};
+
+} // namespace blink
+
+#endif // ServiceWorkerScriptCachedMetadataHandler_h

Powered by Google App Engine
This is Rietveld 408576698