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

Unified Diff: content/public/browser/blob_context.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: content/public/browser/blob_context.h
diff --git a/content/public/browser/blob_context.h b/content/public/browser/blob_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ee78f5366f494dba769af250d363e9d5d3fe11c
--- /dev/null
+++ b/content/public/browser/blob_context.h
@@ -0,0 +1,38 @@
+// 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 CONTENT_PUBLIC_BROWSER_BLOB_CONTEXT_H_
+#define CONTENT_PUBLIC_BROWSER_BLOB_CONTEXT_H_
+
+#include "base/callback_forward.h"
+
+namespace content {
+
+// A handle to Blobs that can be stored outside of content/.
+class BlobHandle {
+ public:
+ virtual ~BlobHandle() {}
+ virtual std::string uuid() = 0;
+
+ protected:
+ BlobHandle() {}
+
+ DISALLOW_COPY_AND_ASSIGN(BlobHandle);
+};
+
+// Used to coin Blobs in the browser process. For use on the UI thread.
+class BlobContext {
+ public:
+ typedef base::Callback<void(scoped_ptr<BlobHandle>)> BlobCallback;
+
+ virtual void CreateMemoryBackedBlob(
+ const char* data, size_t length, const BlobCallback& callback) = 0;
+
+ protected:
+ virtual ~BlobContext() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_BLOB_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698