| 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 // This file contains URLFetcher, a wrapper around net::URLRequest that handles | 5 // This file contains URLFetcher, a wrapper around net::URLRequest that handles |
| 6 // low-level details like thread safety, ref counting, and incremental buffer | 6 // low-level details like thread safety, ref counting, and incremental buffer |
| 7 // reading. This is useful for callers who simply want to get the data from a | 7 // reading. This is useful for callers who simply want to get the data from a |
| 8 // URL and don't care about all the nitty-gritty details. | 8 // URL and don't care about all the nitty-gritty details. |
| 9 // | 9 // |
| 10 // NOTE(willchan): Only one "IO" thread is supported for URLFetcher. This is a | 10 // NOTE(willchan): Only one "IO" thread is supported for URLFetcher. This is a |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 virtual void SetLoadFlags(int load_flags) OVERRIDE; | 44 virtual void SetLoadFlags(int load_flags) OVERRIDE; |
| 45 virtual int GetLoadFlags() const OVERRIDE; | 45 virtual int GetLoadFlags() const OVERRIDE; |
| 46 virtual void SetReferrer(const std::string& referrer) OVERRIDE; | 46 virtual void SetReferrer(const std::string& referrer) OVERRIDE; |
| 47 virtual void SetExtraRequestHeaders( | 47 virtual void SetExtraRequestHeaders( |
| 48 const std::string& extra_request_headers) OVERRIDE; | 48 const std::string& extra_request_headers) OVERRIDE; |
| 49 virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE; | 49 virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE; |
| 50 virtual void GetExtraRequestHeaders( | 50 virtual void GetExtraRequestHeaders( |
| 51 net::HttpRequestHeaders* headers) OVERRIDE; | 51 net::HttpRequestHeaders* headers) OVERRIDE; |
| 52 virtual void SetRequestContext( | 52 virtual void SetRequestContext( |
| 53 net::URLRequestContextGetter* request_context_getter) OVERRIDE; | 53 net::URLRequestContextGetter* request_context_getter) OVERRIDE; |
| 54 virtual void SetContentURLRequestUserData( |
| 55 content::ContentURLRequestUserData* user_data) OVERRIDE; |
| 54 virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE; | 56 virtual void SetAutomaticallyRetryOn5xx(bool retry) OVERRIDE; |
| 55 virtual void SetMaxRetries(int max_retries) OVERRIDE; | 57 virtual void SetMaxRetries(int max_retries) OVERRIDE; |
| 56 virtual int GetMaxRetries() const OVERRIDE; | 58 virtual int GetMaxRetries() const OVERRIDE; |
| 57 virtual base::TimeDelta GetBackoffDelay() const OVERRIDE; | 59 virtual base::TimeDelta GetBackoffDelay() const OVERRIDE; |
| 58 virtual void SaveResponseToTemporaryFile( | 60 virtual void SaveResponseToTemporaryFile( |
| 59 scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE; | 61 scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE; |
| 60 virtual net::HttpResponseHeaders* GetResponseHeaders() const OVERRIDE; | 62 virtual net::HttpResponseHeaders* GetResponseHeaders() const OVERRIDE; |
| 61 virtual net::HostPortPair GetSocketAddress() const OVERRIDE; | 63 virtual net::HostPortPair GetSocketAddress() const OVERRIDE; |
| 62 virtual bool WasFetchedViaProxy() const OVERRIDE; | 64 virtual bool WasFetchedViaProxy() const OVERRIDE; |
| 63 virtual void Start() OVERRIDE; | 65 virtual void Start() OVERRIDE; |
| 64 virtual void StartWithRequestContextGetter( | 66 virtual void StartWithRequestContextGetterAndUserData( |
| 65 net::URLRequestContextGetter* request_context_getter) OVERRIDE; | 67 net::URLRequestContextGetter* request_context_getter, |
| 68 content::ContentURLRequestUserData* user_data) OVERRIDE; |
| 66 virtual const GURL& GetOriginalURL() const OVERRIDE; | 69 virtual const GURL& GetOriginalURL() const OVERRIDE; |
| 67 virtual const GURL& GetURL() const OVERRIDE; | 70 virtual const GURL& GetURL() const OVERRIDE; |
| 68 virtual const net::URLRequestStatus& GetStatus() const OVERRIDE; | 71 virtual const net::URLRequestStatus& GetStatus() const OVERRIDE; |
| 69 virtual int GetResponseCode() const OVERRIDE; | 72 virtual int GetResponseCode() const OVERRIDE; |
| 70 virtual const net::ResponseCookies& GetCookies() const OVERRIDE; | 73 virtual const net::ResponseCookies& GetCookies() const OVERRIDE; |
| 71 virtual bool FileErrorOccurred( | 74 virtual bool FileErrorOccurred( |
| 72 base::PlatformFileError* out_error_code) const OVERRIDE; | 75 base::PlatformFileError* out_error_code) const OVERRIDE; |
| 73 virtual void ReceivedContentWasMalformed() OVERRIDE; | 76 virtual void ReceivedContentWasMalformed() OVERRIDE; |
| 74 virtual bool GetResponseAsString( | 77 virtual bool GetResponseAsString( |
| 75 std::string* out_response_string) const OVERRIDE; | 78 std::string* out_response_string) const OVERRIDE; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // NOTE: for safety, this should only be used through ScopedURLFetcherFactory! | 119 // NOTE: for safety, this should only be used through ScopedURLFetcherFactory! |
| 117 static void set_factory(content::URLFetcherFactory* factory); | 120 static void set_factory(content::URLFetcherFactory* factory); |
| 118 | 121 |
| 119 class Core; | 122 class Core; |
| 120 scoped_refptr<Core> core_; | 123 scoped_refptr<Core> core_; |
| 121 | 124 |
| 122 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); | 125 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); |
| 123 }; | 126 }; |
| 124 | 127 |
| 125 #endif // CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_ | 128 #endif // CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_ |
| OLD | NEW |