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

Unified Diff: content/browser/service_worker/service_worker_cache_listener.h

Issue 411973004: Stitch CacheStorage messages to implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cache_storage_stitch
Patch Set: Addresses all comments from PS5 Created 6 years, 4 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_cache_listener.h
diff --git a/content/browser/service_worker/service_worker_cache_listener.h b/content/browser/service_worker/service_worker_cache_listener.h
index 5bc85d12d45da69c9271ae38b8fb50430ca6bfe9..27a6089019946382624155b3db88bf1eb8933ba0 100644
--- a/content/browser/service_worker/service_worker_cache_listener.h
+++ b/content/browser/service_worker/service_worker_cache_listener.h
@@ -2,23 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORES_LISTENER_H_
-#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORES_LISTENER_H_
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_LISTENER_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_LISTENER_H_
+#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "content/browser/service_worker/embedded_worker_instance.h"
+#include "content/browser/service_worker/service_worker_cache_storage.h"
namespace content {
class ServiceWorkerVersion;
-// This class listens for requests on the Store APIs, and sends response
+// This class listens for requests on the Cache APIs, and sends response
// messages to the renderer process. There is one instance per
// ServiceWorkerVersion instance.
-class ServiceWorkerStoresListener : public EmbeddedWorkerInstance::Listener {
+class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener {
public:
- explicit ServiceWorkerStoresListener(ServiceWorkerVersion* version);
- virtual ~ServiceWorkerStoresListener();
+ ServiceWorkerCacheListener(ServiceWorkerVersion* version,
+ base::WeakPtr<ServiceWorkerContextCore> context);
+ virtual ~ServiceWorkerCacheListener();
// From EmbeddedWorkerInstance::Listener:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
@@ -35,10 +38,38 @@ class ServiceWorkerStoresListener : public EmbeddedWorkerInstance::Listener {
private:
void Send(const IPC::Message& message);
+ void OnCacheStorageGetCallback(
+ int request_id,
+ int cache_id,
+ ServiceWorkerCacheStorage::CacheStorageError error);
+ void OnCacheStorageHasCallback(
+ int request_id,
+ bool has_cache,
+ ServiceWorkerCacheStorage::CacheStorageError error);
+ void OnCacheStorageCreateCallback(
+ int request_id,
+ int cache_id,
+ ServiceWorkerCacheStorage::CacheStorageError error);
+ void OnCacheStorageDeleteCallback(
+ int request_id,
+ bool deleted,
+ ServiceWorkerCacheStorage::CacheStorageError error);
+ void OnCacheStorageKeysCallback(
+ int request_id,
+ const std::vector<std::string>& strings,
+ ServiceWorkerCacheStorage::CacheStorageError error);
+
// The ServiceWorkerVersion to use for messaging back to the renderer thread.
ServiceWorkerVersion* version_;
+
+ // The ServiceWorkerContextCore should always outlive this.
+ base::WeakPtr<ServiceWorkerContextCore> context_;
+
+ base::WeakPtrFactory<ServiceWorkerCacheListener> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheListener);
};
} // namespace content
-#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORES_LISTENER_H_
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_LISTENER_H_
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_cache_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698