| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // be null if no extra request headers need to be set. | 145 // be null if no extra request headers need to be set. |
| 146 // | 146 // |
| 147 // The WebFrame passed to this function provides context about the origin | 147 // The WebFrame passed to this function provides context about the origin |
| 148 // of the resource request. | 148 // of the resource request. |
| 149 // | 149 // |
| 150 // policy_url is the URL of the document in the top-level window, which may be | 150 // policy_url is the URL of the document in the top-level window, which may be |
| 151 // checked by the third-party cookie blocking policy. | 151 // checked by the third-party cookie blocking policy. |
| 152 // | 152 // |
| 153 // load_flags is composed of the values defined in url_request_load_flags.h | 153 // load_flags is composed of the values defined in url_request_load_flags.h |
| 154 // | 154 // |
| 155 // mixed_content when true indicates that the resource associated with this | |
| 156 // request is over HTTP when the main page was loaded over HTTPS. | |
| 157 // | |
| 158 // request_type indicates if the current request is the main frame load, a | 155 // request_type indicates if the current request is the main frame load, a |
| 159 // sub-frame load, or a sub objects load. | 156 // sub-frame load, or a sub objects load. |
| 160 static ResourceLoaderBridge* Create(WebFrame* frame, | 157 static ResourceLoaderBridge* Create(WebFrame* frame, |
| 161 const std::string& method, | 158 const std::string& method, |
| 162 const GURL& url, | 159 const GURL& url, |
| 163 const GURL& policy_url, | 160 const GURL& policy_url, |
| 164 const GURL& referrer, | 161 const GURL& referrer, |
| 162 const std::string& frame_origin, |
| 163 const std::string& main_frame_origin, |
| 165 const std::string& headers, | 164 const std::string& headers, |
| 166 int load_flags, | 165 int load_flags, |
| 167 int origin_pid, | 166 int origin_pid, |
| 168 ResourceType::Type request_type, | 167 ResourceType::Type request_type); |
| 169 bool mixed_content); | |
| 170 | 168 |
| 171 // Call this method before calling Start() to append a chunk of binary data | 169 // Call this method before calling Start() to append a chunk of binary data |
| 172 // to the request body. May only be used with HTTP(S) POST requests. | 170 // to the request body. May only be used with HTTP(S) POST requests. |
| 173 virtual void AppendDataToUpload(const char* data, int data_len) = 0; | 171 virtual void AppendDataToUpload(const char* data, int data_len) = 0; |
| 174 | 172 |
| 175 // Call this method before calling Start() to append the contents of a file | 173 // Call this method before calling Start() to append the contents of a file |
| 176 // to the request body. May only be used with HTTP(S) POST requests. | 174 // to the request body. May only be used with HTTP(S) POST requests. |
| 177 void AppendFileToUpload(const std::wstring& file_path) { | 175 void AppendFileToUpload(const std::wstring& file_path) { |
| 178 AppendFileRangeToUpload(file_path, 0, kuint64max); | 176 AppendFileRangeToUpload(file_path, 0, kuint64max); |
| 179 } | 177 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 210 // construction must go through Create() | 208 // construction must go through Create() |
| 211 ResourceLoaderBridge(); | 209 ResourceLoaderBridge(); |
| 212 | 210 |
| 213 private: | 211 private: |
| 214 DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge); | 212 DISALLOW_EVIL_CONSTRUCTORS(ResourceLoaderBridge); |
| 215 }; | 213 }; |
| 216 | 214 |
| 217 } // namespace webkit_glue | 215 } // namespace webkit_glue |
| 218 | 216 |
| 219 #endif // RESOURCE_LOADER_BRIDGE_ | 217 #endif // RESOURCE_LOADER_BRIDGE_ |
| OLD | NEW |