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

Unified Diff: content/browser/browser_context.cc

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: remove stray lines 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/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 170f8987ba6d3278ddccf96e74e0d9ae9e9b332a..2758c5d1d22790d402a5f02ac1852197b461ca06 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -6,10 +6,12 @@
#if !defined(OS_IOS)
#include "content/browser/download/download_manager_impl.h"
+#include "content/browser/fileapi/chrome_blob_storage_context.h"
#include "content/browser/indexed_db/indexed_db_context_impl.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/storage_partition_impl_map.h"
#include "content/common/child_process_host_impl.h"
+#include "content/public/browser/blob_handle.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/site_instance.h"
@@ -196,6 +198,20 @@ StoragePartition* BrowserContext::GetDefaultStoragePartition(
return GetStoragePartition(browser_context, NULL);
}
+void BrowserContext::CreateMemoryBackedBlob(BrowserContext* browser_context,
+ const char* data, size_t length,
+ const BlobCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ ChromeBlobStorageContext* blob_context =
+ ChromeBlobStorageContext::GetFor(browser_context);
+ BrowserThread::PostTaskAndReplyWithResult(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&ChromeBlobStorageContext::CreateMemoryBackedBlob,
+ make_scoped_refptr(blob_context), data, length),
+ callback);
+}
+
void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) {
// This will be enough to tickle initialization of BrowserContext if
// necessary, which initializes ResourceContext. The reason we don't call
« no previous file with comments | « no previous file | content/browser/fileapi/chrome_blob_storage_context.h » ('j') | content/public/browser/browser_context.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698