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

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

Issue 407093011: Allow URLRequests from one context to have different NetworkDelegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new tests Created 6 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
OLDNEW
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_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/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 439 }
440 440
441 if (rv == OK) { 441 if (rv == OK) {
442 transaction_->SetBeforeNetworkStartCallback( 442 transaction_->SetBeforeNetworkStartCallback(
443 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart, 443 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart,
444 base::Unretained(this))); 444 base::Unretained(this)));
445 transaction_->SetBeforeProxyHeadersSentCallback( 445 transaction_->SetBeforeProxyHeadersSentCallback(
446 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback, 446 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback,
447 base::Unretained(this))); 447 base::Unretained(this)));
448 448
449 if (!throttling_entry_.get() || 449 if (!throttling_entry_ ||
450 !throttling_entry_->ShouldRejectRequest(*request_)) { 450 !throttling_entry_->ShouldRejectRequest(
451 *request_, network_delegate())) {
451 rv = transaction_->Start( 452 rv = transaction_->Start(
452 &request_info_, start_callback_, request_->net_log()); 453 &request_info_, start_callback_, request_->net_log());
453 start_time_ = base::TimeTicks::Now(); 454 start_time_ = base::TimeTicks::Now();
454 } else { 455 } else {
455 // Special error code for the exponential back-off module. 456 // Special error code for the exponential back-off module.
456 rv = ERR_TEMPORARILY_THROTTLED; 457 rv = ERR_TEMPORARILY_THROTTLED;
457 } 458 }
458 } 459 }
459 } 460 }
460 461
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 return override_response_headers_.get() ? 1522 return override_response_headers_.get() ?
1522 override_response_headers_.get() : 1523 override_response_headers_.get() :
1523 transaction_->GetResponseInfo()->headers.get(); 1524 transaction_->GetResponseInfo()->headers.get();
1524 } 1525 }
1525 1526
1526 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1527 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1527 awaiting_callback_ = false; 1528 awaiting_callback_ = false;
1528 } 1529 }
1529 1530
1530 } // namespace net 1531 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_ftp_job_unittest.cc ('k') | net/url_request/url_request_simple_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698