Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1365)

Side by Side Diff: webkit/glue/resource_request_body.h

Issue 11778016: net: Stop using base::WorkerPool from UploadFileElementReader (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix CF Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | webkit/glue/resource_request_body.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_ 5 #ifndef WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_
6 #define WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_ 6 #define WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/supports_user_data.h" 12 #include "base/supports_user_data.h"
13 #include "webkit/base/data_element.h" 13 #include "webkit/base/data_element.h"
14 #include "webkit/glue/webkit_glue_export.h" 14 #include "webkit/glue/webkit_glue_export.h"
15 15
16 namespace base {
17 class TaskRunner;
18 }
19
16 namespace net { 20 namespace net {
17 class UploadDataStream; 21 class UploadDataStream;
18 } 22 }
19 23
20 namespace webkit_blob { 24 namespace webkit_blob {
21 class BlobStorageController; 25 class BlobStorageController;
22 } 26 }
23 27
24 namespace webkit_glue { 28 namespace webkit_glue {
25 29
26 // A struct used to represent upload data. The data field is populated by 30 // A struct used to represent upload data. The data field is populated by
27 // WebURLLoader from the data given as WebHTTPBody. 31 // WebURLLoader from the data given as WebHTTPBody.
28 class WEBKIT_GLUE_EXPORT ResourceRequestBody 32 class WEBKIT_GLUE_EXPORT ResourceRequestBody
29 : public base::RefCounted<ResourceRequestBody>, 33 : public base::RefCounted<ResourceRequestBody>,
30 public base::SupportsUserData { 34 public base::SupportsUserData {
31 public: 35 public:
32 typedef webkit_base::DataElement Element; 36 typedef webkit_base::DataElement Element;
33 37
34 ResourceRequestBody(); 38 ResourceRequestBody();
35 39
36 void AppendBytes(const char* bytes, int bytes_len); 40 void AppendBytes(const char* bytes, int bytes_len);
37 void AppendFileRange(const FilePath& file_path, 41 void AppendFileRange(const FilePath& file_path,
38 uint64 offset, uint64 length, 42 uint64 offset, uint64 length,
39 const base::Time& expected_modification_time); 43 const base::Time& expected_modification_time);
40 void AppendBlob(const GURL& blob_url); 44 void AppendBlob(const GURL& blob_url);
41 void AppendFileSystemFileRange(const GURL& url, uint64 offset, uint64 length, 45 void AppendFileSystemFileRange(const GURL& url, uint64 offset, uint64 length,
42 const base::Time& expected_modification_time); 46 const base::Time& expected_modification_time);
43 47
44 // Creates a new UploadDataStream from this request body. This also resolves 48 // Creates a new UploadDataStream from this request body. This also resolves
45 // any blob references using given |blob_controller|. 49 // any blob references using given |blob_controller|. |task_runner| is used to
46 // TODO(kinuko): Clean up this hack. 50 // perform file operations when the data gets uploaded.
47 net::UploadDataStream* ResolveElementsAndCreateUploadDataStream( 51 net::UploadDataStream* ResolveElementsAndCreateUploadDataStream(
48 webkit_blob::BlobStorageController* blob_controller); 52 webkit_blob::BlobStorageController* blob_controller,
53 base::TaskRunner* task_runner);
49 54
50 const std::vector<Element>* elements() const { return &elements_; } 55 const std::vector<Element>* elements() const { return &elements_; }
51 std::vector<Element>* elements_mutable() { return &elements_; } 56 std::vector<Element>* elements_mutable() { return &elements_; }
52 void swap_elements(std::vector<Element>* elements) { 57 void swap_elements(std::vector<Element>* elements) {
53 elements_.swap(*elements); 58 elements_.swap(*elements);
54 } 59 }
55 60
56 // Identifies a particular upload instance, which is used by the cache to 61 // Identifies a particular upload instance, which is used by the cache to
57 // formulate a cache key. This value should be unique across browser 62 // formulate a cache key. This value should be unique across browser
58 // sessions. A value of 0 is used to indicate an unspecified identifier. 63 // sessions. A value of 0 is used to indicate an unspecified identifier.
(...skipping 12 matching lines...) Expand all
71 76
72 std::vector<Element> elements_; 77 std::vector<Element> elements_;
73 int64 identifier_; 78 int64 identifier_;
74 79
75 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); 80 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody);
76 }; 81 };
77 82
78 } // namespace webkit_glue 83 } // namespace webkit_glue
79 84
80 #endif // WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_ 85 #endif // WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | webkit/glue/resource_request_body.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698