OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 rv = transaction_->RestartWithAuth(username_, password_, &start_callback_); | 212 rv = transaction_->RestartWithAuth(username_, password_, &start_callback_); |
213 username_.clear(); | 213 username_.clear(); |
214 password_.clear(); | 214 password_.clear(); |
215 } else { | 215 } else { |
216 DCHECK(request_->context()); | 216 DCHECK(request_->context()); |
217 DCHECK(request_->context()->http_transaction_factory()); | 217 DCHECK(request_->context()->http_transaction_factory()); |
218 | 218 |
219 rv = request_->context()->http_transaction_factory()->CreateTransaction( | 219 rv = request_->context()->http_transaction_factory()->CreateTransaction( |
220 &transaction_); | 220 &transaction_); |
221 if (rv == OK) { | 221 if (rv == OK) { |
222 if (!throttling_entry_->IsDuringExponentialBackoff() || | 222 rv = transaction_->Start( |
223 !net::URLRequestThrottlerManager::GetInstance()-> | 223 &request_info_, &start_callback_, request_->net_log()); |
224 enforce_throttling()) { | |
225 rv = transaction_->Start( | |
226 &request_info_, &start_callback_, request_->net_log()); | |
227 } else { | |
228 // Special error code for the exponential back-off module. | |
229 rv = ERR_TEMPORARILY_THROTTLED; | |
230 } | |
231 // Make sure the context is alive for the duration of the | 224 // Make sure the context is alive for the duration of the |
232 // transaction. | 225 // transaction. |
233 context_ = request_->context(); | 226 context_ = request_->context(); |
234 } | 227 } |
235 } | 228 } |
236 | 229 |
237 if (rv == ERR_IO_PENDING) | 230 if (rv == ERR_IO_PENDING) |
238 return; | 231 return; |
239 | 232 |
240 // The transaction started synchronously, but we need to notify the | 233 // The transaction started synchronously, but we need to notify the |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 // At shutdown time, care is taken to be sure that we don't delete this | 954 // At shutdown time, care is taken to be sure that we don't delete this |
962 // globally useful instance "too soon," so this check is just defensive | 955 // globally useful instance "too soon," so this check is just defensive |
963 // coding to assure that IF the system is shutting down, we don't have any | 956 // coding to assure that IF the system is shutting down, we don't have any |
964 // problem if the manager was deleted ahead of time. | 957 // problem if the manager was deleted ahead of time. |
965 if (manager) // Defensive programming. | 958 if (manager) // Defensive programming. |
966 manager->FetchDictionary(request_info_.url, sdch_dictionary_url_); | 959 manager->FetchDictionary(request_info_.url, sdch_dictionary_url_); |
967 } | 960 } |
968 } | 961 } |
969 | 962 |
970 } // namespace net | 963 } // namespace net |
OLD | NEW |