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

Unified Diff: webkit/blob/blob_storage_controller.cc

Issue 9569035: Ensure blobs and associated temp/shareable files survive URLRequest uploads. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | « net/base/upload_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/blob/blob_storage_controller.cc
===================================================================
--- webkit/blob/blob_storage_controller.cc (revision 124555)
+++ webkit/blob/blob_storage_controller.cc (working copy)
@@ -198,6 +198,11 @@
if (blob_data->items().empty())
continue;
+ // Ensure the blob and any attached shareable files survive until
+ // upload completion.
+ upload_data->SetUserData(blob_data,
+ new base::UserDataAdapter<BlobData>(blob_data));
+
// Insert the elements in the referred blob data.
// Note that we traverse from the bottom so that the elements can be
// inserted in the original order.
@@ -208,13 +213,13 @@
switch (item.type) {
case BlobData::TYPE_DATA:
// TODO(jianli): Figure out how to avoid copying the data.
+ // TODO(michaeln): Now that blob_data surives for the duration,
+ // maybe UploadData could take a raw ptr without having to copy.
iter->SetToBytes(
&item.data.at(0) + static_cast<int>(item.offset),
static_cast<int>(item.length));
break;
case BlobData::TYPE_FILE:
- // TODO(michaeln): Ensure that any temp files survive till the
- // net::URLRequest is done with the upload.
iter->SetToFilePathRange(
item.file_path,
item.offset,
« no previous file with comments | « net/base/upload_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698