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

Unified Diff: content/browser/fileapi/chrome_blob_storage_context.cc

Issue 973993003: Instead of ArrayBuffer, pass blob with printerProvider.onPrintRequested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & add ext fun histogram Created 5 years, 10 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 | « content/browser/fileapi/chrome_blob_storage_context.h ('k') | content/public/browser/browser_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/fileapi/chrome_blob_storage_context.cc
diff --git a/content/browser/fileapi/chrome_blob_storage_context.cc b/content/browser/fileapi/chrome_blob_storage_context.cc
index f8753b5ea77e521d8f0c4fc24d517ee965bfdd6c..1f8acc8f7a6332030b38c0da0934157ca8fe9d3e 100644
--- a/content/browser/fileapi/chrome_blob_storage_context.cc
+++ b/content/browser/fileapi/chrome_blob_storage_context.cc
@@ -82,6 +82,27 @@ scoped_ptr<BlobHandle> ChromeBlobStorageContext::CreateMemoryBackedBlob(
return blob_handle.Pass();
}
+scoped_ptr<BlobHandle> ChromeBlobStorageContext::CreateFileBackedBlob(
+ const base::FilePath& path,
+ int64_t offset,
+ int64_t size,
+ const base::Time& expected_modification_time) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ std::string uuid(base::GenerateGUID());
+ storage::BlobDataBuilder blob_data_builder(uuid);
+ blob_data_builder.AppendFile(path, offset, size, expected_modification_time);
+
+ scoped_ptr<storage::BlobDataHandle> blob_data_handle =
+ context_->AddFinishedBlob(&blob_data_builder);
+ if (!blob_data_handle)
+ return scoped_ptr<BlobHandle>();
+
+ scoped_ptr<BlobHandle> blob_handle(
+ new BlobHandleImpl(blob_data_handle.Pass()));
+ return blob_handle.Pass();
+}
+
ChromeBlobStorageContext::~ChromeBlobStorageContext() {}
void ChromeBlobStorageContext::DeleteOnCorrectThread() const {
« no previous file with comments | « content/browser/fileapi/chrome_blob_storage_context.h ('k') | content/public/browser/browser_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698