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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_
6 #define CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/content_export.h"
16 class FileSystemContext
;
20 class UploadDataStream
;
23 namespace webkit_blob
{
24 class BlobStorageContext
;
27 namespace webkit_glue
{
28 class ResourceRequestBody
;
33 class CONTENT_EXPORT UploadDataStreamBuilder
{
35 // Creates a new UploadDataStream from this request body.
37 // This also resolves any blob references using the given |blob_context|
38 // and binds those blob references to the ResourceRequestBody ensuring that
39 // the blob data remains valid for the lifetime of the ResourceRequestBody
42 // |file_system_context| is used to create a FileStreamReader for files with
43 // filesystem URLs. |file_task_runner| is used to perform file operations
44 // when the data gets uploaded.
45 static scoped_ptr
<net::UploadDataStream
> Build(
46 webkit_glue::ResourceRequestBody
* body
,
47 webkit_blob::BlobStorageContext
* blob_context
,
48 fileapi::FileSystemContext
* file_system_context
,
49 base::TaskRunner
* file_task_runner
);
52 } // namespace content
54 #endif // CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_