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

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: And fix more stuff... 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 441 }
442 442
443 if (rv == OK) { 443 if (rv == OK) {
444 transaction_->SetBeforeNetworkStartCallback( 444 transaction_->SetBeforeNetworkStartCallback(
445 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart, 445 base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart,
446 base::Unretained(this))); 446 base::Unretained(this)));
447 transaction_->SetBeforeProxyHeadersSentCallback( 447 transaction_->SetBeforeProxyHeadersSentCallback(
448 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback, 448 base::Bind(&URLRequestHttpJob::NotifyBeforeSendProxyHeadersCallback,
449 base::Unretained(this))); 449 base::Unretained(this)));
450 450
451 if (!throttling_entry_.get() || 451 if (!throttling_entry_ ||
452 !throttling_entry_->ShouldRejectRequest(*request_)) { 452 !throttling_entry_->ShouldRejectRequest(
453 *request_, network_delegate())) {
453 rv = transaction_->Start( 454 rv = transaction_->Start(
454 &request_info_, start_callback_, request_->net_log()); 455 &request_info_, start_callback_, request_->net_log());
455 start_time_ = base::TimeTicks::Now(); 456 start_time_ = base::TimeTicks::Now();
456 } else { 457 } else {
457 // Special error code for the exponential back-off module. 458 // Special error code for the exponential back-off module.
458 rv = ERR_TEMPORARILY_THROTTLED; 459 rv = ERR_TEMPORARILY_THROTTLED;
459 } 460 }
460 } 461 }
461 } 462 }
462 463
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 return override_response_headers_.get() ? 1523 return override_response_headers_.get() ?
1523 override_response_headers_.get() : 1524 override_response_headers_.get() :
1524 transaction_->GetResponseInfo()->headers.get(); 1525 transaction_->GetResponseInfo()->headers.get();
1525 } 1526 }
1526 1527
1527 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1528 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1528 awaiting_callback_ = false; 1529 awaiting_callback_ = false;
1529 } 1530 }
1530 1531
1531 } // namespace net 1532 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698