| 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 |
| 25 // A struct used to represent upload data. The data field is populated by | 27 // A struct used to represent upload data. The data field is populated by |
| 26 // WebURLLoader from the data given as WebHTTPBody. | 28 // WebURLLoader from the data given as WebHTTPBody. |
| 27 class CONTENT_EXPORT ResourceRequestBody | 29 class CONTENT_EXPORT ResourceRequestBody |
| 28 : public base::RefCountedThreadSafe<ResourceRequestBody>, | 30 : public base::RefCountedThreadSafe<ResourceRequestBody>, |
| 29 public base::SupportsUserData { | 31 public base::SupportsUserData { |
| 30 public: | 32 public: |
| 31 typedef storage::DataElement Element; | 33 typedef storage::DataElement Element; |
| 32 | 34 |
| 33 ResourceRequestBody(); | 35 ResourceRequestBody(); |
| 34 | 36 |
| 37 void AppendExplodedHTTPBodyElement(const ExplodedHttpBodyElement& element); |
| 38 |
| 35 void AppendBytes(const char* bytes, int bytes_len); | 39 void AppendBytes(const char* bytes, int bytes_len); |
| 36 void AppendFileRange(const base::FilePath& file_path, | 40 void AppendFileRange(const base::FilePath& file_path, |
| 37 uint64_t offset, | 41 uint64_t offset, |
| 38 uint64_t length, | 42 uint64_t length, |
| 39 const base::Time& expected_modification_time); | 43 const base::Time& expected_modification_time); |
| 40 void AppendBlob(const std::string& uuid); | 44 void AppendBlob(const std::string& uuid); |
| 41 void AppendFileSystemFileRange(const GURL& url, | 45 void AppendFileSystemFileRange(const GURL& url, |
| 42 uint64_t offset, | 46 uint64_t offset, |
| 43 uint64_t length, | 47 uint64_t length, |
| 44 const base::Time& expected_modification_time); | 48 const base::Time& expected_modification_time); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 | 65 |
| 62 std::vector<Element> elements_; | 66 std::vector<Element> elements_; |
| 63 int64_t identifier_; | 67 int64_t identifier_; |
| 64 | 68 |
| 65 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); | 69 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 } // namespace content | 72 } // namespace content |
| 69 | 73 |
| 70 #endif // CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ | 74 #endif // CONTENT_COMMON_RESOURCE_REQUEST_BODY_H_ |
| OLD | NEW |