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

Unified Diff: storage/browser/blob/blob_url_request_job_factory.cc

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed copyright Created 5 years, 11 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: storage/browser/blob/blob_url_request_job_factory.cc
diff --git a/storage/browser/blob/blob_url_request_job_factory.cc b/storage/browser/blob/blob_url_request_job_factory.cc
index 60f9c738b9e74245871d167d2c9c2b8eb9bd3d6e..fe193afbeb8abd6069654d3828bd93bf5214993c 100644
--- a/storage/browser/blob/blob_url_request_job_factory.cc
+++ b/storage/browser/blob/blob_url_request_job_factory.cc
@@ -68,11 +68,11 @@ net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob(
file_loop_proxy_.get());
}
-scoped_refptr<storage::BlobData> BlobProtocolHandler::LookupBlobData(
+scoped_ptr<BlobDataSnapshot> BlobProtocolHandler::LookupBlobData(
net::URLRequest* request) const {
BlobDataHandle* blob_data_handle = GetRequestedBlobDataHandle(request);
if (blob_data_handle)
- return blob_data_handle->data();
+ return blob_data_handle->CreateSnapshot().Pass();
if (!context_.get())
return NULL;
@@ -84,7 +84,12 @@ scoped_refptr<storage::BlobData> BlobProtocolHandler::LookupBlobData(
return NULL;
std::string uuid = request->url().spec().substr(kPrefix.length());
scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid);
- return handle.get() ? handle->data() : NULL;
+ scoped_ptr<BlobDataSnapshot> snapshot;
+ if (handle) {
+ snapshot = handle->CreateSnapshot().Pass();
+ SetRequestedBlobDataHandle(request, handle.Pass());
+ }
+ return snapshot.Pass();
}
} // namespace storage

Powered by Google App Engine
This is Rietveld 408576698