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 #ifndef NET_URL_REQUEST_URL_FETCHER_H_ | 5 #ifndef NET_URL_REQUEST_URL_FETCHER_H_ |
6 #define NET_URL_REQUEST_URL_FETCHER_H_ | 6 #define NET_URL_REQUEST_URL_FETCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Return the URL that this fetcher is processing. | 269 // Return the URL that this fetcher is processing. |
270 virtual const GURL& GetURL() const = 0; | 270 virtual const GURL& GetURL() const = 0; |
271 | 271 |
272 // The status of the URL fetch. | 272 // The status of the URL fetch. |
273 virtual const URLRequestStatus& GetStatus() const = 0; | 273 virtual const URLRequestStatus& GetStatus() const = 0; |
274 | 274 |
275 // The http response code received. Will return RESPONSE_CODE_INVALID | 275 // The http response code received. Will return RESPONSE_CODE_INVALID |
276 // if an error prevented any response from being received. | 276 // if an error prevented any response from being received. |
277 virtual int GetResponseCode() const = 0; | 277 virtual int GetResponseCode() const = 0; |
278 | 278 |
279 // Cookies recieved. | 279 // Cookies received. |
280 virtual const ResponseCookies& GetCookies() const = 0; | 280 virtual const ResponseCookies& GetCookies() const = 0; |
281 | 281 |
282 // Reports that the received content was malformed. | 282 // Reports that the received content was malformed. |
283 virtual void ReceivedContentWasMalformed() = 0; | 283 virtual void ReceivedContentWasMalformed() = 0; |
284 | 284 |
285 // Get the response as a string. Return false if the fetcher was not | 285 // Get the response as a string. Return false if the fetcher was not |
286 // set to store the response as a string. | 286 // set to store the response as a string. |
287 virtual bool GetResponseAsString(std::string* out_response_string) const = 0; | 287 virtual bool GetResponseAsString(std::string* out_response_string) const = 0; |
288 | 288 |
289 // Get the path to the file containing the response body. Returns false | 289 // Get the path to the file containing the response body. Returns false |
290 // if the response body was not saved to a file. If take_ownership is | 290 // if the response body was not saved to a file. If take_ownership is |
291 // true, caller takes responsibility for the file, and it will not | 291 // true, caller takes responsibility for the file, and it will not |
292 // be removed once the URLFetcher is destroyed. User should not take | 292 // be removed once the URLFetcher is destroyed. User should not take |
293 // ownership more than once, or call this method after taking ownership. | 293 // ownership more than once, or call this method after taking ownership. |
294 virtual bool GetResponseAsFilePath( | 294 virtual bool GetResponseAsFilePath( |
295 bool take_ownership, | 295 bool take_ownership, |
296 base::FilePath* out_response_path) const = 0; | 296 base::FilePath* out_response_path) const = 0; |
297 }; | 297 }; |
298 | 298 |
299 } // namespace net | 299 } // namespace net |
300 | 300 |
301 #endif // NET_URL_REQUEST_URL_FETCHER_H_ | 301 #endif // NET_URL_REQUEST_URL_FETCHER_H_ |
OLD | NEW |