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 NET_BASE_UPLOAD_DATA_H_ | 5 #ifndef NET_BASE_UPLOAD_DATA_H_ |
6 #define NET_BASE_UPLOAD_DATA_H_ | 6 #define NET_BASE_UPLOAD_DATA_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 public base::SupportsUserData { | 46 public base::SupportsUserData { |
47 public: | 47 public: |
48 UploadData(); | 48 UploadData(); |
49 | 49 |
50 void AppendBytes(const char* bytes, int bytes_len); | 50 void AppendBytes(const char* bytes, int bytes_len); |
51 | 51 |
52 void AppendFileRange(const FilePath& file_path, | 52 void AppendFileRange(const FilePath& file_path, |
53 uint64 offset, uint64 length, | 53 uint64 offset, uint64 length, |
54 const base::Time& expected_modification_time); | 54 const base::Time& expected_modification_time); |
55 | 55 |
56 void AppendBlob(const GURL& blob_url); | |
57 | |
58 // Adds the given chunk of bytes to be sent immediately with chunked transfer | 56 // Adds the given chunk of bytes to be sent immediately with chunked transfer |
59 // encoding. | 57 // encoding. |
60 void AppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); | 58 void AppendChunk(const char* bytes, int bytes_len, bool is_last_chunk); |
61 | 59 |
62 // Sets the callback to be invoked when a new chunk is available to upload. | 60 // Sets the callback to be invoked when a new chunk is available to upload. |
63 void set_chunk_callback(ChunkCallback* callback); | 61 void set_chunk_callback(ChunkCallback* callback); |
64 | 62 |
65 // Initializes the object to send chunks of upload data over time rather | 63 // Initializes the object to send chunks of upload data over time rather |
66 // than all at once. | 64 // than all at once. |
67 void set_is_chunked(bool set) { is_chunked_ = set; } | 65 void set_is_chunked(bool set) { is_chunked_ = set; } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 int64 identifier_; | 119 int64 identifier_; |
122 ChunkCallback* chunk_callback_; | 120 ChunkCallback* chunk_callback_; |
123 bool is_chunked_; | 121 bool is_chunked_; |
124 | 122 |
125 DISALLOW_COPY_AND_ASSIGN(UploadData); | 123 DISALLOW_COPY_AND_ASSIGN(UploadData); |
126 }; | 124 }; |
127 | 125 |
128 } // namespace net | 126 } // namespace net |
129 | 127 |
130 #endif // NET_BASE_UPLOAD_DATA_H_ | 128 #endif // NET_BASE_UPLOAD_DATA_H_ |
OLD | NEW |