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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 GURL url; | 252 GURL url; |
253 | 253 |
254 // The response data. | 254 // The response data. |
255 std::string data; | 255 std::string data; |
256 }; | 256 }; |
257 | 257 |
258 // Generated by the bridge. This is implemented by our custom resource loader | 258 // Generated by the bridge. This is implemented by our custom resource loader |
259 // within webkit. The Peer and it's bridge should have identical lifetimes | 259 // within webkit. The Peer and it's bridge should have identical lifetimes |
260 // as they represent each end of a communication channel. | 260 // as they represent each end of a communication channel. |
261 // | 261 // |
262 // These callbacks mirror URLRequest::Delegate and the order and conditions | 262 // These callbacks mirror net::URLRequest::Delegate and the order and |
263 // in which they will be called are identical. See url_request.h for more | 263 // conditions in which they will be called are identical. See url_request.h |
264 // information. | 264 // for more information. |
265 class Peer { | 265 class Peer { |
266 public: | 266 public: |
267 virtual ~Peer() {} | 267 virtual ~Peer() {} |
268 | 268 |
269 // Called as upload progress is made. | 269 // Called as upload progress is made. |
270 // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set | 270 // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set |
271 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; | 271 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; |
272 | 272 |
273 // Called when a redirect occurs. The implementation may return false to | 273 // Called when a redirect occurs. The implementation may return false to |
274 // suppress the redirect. The given ResponseInfo provides complete | 274 // suppress the redirect. The given ResponseInfo provides complete |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // construction must go through Create() | 374 // construction must go through Create() |
375 ResourceLoaderBridge(); | 375 ResourceLoaderBridge(); |
376 | 376 |
377 private: | 377 private: |
378 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 378 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
379 }; | 379 }; |
380 | 380 |
381 } // namespace webkit_glue | 381 } // namespace webkit_glue |
382 | 382 |
383 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 383 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |