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

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 7024017: Fix --host-rules command switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT. Created 9 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 | Annotate | Revision Log
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/http/http_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 break; 435 break;
436 } 436 }
437 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); 437 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
438 return rv; 438 return rv;
439 } 439 }
440 440
441 int HttpStreamFactoryImpl::Job::StartInternal() { 441 int HttpStreamFactoryImpl::Job::StartInternal() {
442 CHECK_EQ(STATE_NONE, next_state_); 442 CHECK_EQ(STATE_NONE, next_state_);
443 net_log_.BeginEvent(NetLog::TYPE_HTTP_STREAM_JOB, 443 net_log_.BeginEvent(NetLog::TYPE_HTTP_STREAM_JOB,
444 make_scoped_refptr(new NetLogStringParameter( 444 make_scoped_refptr(new NetLogStringParameter(
445 "url", request_info_.url.GetOrigin().spec()))); 445 "url", request_info_.url.GetOrigin().spec())));
willchan no longer on Chromium 2011/06/07 19:53:29 I think that if the host mapping rules get applied
levin 2011/06/08 00:37:25 Am I suppose to call net_log_.AddEvent (and create
willchan no longer on Chromium 2011/06/08 05:27:31 Hah, no apologies needed. Obviously if you don't u
446 next_state_ = STATE_RESOLVE_PROXY; 446 next_state_ = STATE_RESOLVE_PROXY;
447 int rv = RunLoop(OK); 447 int rv = RunLoop(OK);
448 DCHECK_EQ(ERR_IO_PENDING, rv); 448 DCHECK_EQ(ERR_IO_PENDING, rv);
449 return rv; 449 return rv;
450 } 450 }
451 451
452 int HttpStreamFactoryImpl::Job::DoResolveProxy() { 452 int HttpStreamFactoryImpl::Job::DoResolveProxy() {
453 DCHECK(!pac_request_); 453 DCHECK(!pac_request_);
454 454
455 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; 455 next_state_ = STATE_RESOLVE_PROXY_COMPLETE;
456 456
457 origin_ = HostPortPair(request_info_.url.HostNoBrackets(), 457 origin_ = HostPortPair(request_info_.url.HostNoBrackets(),
458 request_info_.url.EffectiveIntPort()); 458 request_info_.url.EffectiveIntPort());
459 459
460 origin_url_ = HttpStreamFactory::ApplyHostMappingRules(
461 request_info_.url, &origin_);
462
460 if (request_info_.load_flags & LOAD_BYPASS_PROXY) { 463 if (request_info_.load_flags & LOAD_BYPASS_PROXY) {
461 proxy_info_.UseDirect(); 464 proxy_info_.UseDirect();
462 return OK; 465 return OK;
463 } 466 }
464 467
465 return session_->proxy_service()->ResolveProxy( 468 return session_->proxy_service()->ResolveProxy(
466 request_info_.url, &proxy_info_, &io_callback_, &pac_request_, 469 request_info_.url, &proxy_info_, &io_callback_, &pac_request_,
467 net_log_); 470 net_log_);
468 } 471 }
469 472
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 if (proxy_info_.is_https()) { 572 if (proxy_info_.is_https()) {
570 InitSSLConfig(proxy_info_.proxy_server().host_port_pair(), 573 InitSSLConfig(proxy_info_.proxy_server().host_port_pair(),
571 &ssl_config_for_proxy); 574 &ssl_config_for_proxy);
572 } 575 }
573 if (using_ssl_) { 576 if (using_ssl_) {
574 InitSSLConfig(origin_, &ssl_config_); 577 InitSSLConfig(origin_, &ssl_config_);
575 } 578 }
576 579
577 if (IsPreconnecting()) { 580 if (IsPreconnecting()) {
578 return ClientSocketPoolManager::PreconnectSocketsForHttpRequest( 581 return ClientSocketPoolManager::PreconnectSocketsForHttpRequest(
579 request_info_, 582 origin_url_,
583 request_info_.referrer,
584 request_info_.extra_headers,
585 request_info_.load_flags,
586 request_info_.priority,
580 session_, 587 session_,
581 proxy_info_, 588 proxy_info_,
582 ShouldForceSpdySSL(), 589 ShouldForceSpdySSL(),
583 want_spdy_over_npn, 590 want_spdy_over_npn,
584 ssl_config_, 591 ssl_config_,
585 ssl_config_for_proxy, 592 ssl_config_for_proxy,
586 net_log_, 593 net_log_,
587 num_streams_); 594 num_streams_);
588 } else { 595 } else {
589 return ClientSocketPoolManager::InitSocketHandleForHttpRequest( 596 return ClientSocketPoolManager::InitSocketHandleForHttpRequest(
590 request_info_, 597 origin_url_,
598 request_info_.referrer,
599 request_info_.extra_headers,
600 request_info_.load_flags,
601 request_info_.priority,
591 session_, 602 session_,
592 proxy_info_, 603 proxy_info_,
593 ShouldForceSpdySSL(), 604 ShouldForceSpdySSL(),
594 want_spdy_over_npn, 605 want_spdy_over_npn,
595 ssl_config_, 606 ssl_config_,
596 ssl_config_for_proxy, 607 ssl_config_for_proxy,
597 net_log_, 608 net_log_,
598 connection_.get(), 609 connection_.get(),
599 &io_callback_); 610 &io_callback_);
600 } 611 }
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const { 1069 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const {
1059 DCHECK_GE(num_streams_, 0); 1070 DCHECK_GE(num_streams_, 0);
1060 return num_streams_ > 0; 1071 return num_streams_ > 0;
1061 } 1072 }
1062 1073
1063 bool HttpStreamFactoryImpl::Job::IsOrphaned() const { 1074 bool HttpStreamFactoryImpl::Job::IsOrphaned() const {
1064 return !IsPreconnecting() && !request_; 1075 return !IsPreconnecting() && !request_;
1065 } 1076 }
1066 1077
1067 } // namespace net 1078 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698