OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // The intent of this file is to provide a type-neutral abstraction between | 5 // The intent of this file is to provide a type-neutral abstraction between |
6 // Chrome and WebKit for resource loading. This pure-virtual interface is | 6 // Chrome and WebKit for resource loading. This pure-virtual interface is |
7 // implemented by the embedder, which also provides a factory method Create | 7 // implemented by the embedder, which also provides a factory method Create |
8 // to instantiate this object. | 8 // to instantiate this object. |
9 // | 9 // |
10 // One of these objects will be created by WebKit for each request. WebKit | 10 // One of these objects will be created by WebKit for each request. WebKit |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // methods may be called to construct the body of the request. | 201 // methods may be called to construct the body of the request. |
202 static ResourceLoaderBridge* Create(const RequestInfo& request_info); | 202 static ResourceLoaderBridge* Create(const RequestInfo& request_info); |
203 | 203 |
204 // Call this method before calling Start() to append a chunk of binary data | 204 // Call this method before calling Start() to append a chunk of binary data |
205 // to the request body. May only be used with HTTP(S) POST requests. | 205 // to the request body. May only be used with HTTP(S) POST requests. |
206 virtual void AppendDataToUpload(const char* data, int data_len) = 0; | 206 virtual void AppendDataToUpload(const char* data, int data_len) = 0; |
207 | 207 |
208 // Call this method before calling Start() to append the contents of a file | 208 // Call this method before calling Start() to append the contents of a file |
209 // to the request body. May only be used with HTTP(S) POST requests. | 209 // to the request body. May only be used with HTTP(S) POST requests. |
210 void AppendFileToUpload(const FilePath& file_path) { | 210 void AppendFileToUpload(const FilePath& file_path) { |
211 AppendFileRangeToUpload(file_path, 0, kuint64max); | 211 AppendFileRangeToUpload(file_path, 0, kuint64max, base::Time()); |
212 } | 212 } |
213 | 213 |
214 // Call this method before calling Start() to append the contents of a file | 214 // Call this method before calling Start() to append the contents of a file |
215 // to the request body. May only be used with HTTP(S) POST requests. | 215 // to the request body. May only be used with HTTP(S) POST requests. |
216 virtual void AppendFileRangeToUpload(const FilePath& file_path, | 216 virtual void AppendFileRangeToUpload( |
217 uint64 offset, uint64 length) = 0; | 217 const FilePath& file_path, |
| 218 uint64 offset, |
| 219 uint64 length, |
| 220 const base::Time& expected_modification_time) = 0; |
218 | 221 |
219 // Call this method before calling Start() to assign an upload identifier to | 222 // Call this method before calling Start() to assign an upload identifier to |
220 // this request. This is used to enable caching of POST responses. A value | 223 // this request. This is used to enable caching of POST responses. A value |
221 // of 0 implies the unspecified identifier. | 224 // of 0 implies the unspecified identifier. |
222 virtual void SetUploadIdentifier(int64 identifier) = 0; | 225 virtual void SetUploadIdentifier(int64 identifier) = 0; |
223 | 226 |
224 // Call this method to initiate the request. If this method succeeds, then | 227 // Call this method to initiate the request. If this method succeeds, then |
225 // the peer's methods will be called asynchronously to report various events. | 228 // the peer's methods will be called asynchronously to report various events. |
226 virtual bool Start(Peer* peer) = 0; | 229 virtual bool Start(Peer* peer) = 0; |
227 | 230 |
(...skipping 20 matching lines...) Expand all Loading... |
248 // construction must go through Create() | 251 // construction must go through Create() |
249 ResourceLoaderBridge(); | 252 ResourceLoaderBridge(); |
250 | 253 |
251 private: | 254 private: |
252 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 255 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
253 }; | 256 }; |
254 | 257 |
255 } // namespace webkit_glue | 258 } // namespace webkit_glue |
256 | 259 |
257 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 260 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |