[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / browser / loader / upload_data_stream_builder.h
blob228aade7979813c9f1db1f5766b3422b929917b8
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"
11 namespace base {
12 class TaskRunner;
15 namespace storage {
16 class FileSystemContext;
19 namespace net {
20 class UploadDataStream;
23 namespace storage {
24 class BlobStorageContext;
27 namespace content {
29 class ResourceRequestBody;
31 class CONTENT_EXPORT UploadDataStreamBuilder {
32 public:
33 // Creates a new UploadDataStream from this request body.
35 // If |body| contains any blob references, the caller is responsible for
36 // making sure them outlive the returned value of UploadDataStream. We do this
37 // by binding the BlobDataHandles of them to ResourceRequestBody in
38 // ResourceDispatcherHostImpl::BeginRequest().
40 // |file_system_context| is used to create a FileStreamReader for files with
41 // filesystem URLs. |file_task_runner| is used to perform file operations
42 // when the data gets uploaded.
43 static scoped_ptr<net::UploadDataStream> Build(
44 ResourceRequestBody* body,
45 storage::BlobStorageContext* blob_context,
46 storage::FileSystemContext* file_system_context,
47 base::TaskRunner* file_task_runner);
50 } // namespace content
52 #endif // CONTENT_BROWSER_LOADER_UPLOAD_DATA_STREAM_BUILDER_H_