OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // Called when a chunk of response data is available. This method may | 301 // Called when a chunk of response data is available. This method may |
302 // be called multiple times or not at all if an error occurs. | 302 // be called multiple times or not at all if an error occurs. |
303 virtual void OnReceivedData(const char* data, int len) = 0; | 303 virtual void OnReceivedData(const char* data, int len) = 0; |
304 | 304 |
305 // Called when metadata generated by the renderer is retrieved from the | 305 // Called when metadata generated by the renderer is retrieved from the |
306 // cache. This method may be called zero or one times. | 306 // cache. This method may be called zero or one times. |
307 virtual void OnReceivedCachedMetadata(const char* data, int len) { } | 307 virtual void OnReceivedCachedMetadata(const char* data, int len) { } |
308 | 308 |
309 // Called when the response is complete. This method signals completion of | 309 // Called when the response is complete. This method signals completion of |
310 // the resource load.ff | 310 // the resource load.ff |
311 virtual void OnCompletedRequest(const URLRequestStatus& status, | 311 virtual void OnCompletedRequest(const net::URLRequestStatus& status, |
312 const std::string& security_info, | 312 const std::string& security_info, |
313 const base::Time& completion_time) = 0; | 313 const base::Time& completion_time) = 0; |
314 }; | 314 }; |
315 | 315 |
316 // use Create() for construction, but anybody can delete at any time, | 316 // use Create() for construction, but anybody can delete at any time, |
317 // INCLUDING during processing of callbacks. | 317 // INCLUDING during processing of callbacks. |
318 virtual ~ResourceLoaderBridge(); | 318 virtual ~ResourceLoaderBridge(); |
319 | 319 |
320 // Call this method to make a new instance. | 320 // Call this method to make a new instance. |
321 // | 321 // |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // construction must go through Create() | 377 // construction must go through Create() |
378 ResourceLoaderBridge(); | 378 ResourceLoaderBridge(); |
379 | 379 |
380 private: | 380 private: |
381 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 381 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
382 }; | 382 }; |
383 | 383 |
384 } // namespace webkit_glue | 384 } // namespace webkit_glue |
385 | 385 |
386 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 386 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |