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

Unified Diff: chrome/browser/extensions/blob_holder.h

Issue 266373006: Blobs: Mechanism for creating Blobs in browser process, then transferring to renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: chrome/browser/extensions/blob_holder.h
diff --git a/chrome/browser/extensions/blob_holder.h b/chrome/browser/extensions/blob_holder.h
new file mode 100644
index 0000000000000000000000000000000000000000..436aaf2da4eaea06dbe39c26fb8a6f019a300dae
--- /dev/null
+++ b/chrome/browser/extensions/blob_holder.h
@@ -0,0 +1,45 @@
+// Copyright 2014 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 CHROME_BROWSER_EXTENSIONS_BLOB_HOLDER_H_
+#define CHROME_BROWSER_EXTENSIONS_BLOB_HOLDER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+namespace content {
+class BlobHandle;
+}
+
+namespace extensions {
+
+// Used for holding onto Blobs created into the browser process until a
+// renderer takes over ownership.
+class BlobHolder : public content::WebContentsObserver,
+ public content::WebContentsUserData<BlobHolder> {
+ public:
+ virtual ~BlobHolder();
+
+ void HoldBlobReference(scoped_ptr<content::BlobHandle> blob);
+
+ private:
+ explicit BlobHolder(content::WebContents* web_contents);
+ friend class content::WebContentsUserData<BlobHolder>;
+
+ // content::WebContentsObserver overrides.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // Message handlers.
+ void OnBlobOwnershipTaken(const std::string& uuid);
+
+ ScopedVector<content::BlobHandle> held_blobs_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlobHolder);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_BLOB_HOLDER_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/blob_holder.cc » ('j') | content/browser/fileapi/chrome_blob_storage_context.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698