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

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

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: memory leak fixed 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: 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 f085242f689eab0c8f37a6079d4ae9664fdc946a..121a54fa14f1a822e726911a0e6e4c2e69d94471 100644
--- a/content/browser/fileapi/chrome_blob_storage_context.cc
+++ b/content/browser/fileapi/chrome_blob_storage_context.cc
@@ -23,16 +23,15 @@ const char kBlobStorageContextKeyName[] = "content_blob_storage_context";
class BlobHandleImpl : public BlobHandle {
public:
- explicit BlobHandleImpl(scoped_ptr<storage::BlobDataHandle> handle)
- : handle_(handle.Pass()) {
- }
+ explicit BlobHandleImpl(scoped_ptr<storage::BlobDataSnapshotHandle> handle)
+ : handle_(handle.Pass()) {}
~BlobHandleImpl() override {}
std::string GetUUID() override { return handle_->uuid(); }
private:
- scoped_ptr<storage::BlobDataHandle> handle_;
+ scoped_ptr<storage::BlobDataSnapshotHandle> handle_;
michaeln 2015/01/16 00:09:09 for this particular class we only want to keep the
dmurph 2015/01/16 23:45:56 Right, we want to keep the handle around though, r
};
} // namespace
@@ -69,11 +68,12 @@ scoped_ptr<BlobHandle> ChromeBlobStorageContext::CreateMemoryBackedBlob(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
std::string uuid(base::GenerateGUID());
- scoped_refptr<storage::BlobData> blob_data = new storage::BlobData(uuid);
+ scoped_ptr<storage::BlobDataBuilder> blob_data(
+ new storage::BlobDataBuilder(uuid));
blob_data->AppendData(data, length);
- scoped_ptr<storage::BlobDataHandle> blob_data_handle =
- context_->AddFinishedBlob(blob_data.get());
+ scoped_ptr<storage::BlobDataSnapshotHandle> blob_data_handle =
+ context_->AddFinishedBlob(*blob_data.get());
if (!blob_data_handle)
return scoped_ptr<BlobHandle>();

Powered by Google App Engine
This is Rietveld 408576698