| 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 // 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. | 7 // implemented by the embedder. |
| 8 // | 8 // |
| 9 // One of these objects will be created by WebKit for each request. WebKit | 9 // One of these objects will be created by WebKit for each request. WebKit |
| 10 // will own the pointer to the bridge, and will delete it when the request is | 10 // will own the pointer to the bridge, and will delete it when the request is |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 std::string data; | 120 std::string data; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 // Generated by the bridge. This is implemented by our custom resource loader | 123 // Generated by the bridge. This is implemented by our custom resource loader |
| 124 // within webkit. The Peer and it's bridge should have identical lifetimes | 124 // within webkit. The Peer and it's bridge should have identical lifetimes |
| 125 // as they represent each end of a communication channel. | 125 // as they represent each end of a communication channel. |
| 126 // | 126 // |
| 127 // These callbacks mirror net::URLRequest::Delegate and the order and | 127 // These callbacks mirror net::URLRequest::Delegate and the order and |
| 128 // conditions in which they will be called are identical. See url_request.h | 128 // conditions in which they will be called are identical. See url_request.h |
| 129 // for more information. | 129 // for more information. |
| 130 class Peer { | 130 class WEBKIT_CHILD_EXPORT Peer { |
| 131 public: | 131 public: |
| 132 // Called as upload progress is made. | 132 // Called as upload progress is made. |
| 133 // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set | 133 // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set |
| 134 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; | 134 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; |
| 135 | 135 |
| 136 // Called when a redirect occurs. The implementation may return false to | 136 // Called when a redirect occurs. The implementation may return false to |
| 137 // suppress the redirect. The given ResponseInfo provides complete | 137 // suppress the redirect. The given ResponseInfo provides complete |
| 138 // information about the redirect, and new_url is the URL that will be | 138 // information about the redirect, and new_url is the URL that will be |
| 139 // loaded if this method returns true. If this method returns true, the | 139 // loaded if this method returns true. If this method returns true, the |
| 140 // output parameter *has_new_first_party_for_cookies indicates whether the | 140 // output parameter *has_new_first_party_for_cookies indicates whether the |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // methods may be called to construct the body of the request. | 223 // methods may be called to construct the body of the request. |
| 224 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); | 224 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); |
| 225 | 225 |
| 226 private: | 226 private: |
| 227 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 227 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 } // namespace webkit_glue | 230 } // namespace webkit_glue |
| 231 | 231 |
| 232 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ | 232 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ |
| OLD | NEW |