| OLD | NEW |
| 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 { | 16 namespace base { |
| 17 class FilePath; |
| 17 class TaskRunner; | 18 class TaskRunner; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace fileapi { | 21 namespace fileapi { |
| 21 class FileSystemContext; | 22 class FileSystemContext; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 class UploadDataStream; | 26 class UploadDataStream; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace webkit_blob { | 29 namespace webkit_blob { |
| 29 class BlobStorageController; | 30 class BlobStorageController; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace webkit_glue { | 33 namespace webkit_glue { |
| 33 | 34 |
| 34 // A struct used to represent upload data. The data field is populated by | 35 // A struct used to represent upload data. The data field is populated by |
| 35 // WebURLLoader from the data given as WebHTTPBody. | 36 // WebURLLoader from the data given as WebHTTPBody. |
| 36 class WEBKIT_GLUE_EXPORT ResourceRequestBody | 37 class WEBKIT_GLUE_EXPORT ResourceRequestBody |
| 37 : public base::RefCounted<ResourceRequestBody>, | 38 : public base::RefCounted<ResourceRequestBody>, |
| 38 public base::SupportsUserData { | 39 public base::SupportsUserData { |
| 39 public: | 40 public: |
| 40 typedef webkit_base::DataElement Element; | 41 typedef webkit_base::DataElement Element; |
| 41 | 42 |
| 42 ResourceRequestBody(); | 43 ResourceRequestBody(); |
| 43 | 44 |
| 44 void AppendBytes(const char* bytes, int bytes_len); | 45 void AppendBytes(const char* bytes, int bytes_len); |
| 45 void AppendFileRange(const FilePath& file_path, | 46 void AppendFileRange(const base::FilePath& file_path, |
| 46 uint64 offset, uint64 length, | 47 uint64 offset, uint64 length, |
| 47 const base::Time& expected_modification_time); | 48 const base::Time& expected_modification_time); |
| 48 void AppendBlob(const GURL& blob_url); | 49 void AppendBlob(const GURL& blob_url); |
| 49 void AppendFileSystemFileRange(const GURL& url, uint64 offset, uint64 length, | 50 void AppendFileSystemFileRange(const GURL& url, uint64 offset, uint64 length, |
| 50 const base::Time& expected_modification_time); | 51 const base::Time& expected_modification_time); |
| 51 | 52 |
| 52 // Creates a new UploadDataStream from this request body. This also resolves | 53 // Creates a new UploadDataStream from this request body. This also resolves |
| 53 // any blob references using given |blob_controller|. |file_system_context| is | 54 // any blob references using given |blob_controller|. |file_system_context| is |
| 54 // used to create FileStreamReader for files with filesystem URLs. | 55 // used to create FileStreamReader for files with filesystem URLs. |
| 55 // |file_task_runner| is used to perform file operations when the data gets | 56 // |file_task_runner| is used to perform file operations when the data gets |
| (...skipping 27 matching lines...) Expand all Loading... |
| 83 | 84 |
| 84 std::vector<Element> elements_; | 85 std::vector<Element> elements_; |
| 85 int64 identifier_; | 86 int64 identifier_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); | 88 DISALLOW_COPY_AND_ASSIGN(ResourceRequestBody); |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace webkit_glue | 91 } // namespace webkit_glue |
| 91 | 92 |
| 92 #endif // WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_ | 93 #endif // WEBKIT_GLUE_RESOURCE_REQUEST_BODY_H_ |
| OLD | NEW |