OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMMON_RESOURCE_REQUEST_BODY_H_ | 5 #ifndef CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ |
6 #define CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ | 6 #define CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/supports_user_data.h" | 14 #include "base/supports_user_data.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "storage/common/data_element.h" | 16 #include "storage/common/data_element.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class FilePath; | 20 class FilePath; |
21 } | 21 } |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 struct ExplodedHttpBodyElement; | |
26 | |
27 // A struct used to represent upload data. The data field is populated by | 25 // A struct used to represent upload data. The data field is populated by |
28 // WebURLLoader from the data given as WebHTTPBody. | 26 // WebURLLoader from the data given as WebHTTPBody. |
29 class CONTENT_EXPORT ResourceRequestBody | 27 class CONTENT_EXPORT ResourceRequestBody |
30 : public base::RefCountedThreadSafe<ResourceRequestBody>, | 28 : public base::RefCountedThreadSafe<ResourceRequestBody>, |
31 public base::SupportsUserData { | 29 public base::SupportsUserData { |
32 public: | 30 public: |
33 typedef storage::DataElement Element; | 31 typedef storage::DataElement Element; |
34 | 32 |
35 ResourceRequestBody(); | 33 ResourceRequestBody(); |
36 | 34 |
37 void AppendExplodedHTTPBodyElement(const ExplodedHttpBodyElement& element); | |
38 | |
39 void AppendBytes(const char* bytes, int bytes_len); | 35 void AppendBytes(const char* bytes, int bytes_len); |
40 void AppendFileRange(const base::FilePath& file_path, | 36 void AppendFileRange(const base::FilePath& file_path, |
41 uint64_t offset, | 37 uint64_t offset, |
42 uint64_t length, | 38 uint64_t length, |
43 const base::Time& expected_modification_time); | 39 const base::Time& expected_modification_time); |
44 void AppendBlob(const std::string& uuid); | 40 void AppendBlob(const std::string& uuid); |
45 void AppendFileSystemFileRange(const GURL& url, | 41 void AppendFileSystemFileRange(const GURL& url, |
46 uint64_t offset, | 42 uint64_t offset, |
47 uint64_t length, | 43 uint64_t length, |
48 const base::Time& expected_modification_time); | 44 const base::Time& expected_modification_time); |
(...skipping 16 matching lines...) Expand all Loading... |
65 | 61 |
66 std::vector<Element> elements_; | 62 std::vector<Element> elements_; |
67 int64_t identifier_; | 63 int64_t identifier_; |
68 | 64 |
69 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); | 65 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); |
70 }; | 66 }; |
71 | 67 |
72 } // namespace content | 68 } // namespace content |
73 | 69 |
74 #endif // CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ | 70 #endif // CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ |
OLD | NEW |