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

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

Issue 622833002: ServiceWorkerCache: Support response body in blob form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opacity
Patch Set: Rebase Created 6 years, 2 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: 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 5e950213d1f1612f9bd26a6677fe535d61c6442a..5bebac561f4355f74ab8532d4e2f7ed1cd620c2f 100644
--- a/content/browser/service_worker/service_worker_cache_listener.h
+++ b/content/browser/service_worker/service_worker_cache_listener.h
@@ -5,6 +5,9 @@
#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_LISTENER_H_
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_LISTENER_H_
+#include <list>
+#include <map>
+
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "content/browser/service_worker/embedded_worker_instance.h"
@@ -57,10 +60,13 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener {
int cache_id,
const std::vector<ServiceWorkerBatchOperation>& operations);
void OnCacheClosed(int cache_id);
+ void OnBlobDataHandled(const std::string& uuid);
private:
typedef int32_t CacheID; // TODO(jkarlin): Bump to 64 bit.
- typedef std::map<CacheID, scoped_refptr<ServiceWorkerCache> > IDToCacheMap;
+ typedef std::map<CacheID, scoped_refptr<ServiceWorkerCache>> IDToCacheMap;
+ typedef std::map<std::string, std::list<storage::BlobDataHandle>>
+ UUIDToBlobDataHandleList;
void Send(const IPC::Message& message);
@@ -108,6 +114,12 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener {
CacheID StoreCacheReference(const scoped_refptr<ServiceWorkerCache>& cache);
void DropCacheReference(CacheID cache_id);
+ // Stores blob handles while waiting for acknowledgement of receipt from the
+ // renderer.
+ void StoreBlobDataHandle(
+ scoped_ptr<storage::BlobDataHandle> blob_data_handle);
+ void DropBlobDataHandle(std::string uuid);
+
// The ServiceWorkerVersion to use for messaging back to the renderer thread.
ServiceWorkerVersion* version_;
@@ -117,6 +129,8 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener {
IDToCacheMap id_to_cache_map_;
CacheID next_cache_id_;
+ UUIDToBlobDataHandleList blob_handle_store_;
+
base::WeakPtrFactory<ServiceWorkerCacheListener> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheListener);

Powered by Google App Engine
This is Rietveld 408576698