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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 7582004: Add load flag indicating a request is probably the result of a user gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to lkgr. Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/base/load_flags_list.h ('k') | net/url_request/url_request_throttler_entry.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 7 #include "base/bind.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 username_.clear(); 390 username_.clear();
391 password_.clear(); 391 password_.clear();
392 } else { 392 } else {
393 DCHECK(request_->context()); 393 DCHECK(request_->context());
394 DCHECK(request_->context()->http_transaction_factory()); 394 DCHECK(request_->context()->http_transaction_factory());
395 395
396 rv = request_->context()->http_transaction_factory()->CreateTransaction( 396 rv = request_->context()->http_transaction_factory()->CreateTransaction(
397 &transaction_); 397 &transaction_);
398 if (rv == OK) { 398 if (rv == OK) {
399 if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() || 399 if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() ||
400 !throttling_entry_->IsDuringExponentialBackoff()) { 400 !throttling_entry_->ShouldRejectRequest(request_info_.load_flags)) {
401 rv = transaction_->Start( 401 rv = transaction_->Start(
402 &request_info_, &start_callback_, request_->net_log()); 402 &request_info_, &start_callback_, request_->net_log());
403 start_time_ = base::TimeTicks::Now(); 403 start_time_ = base::TimeTicks::Now();
404 } else { 404 } else {
405 // Special error code for the exponential back-off module. 405 // Special error code for the exponential back-off module.
406 rv = ERR_TEMPORARILY_THROTTLED; 406 rv = ERR_TEMPORARILY_THROTTLED;
407 } 407 }
408 // Make sure the context is alive for the duration of the 408 // Make sure the context is alive for the duration of the
409 // transaction. 409 // transaction.
410 context_ = request_->context(); 410 context_ = request_->context();
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 if (done_) 1477 if (done_)
1478 return; 1478 return;
1479 done_ = true; 1479 done_ = true;
1480 1480
1481 RecordPerfHistograms(reason); 1481 RecordPerfHistograms(reason);
1482 if (reason == FINISHED) 1482 if (reason == FINISHED)
1483 RecordCompressionHistograms(); 1483 RecordCompressionHistograms();
1484 } 1484 }
1485 1485
1486 } // namespace net 1486 } // namespace net
OLDNEW
« no previous file with comments | « net/base/load_flags_list.h ('k') | net/url_request/url_request_throttler_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698