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

Side by Side Diff: content/public/test/mock_blob_url_request_context.cc

Issue 146963006: Move blob/mock_blob_url_request_context to content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix duplicate GYPI entries (should fix link errors on Android and Win) Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/browser/blob/mock_blob_url_request_context.h" 5 #include "content/public/test/mock_blob_url_request_context.h"
6 6
7 #include "webkit/browser/blob/blob_storage_context.h" 7 #include "webkit/browser/blob/blob_storage_context.h"
8 #include "webkit/browser/blob/blob_url_request_job.h" 8 #include "webkit/browser/blob/blob_url_request_job.h"
9 #include "webkit/browser/blob/blob_url_request_job_factory.h" 9 #include "webkit/browser/blob/blob_url_request_job_factory.h"
10 #include "webkit/common/blob/blob_data.h" 10 #include "webkit/common/blob/blob_data.h"
11 11
12 12
13 namespace webkit_blob { 13 namespace content {
14 14
15 MockBlobURLRequestContext::MockBlobURLRequestContext( 15 MockBlobURLRequestContext::MockBlobURLRequestContext(
16 fileapi::FileSystemContext* file_system_context) 16 fileapi::FileSystemContext* file_system_context)
17 : blob_storage_context_(new BlobStorageContext) { 17 : blob_storage_context_(new webkit_blob::BlobStorageContext) {
18 // Job factory owns the protocol handler. 18 // Job factory owns the protocol handler.
19 job_factory_.SetProtocolHandler( 19 job_factory_.SetProtocolHandler(
20 "blob", new BlobProtocolHandler(blob_storage_context_.get(), 20 "blob", new webkit_blob::BlobProtocolHandler(blob_storage_context_.get(),
21 file_system_context, 21 file_system_context,
22 base::MessageLoopProxy::current())); 22 base::MessageLoopProxy::current()));
23 set_job_factory(&job_factory_); 23 set_job_factory(&job_factory_);
24 } 24 }
25 25
26 MockBlobURLRequestContext::~MockBlobURLRequestContext() { 26 MockBlobURLRequestContext::~MockBlobURLRequestContext() {
27 } 27 }
28 28
29 ScopedTextBlob::ScopedTextBlob( 29 ScopedTextBlob::ScopedTextBlob(
30 const MockBlobURLRequestContext& request_context, 30 const MockBlobURLRequestContext& request_context,
31 const std::string& blob_id, 31 const std::string& blob_id,
32 const std::string& data) 32 const std::string& data)
33 : blob_id_(blob_id), 33 : blob_id_(blob_id),
34 context_(request_context.blob_storage_context()) { 34 context_(request_context.blob_storage_context()) {
35 DCHECK(context_); 35 DCHECK(context_);
36 scoped_refptr<BlobData> blob_data(new BlobData(blob_id_)); 36 scoped_refptr<webkit_blob::BlobData> blob_data(
37 new webkit_blob::BlobData(blob_id_));
37 if (!data.empty()) 38 if (!data.empty())
38 blob_data->AppendData(data); 39 blob_data->AppendData(data);
39 handle_ = context_->AddFinishedBlob(blob_data); 40 handle_ = context_->AddFinishedBlob(blob_data);
40 } 41 }
41 42
42 ScopedTextBlob::~ScopedTextBlob() { 43 ScopedTextBlob::~ScopedTextBlob() {
43 } 44 }
44 45
45 scoped_ptr<BlobDataHandle> ScopedTextBlob::GetBlobDataHandle() { 46 scoped_ptr<webkit_blob::BlobDataHandle> ScopedTextBlob::GetBlobDataHandle() {
46 return context_->GetBlobDataFromUUID(blob_id_); 47 return context_->GetBlobDataFromUUID(blob_id_);
47 } 48 }
48 49
49 } // namespace webkit_blob 50 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/mock_blob_url_request_context.h ('k') | webkit/browser/blob/mock_blob_url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698