OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_ |
6 #define CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_ | 6 #define CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class SingleThreadTaskRunner; | 13 class SingleThreadTaskRunner; |
14 } | 14 } |
15 | 15 |
16 namespace storage { | 16 namespace storage { |
17 class FileSystemContext; | 17 class FileSystemContext; |
18 } | 18 } |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 class UploadDataStream; | 21 class UploadDataStream; |
22 } | 22 } |
23 | 23 |
24 namespace storage { | 24 namespace storage { |
25 class BlobStorageContext; | 25 class BlobStorageContext; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 class ResourceRequestBodyImpl; | 30 class ResourceRequestBody; |
31 | 31 |
32 class CONTENT_EXPORT UploadDataStreamBuilder { | 32 class CONTENT_EXPORT UploadDataStreamBuilder { |
33 public: | 33 public: |
34 // Creates a new UploadDataStream from this request body. | 34 // Creates a new UploadDataStream from this request body. |
35 // | 35 // |
36 // If |body| contains any blob references, the caller is responsible for | 36 // If |body| contains any blob references, the caller is responsible for |
37 // making sure them outlive the returned value of UploadDataStream. We do this | 37 // making sure them outlive the returned value of UploadDataStream. We do this |
38 // by binding the BlobDataHandles of them to ResourceRequestBodyImpl in | 38 // by binding the BlobDataHandles of them to ResourceRequestBody in |
39 // ResourceDispatcherHostImpl::BeginRequest(). | 39 // ResourceDispatcherHostImpl::BeginRequest(). |
40 // | 40 // |
41 // |file_system_context| is used to create a FileStreamReader for files with | 41 // |file_system_context| is used to create a FileStreamReader for files with |
42 // filesystem URLs. |file_task_runner| is used to perform file operations | 42 // filesystem URLs. |file_task_runner| is used to perform file operations |
43 // when the data gets uploaded. | 43 // when the data gets uploaded. |
44 static std::unique_ptr<net::UploadDataStream> Build( | 44 static std::unique_ptr<net::UploadDataStream> Build( |
45 ResourceRequestBodyImpl* body, | 45 ResourceRequestBody* body, |
46 storage::BlobStorageContext* blob_context, | 46 storage::BlobStorageContext* blob_context, |
47 storage::FileSystemContext* file_system_context, | 47 storage::FileSystemContext* file_system_context, |
48 base::SingleThreadTaskRunner* file_task_runner); | 48 base::SingleThreadTaskRunner* file_task_runner); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace content | 51 } // namespace content |
52 | 52 |
53 #endif // CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_ | 53 #endif // CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_ |
OLD | NEW |