Chromium Code Reviews| 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 |
| 11 // will own the pointer to the bridge, and will delete it when the request is | 11 // will own the pointer to the bridge, and will delete it when the request is |
| 12 // no longer needed. | 12 // no longer needed. |
| 13 // | 13 // |
| 14 // In turn, the bridge's owner on the WebKit end will implement the Peer | 14 // In turn, the bridge's owner on the WebKit end will implement the Peer |
| 15 // interface, which we will use to communicate notifications back. | 15 // interface, which we will use to communicate notifications back. |
| 16 | 16 |
| 17 #ifndef RESOURCE_LOADER_BRIDGE_H_ | 17 #ifndef WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| 18 #define RESOURCE_LOADER_BRIDGE_H_ | 18 #define WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| 19 | 19 |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #if defined(OS_POSIX) | 21 #if defined(OS_POSIX) |
| 22 #include "base/file_descriptor_posix.h" | 22 #include "base/file_descriptor_posix.h" |
| 23 #endif | 23 #endif |
| 24 #include "base/platform_file.h" | 24 #include "base/platform_file.h" |
| 25 #include "base/ref_counted.h" | 25 #include "base/ref_counted.h" |
| 26 #include "base/time.h" | 26 #include "base/time.h" |
| 27 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
| 28 #include "net/url_request/url_request_status.h" | 28 #include "net/url_request/url_request_status.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 public: | 103 public: |
| 104 virtual ~Peer() {} | 104 virtual ~Peer() {} |
| 105 | 105 |
| 106 // Called as upload progress is made. | 106 // Called as upload progress is made. |
| 107 // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set | 107 // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set |
| 108 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; | 108 virtual void OnUploadProgress(uint64 position, uint64 size) = 0; |
| 109 | 109 |
| 110 // Called when a redirect occurs. The implementation may return false to | 110 // Called when a redirect occurs. The implementation may return false to |
| 111 // suppress the redirect. The given ResponseInfo provides complete | 111 // suppress the redirect. The given ResponseInfo provides complete |
| 112 // information about the redirect, and new_url is the URL that will be | 112 // information about the redirect, and new_url is the URL that will be |
| 113 // loaded if this method returns true. | 113 // loaded if this method returns true. If this method returns true, it |
| 114 // stores in *new_first_party_for_cookies the new URL that should be | |
| 115 // consulted for the third-party cookie blocking policy. If the cookie | |
| 116 // policy URL doesn't need changing, it stores an empty, invalid URL in | |
| 117 // *new_first_party_for_cookies. | |
| 114 virtual bool OnReceivedRedirect(const GURL& new_url, | 118 virtual bool OnReceivedRedirect(const GURL& new_url, |
| 115 const ResponseInfo& info) = 0; | 119 const ResponseInfo& info, |
| 120 GURL* new_first_party_for_cookies) = 0; | |
|
darin (slow to review)
2009/11/16 17:59:50
nit: down below, this is called the "policy_url" .
wtc
2009/11/16 20:25:58
I will rename policy_url to first_party_for_cookie
| |
| 116 | 121 |
| 117 // Called when response headers are available (after all redirects have | 122 // Called when response headers are available (after all redirects have |
| 118 // been followed). |content_filtered| is set to true if the contents is | 123 // been followed). |content_filtered| is set to true if the contents is |
| 119 // altered or replaced (usually for security reasons when the resource is | 124 // altered or replaced (usually for security reasons when the resource is |
| 120 // deemed unsafe). | 125 // deemed unsafe). |
| 121 virtual void OnReceivedResponse(const ResponseInfo& info, | 126 virtual void OnReceivedResponse(const ResponseInfo& info, |
| 122 bool content_filtered) = 0; | 127 bool content_filtered) = 0; |
| 123 | 128 |
| 124 // Called when a chunk of response data is available. This method may | 129 // Called when a chunk of response data is available. This method may |
| 125 // be called multiple times or not at all if an error occurs. | 130 // be called multiple times or not at all if an error occurs. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 protected: | 230 protected: |
| 226 // construction must go through Create() | 231 // construction must go through Create() |
| 227 ResourceLoaderBridge(); | 232 ResourceLoaderBridge(); |
| 228 | 233 |
| 229 private: | 234 private: |
| 230 DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge); | 235 DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge); |
| 231 }; | 236 }; |
| 232 | 237 |
| 233 } // namespace webkit_glue | 238 } // namespace webkit_glue |
| 234 | 239 |
| 235 #endif // RESOURCE_LOADER_BRIDGE_ | 240 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| OLD | NEW |