| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "storage/browser/blob/blob_url_request_job_factory.h" | 5 #include "storage/browser/blob/blob_url_request_job_factory.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 // static | 31 // static |
| 32 scoped_ptr<net::URLRequest> BlobProtocolHandler::CreateBlobRequest( | 32 scoped_ptr<net::URLRequest> BlobProtocolHandler::CreateBlobRequest( |
| 33 scoped_ptr<BlobDataHandle> blob_data_handle, | 33 scoped_ptr<BlobDataHandle> blob_data_handle, |
| 34 const net::URLRequestContext* request_context, | 34 const net::URLRequestContext* request_context, |
| 35 net::URLRequest::Delegate* request_delegate) { | 35 net::URLRequest::Delegate* request_delegate) { |
| 36 const GURL kBlobUrl("blob://see_user_data/"); | 36 const GURL kBlobUrl("blob://see_user_data/"); |
| 37 scoped_ptr<net::URLRequest> request = request_context->CreateRequest( | 37 scoped_ptr<net::URLRequest> request = request_context->CreateRequest( |
| 38 kBlobUrl, net::DEFAULT_PRIORITY, request_delegate, NULL); | 38 kBlobUrl, net::DEFAULT_PRIORITY, request_delegate); |
| 39 SetRequestedBlobDataHandle(request.get(), blob_data_handle.Pass()); | 39 SetRequestedBlobDataHandle(request.get(), blob_data_handle.Pass()); |
| 40 return request.Pass(); | 40 return request.Pass(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 // static | 43 // static |
| 44 void BlobProtocolHandler::SetRequestedBlobDataHandle( | 44 void BlobProtocolHandler::SetRequestedBlobDataHandle( |
| 45 net::URLRequest* request, | 45 net::URLRequest* request, |
| 46 scoped_ptr<BlobDataHandle> blob_data_handle) { | 46 scoped_ptr<BlobDataHandle> blob_data_handle) { |
| 47 request->SetUserData(&kUserDataKey, blob_data_handle.release()); | 47 request->SetUserData(&kUserDataKey, blob_data_handle.release()); |
| 48 } | 48 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid); | 86 scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID(uuid); |
| 87 scoped_ptr<BlobDataSnapshot> snapshot; | 87 scoped_ptr<BlobDataSnapshot> snapshot; |
| 88 if (handle) { | 88 if (handle) { |
| 89 snapshot = handle->CreateSnapshot().Pass(); | 89 snapshot = handle->CreateSnapshot().Pass(); |
| 90 SetRequestedBlobDataHandle(request, handle.Pass()); | 90 SetRequestedBlobDataHandle(request, handle.Pass()); |
| 91 } | 91 } |
| 92 return snapshot.Pass(); | 92 return snapshot.Pass(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace storage | 95 } // namespace storage |
| OLD | NEW |