| 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 "base/sequenced_task_runner.h" |
| 9 #include "net/url_request/url_fetcher_core.h" | 10 #include "net/url_request/url_fetcher_core.h" |
| 10 #include "net/url_request/url_fetcher_factory.h" | 11 #include "net/url_request/url_fetcher_factory.h" |
| 11 #include "net/url_request/url_fetcher_response_writer.h" | 12 #include "net/url_request/url_fetcher_response_writer.h" |
| 12 | 13 |
| 13 namespace net { | 14 namespace net { |
| 14 | 15 |
| 15 static URLFetcherFactory* g_factory = NULL; | 16 static URLFetcherFactory* g_factory = NULL; |
| 16 | 17 |
| 17 URLFetcherImpl::URLFetcherImpl(const GURL& url, | 18 URLFetcherImpl::URLFetcherImpl(const GURL& url, |
| 18 RequestType request_type, | 19 RequestType request_type, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 base::TimeDelta URLFetcherImpl::GetBackoffDelay() const { | 115 base::TimeDelta URLFetcherImpl::GetBackoffDelay() const { |
| 115 return core_->GetBackoffDelay(); | 116 return core_->GetBackoffDelay(); |
| 116 } | 117 } |
| 117 | 118 |
| 118 void URLFetcherImpl::SetAutomaticallyRetryOnNetworkChanges(int max_retries) { | 119 void URLFetcherImpl::SetAutomaticallyRetryOnNetworkChanges(int max_retries) { |
| 119 core_->SetAutomaticallyRetryOnNetworkChanges(max_retries); | 120 core_->SetAutomaticallyRetryOnNetworkChanges(max_retries); |
| 120 } | 121 } |
| 121 | 122 |
| 122 void URLFetcherImpl::SaveResponseToFileAtPath( | 123 void URLFetcherImpl::SaveResponseToFileAtPath( |
| 123 const base::FilePath& file_path, | 124 const base::FilePath& file_path, |
| 124 scoped_refptr<base::TaskRunner> file_task_runner) { | 125 scoped_refptr<base::SequencedTaskRunner> file_task_runner) { |
| 125 core_->SaveResponseToFileAtPath(file_path, file_task_runner); | 126 core_->SaveResponseToFileAtPath(file_path, file_task_runner); |
| 126 } | 127 } |
| 127 | 128 |
| 128 void URLFetcherImpl::SaveResponseToTemporaryFile( | 129 void URLFetcherImpl::SaveResponseToTemporaryFile( |
| 129 scoped_refptr<base::TaskRunner> file_task_runner) { | 130 scoped_refptr<base::SequencedTaskRunner> file_task_runner) { |
| 130 core_->SaveResponseToTemporaryFile(file_task_runner); | 131 core_->SaveResponseToTemporaryFile(file_task_runner); |
| 131 } | 132 } |
| 132 | 133 |
| 133 void URLFetcherImpl::SaveResponseWithWriter( | 134 void URLFetcherImpl::SaveResponseWithWriter( |
| 134 scoped_ptr<URLFetcherResponseWriter> response_writer) { | 135 scoped_ptr<URLFetcherResponseWriter> response_writer) { |
| 135 core_->SaveResponseWithWriter(response_writer.Pass()); | 136 core_->SaveResponseWithWriter(response_writer.Pass()); |
| 136 } | 137 } |
| 137 | 138 |
| 138 HttpResponseHeaders* URLFetcherImpl::GetResponseHeaders() const { | 139 HttpResponseHeaders* URLFetcherImpl::GetResponseHeaders() const { |
| 139 return core_->GetResponseHeaders(); | 140 return core_->GetResponseHeaders(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 URLFetcherFactory* URLFetcherImpl::factory() { | 215 URLFetcherFactory* URLFetcherImpl::factory() { |
| 215 return g_factory; | 216 return g_factory; |
| 216 } | 217 } |
| 217 | 218 |
| 218 // static | 219 // static |
| 219 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { | 220 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { |
| 220 g_factory = factory; | 221 g_factory = factory; |
| 221 } | 222 } |
| 222 | 223 |
| 223 } // namespace net | 224 } // namespace net |
| OLD | NEW |