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 URLRequest that handles | 5 // This file contains URLFetcher, a wrapper around 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const URLRequestStatus& GetStatus() const override; | 83 const URLRequestStatus& GetStatus() const override; |
84 int GetResponseCode() const override; | 84 int GetResponseCode() const override; |
85 const ResponseCookies& GetCookies() const override; | 85 const ResponseCookies& GetCookies() const override; |
86 void ReceivedContentWasMalformed() override; | 86 void ReceivedContentWasMalformed() override; |
87 bool GetResponseAsString(std::string* out_response_string) const override; | 87 bool GetResponseAsString(std::string* out_response_string) const override; |
88 bool GetResponseAsFilePath(bool take_ownership, | 88 bool GetResponseAsFilePath(bool take_ownership, |
89 base::FilePath* out_response_path) const override; | 89 base::FilePath* out_response_path) const override; |
90 | 90 |
91 static void CancelAll(); | 91 static void CancelAll(); |
92 | 92 |
93 static void SetEnableInterceptionForTests(bool enabled); | |
94 static void SetIgnoreCertificateRequests(bool ignored); | 93 static void SetIgnoreCertificateRequests(bool ignored); |
95 | 94 |
96 // TODO(akalin): Make these private again once URLFetcher::Create() | 95 // TODO(akalin): Make these private again once URLFetcher::Create() |
97 // is in net/. | 96 // is in net/. |
98 | 97 |
99 static URLFetcherFactory* factory(); | 98 static URLFetcherFactory* factory(); |
100 | 99 |
101 // Sets the factory used by the static method Create to create a URLFetcher. | 100 // Sets the factory used by the static method Create to create a URLFetcher. |
102 // URLFetcher does not take ownership of |factory|. A value of NULL results | 101 // URLFetcher does not take ownership of |factory|. A value of NULL results |
103 // in a URLFetcher being created directly. | 102 // in a URLFetcher being created directly. |
(...skipping 13 matching lines...) Expand all Loading... |
117 static int GetNumFetcherCores(); | 116 static int GetNumFetcherCores(); |
118 | 117 |
119 const scoped_refptr<URLFetcherCore> core_; | 118 const scoped_refptr<URLFetcherCore> core_; |
120 | 119 |
121 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); | 120 DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl); |
122 }; | 121 }; |
123 | 122 |
124 } // namespace net | 123 } // namespace net |
125 | 124 |
126 #endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_ | 125 #endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_ |
OLD | NEW |