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

Side by Side Diff: content/public/test/mock_blob_url_request_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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/test/mock_blob_url_request_context.h" 5 #include "content/public/test/mock_blob_url_request_context.h"
6 6
7 #include "storage/browser/blob/blob_storage_context.h" 7 #include "storage/browser/blob/blob_storage_context.h"
8 #include "storage/browser/blob/blob_url_request_job.h" 8 #include "storage/browser/blob/blob_url_request_job.h"
9 #include "storage/browser/blob/blob_url_request_job_factory.h" 9 #include "storage/browser/blob/blob_url_request_job_factory.h"
10 #include "storage/common/blob/blob_data.h" 10 #include "storage/common/blob/blob_data.h"
(...skipping 17 matching lines...) Expand all
28 AssertNoURLRequests(); 28 AssertNoURLRequests();
29 } 29 }
30 30
31 ScopedTextBlob::ScopedTextBlob( 31 ScopedTextBlob::ScopedTextBlob(
32 const MockBlobURLRequestContext& request_context, 32 const MockBlobURLRequestContext& request_context,
33 const std::string& blob_id, 33 const std::string& blob_id,
34 const std::string& data) 34 const std::string& data)
35 : blob_id_(blob_id), 35 : blob_id_(blob_id),
36 context_(request_context.blob_storage_context()) { 36 context_(request_context.blob_storage_context()) {
37 DCHECK(context_); 37 DCHECK(context_);
38 scoped_refptr<storage::BlobData> blob_data(new storage::BlobData(blob_id_)); 38 scoped_ptr<storage::BlobDataBuilder> blob_data(
39 new storage::BlobDataBuilder(blob_id_));
39 if (!data.empty()) 40 if (!data.empty())
40 blob_data->AppendData(data); 41 blob_data->AppendData(data);
41 handle_ = context_->AddFinishedBlob(blob_data.get()); 42 handle_ = context_->AddFinishedBlob(*blob_data.get());
42 } 43 }
43 44
44 ScopedTextBlob::~ScopedTextBlob() { 45 ScopedTextBlob::~ScopedTextBlob() {
45 } 46 }
46 47
47 scoped_ptr<storage::BlobDataHandle> ScopedTextBlob::GetBlobDataHandle() { 48 scoped_ptr<storage::BlobDataSnapshotHandle>
49 ScopedTextBlob::GetBlobDataHandle() {
48 return context_->GetBlobDataFromUUID(blob_id_); 50 return context_->GetBlobDataFromUUID(blob_id_);
49 } 51 }
50 52
51 } // namespace content 53 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698