Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: chrome/browser/net/url_fetcher.cc

Issue 126279: Consistently use int64 for integers holding number of milliseconds. (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/net/url_fetcher_protect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/net/url_fetcher.h" 5 #include "chrome/browser/net/url_fetcher.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 request_context_ = NULL; 247 request_context_ = NULL;
248 } 248 }
249 249
250 void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) { 250 void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) {
251 DCHECK(MessageLoop::current() == delegate_loop_); 251 DCHECK(MessageLoop::current() == delegate_loop_);
252 252
253 // Checks the response from server. 253 // Checks the response from server.
254 if (response_code_ >= 500) { 254 if (response_code_ >= 500) {
255 // When encountering a server error, we will send the request again 255 // When encountering a server error, we will send the request again
256 // after backoff time. 256 // after backoff time.
257 const int wait = 257 const int64 wait =
258 protect_entry_->UpdateBackoff(URLFetcherProtectEntry::FAILURE); 258 protect_entry_->UpdateBackoff(URLFetcherProtectEntry::FAILURE);
259 ++num_retries_; 259 ++num_retries_;
260 // Restarts the request if we still need to notify the delegate. 260 // Restarts the request if we still need to notify the delegate.
261 if (delegate_) { 261 if (delegate_) {
262 if (num_retries_ <= protect_entry_->max_retries()) { 262 if (num_retries_ <= protect_entry_->max_retries()) {
263 io_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod( 263 io_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod(
264 this, &Core::StartURLRequest), wait); 264 this, &Core::StartURLRequest), wait);
265 } else { 265 } else {
266 delegate_->OnURLFetchComplete(fetcher_, url_, status, response_code_, 266 delegate_->OnURLFetchComplete(fetcher_, url_, status, response_code_,
267 cookies_, data_); 267 cookies_, data_);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 core_->Start(); 306 core_->Start();
307 } 307 }
308 308
309 const GURL& URLFetcher::url() const { 309 const GURL& URLFetcher::url() const {
310 return core_->url_; 310 return core_->url_;
311 } 311 }
312 312
313 URLFetcher::Delegate* URLFetcher::delegate() const { 313 URLFetcher::Delegate* URLFetcher::delegate() const {
314 return core_->delegate(); 314 return core_->delegate();
315 } 315 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/net/url_fetcher_protect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698