| OLD | NEW |
| 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 "webkit/browser/blob/mock_blob_url_request_context.h" |
| 6 | 6 |
| 7 #include "webkit/browser/blob/blob_storage_controller.h" | 7 #include "webkit/browser/blob/blob_storage_controller.h" |
| 8 #include "webkit/browser/blob/blob_url_request_job.h" | 8 #include "webkit/browser/blob/blob_url_request_job.h" |
| 9 #include "webkit/common/blob/blob_data.h" | 9 #include "webkit/common/blob/blob_data.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 virtual ~MockBlobProtocolHandler() {} | 24 virtual ~MockBlobProtocolHandler() {} |
| 25 | 25 |
| 26 virtual net::URLRequestJob* MaybeCreateJob( | 26 virtual net::URLRequestJob* MaybeCreateJob( |
| 27 net::URLRequest* request, | 27 net::URLRequest* request, |
| 28 net::NetworkDelegate* network_delegate) const OVERRIDE { | 28 net::NetworkDelegate* network_delegate) const OVERRIDE { |
| 29 return new BlobURLRequestJob( | 29 return new BlobURLRequestJob( |
| 30 request, | 30 request, |
| 31 network_delegate, | 31 network_delegate, |
| 32 blob_storage_controller_->GetBlobDataFromUrl(request->url()), | 32 blob_storage_controller_->GetBlobDataFromUrl(request->url()), |
| 33 file_system_context_, | 33 file_system_context_, |
| 34 base::MessageLoopProxy::current()); | 34 base::MessageLoopProxy::current().get()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 webkit_blob::BlobStorageController* const blob_storage_controller_; | 38 webkit_blob::BlobStorageController* const blob_storage_controller_; |
| 39 fileapi::FileSystemContext* const file_system_context_; | 39 fileapi::FileSystemContext* const file_system_context_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(MockBlobProtocolHandler); | 41 DISALLOW_COPY_AND_ASSIGN(MockBlobProtocolHandler); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| (...skipping 20 matching lines...) Expand all Loading... |
| 65 scoped_refptr<BlobData> blob_data(new BlobData()); | 65 scoped_refptr<BlobData> blob_data(new BlobData()); |
| 66 blob_data->AppendData(data); | 66 blob_data->AppendData(data); |
| 67 blob_storage_controller_->AddFinishedBlob(blob_url_, blob_data.get()); | 67 blob_storage_controller_->AddFinishedBlob(blob_url_, blob_data.get()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 ScopedTextBlob::~ScopedTextBlob() { | 70 ScopedTextBlob::~ScopedTextBlob() { |
| 71 blob_storage_controller_->RemoveBlob(blob_url_); | 71 blob_storage_controller_->RemoveBlob(blob_url_); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace webkit_blob | 74 } // namespace webkit_blob |
| OLD | NEW |