| 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 #include "net/url_request/url_fetcher_impl.h" | 5 #include "net/url_request/url_fetcher_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "net/url_request/url_fetcher_core.h" | 9 #include "net/url_request/url_fetcher_core.h" |
| 10 #include "net/url_request/url_fetcher_factory.h" | 10 #include "net/url_request/url_fetcher_factory.h" |
| 11 #include "net/url_request/url_fetcher_response_writer.h" |
| 11 | 12 |
| 12 namespace net { | 13 namespace net { |
| 13 | 14 |
| 14 static URLFetcherFactory* g_factory = NULL; | 15 static URLFetcherFactory* g_factory = NULL; |
| 15 | 16 |
| 16 URLFetcherImpl::URLFetcherImpl(const GURL& url, | 17 URLFetcherImpl::URLFetcherImpl(const GURL& url, |
| 17 RequestType request_type, | 18 RequestType request_type, |
| 18 URLFetcherDelegate* d) | 19 URLFetcherDelegate* d) |
| 19 : core_(new URLFetcherCore(this, url, request_type, d)) { | 20 : core_(new URLFetcherCore(this, url, request_type, d)) { |
| 20 } | 21 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const base::FilePath& file_path, | 123 const base::FilePath& file_path, |
| 123 scoped_refptr<base::TaskRunner> file_task_runner) { | 124 scoped_refptr<base::TaskRunner> file_task_runner) { |
| 124 core_->SaveResponseToFileAtPath(file_path, file_task_runner); | 125 core_->SaveResponseToFileAtPath(file_path, file_task_runner); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void URLFetcherImpl::SaveResponseToTemporaryFile( | 128 void URLFetcherImpl::SaveResponseToTemporaryFile( |
| 128 scoped_refptr<base::TaskRunner> file_task_runner) { | 129 scoped_refptr<base::TaskRunner> file_task_runner) { |
| 129 core_->SaveResponseToTemporaryFile(file_task_runner); | 130 core_->SaveResponseToTemporaryFile(file_task_runner); |
| 130 } | 131 } |
| 131 | 132 |
| 133 void URLFetcherImpl::SaveResponseWithWriter( |
| 134 scoped_ptr<URLFetcherResponseWriter> response_writer) { |
| 135 core_->SaveResponseWithWriter(response_writer.Pass()); |
| 136 } |
| 137 |
| 132 HttpResponseHeaders* URLFetcherImpl::GetResponseHeaders() const { | 138 HttpResponseHeaders* URLFetcherImpl::GetResponseHeaders() const { |
| 133 return core_->GetResponseHeaders(); | 139 return core_->GetResponseHeaders(); |
| 134 } | 140 } |
| 135 | 141 |
| 136 HostPortPair URLFetcherImpl::GetSocketAddress() const { | 142 HostPortPair URLFetcherImpl::GetSocketAddress() const { |
| 137 return core_->GetSocketAddress(); | 143 return core_->GetSocketAddress(); |
| 138 } | 144 } |
| 139 | 145 |
| 140 bool URLFetcherImpl::WasFetchedViaProxy() const { | 146 bool URLFetcherImpl::WasFetchedViaProxy() const { |
| 141 return core_->WasFetchedViaProxy(); | 147 return core_->WasFetchedViaProxy(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 URLFetcherFactory* URLFetcherImpl::factory() { | 214 URLFetcherFactory* URLFetcherImpl::factory() { |
| 209 return g_factory; | 215 return g_factory; |
| 210 } | 216 } |
| 211 | 217 |
| 212 // static | 218 // static |
| 213 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { | 219 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { |
| 214 g_factory = factory; | 220 g_factory = factory; |
| 215 } | 221 } |
| 216 | 222 |
| 217 } // namespace net | 223 } // namespace net |
| OLD | NEW |