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

Unified 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: s/create/Create/ 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/socket/client_socket_pool_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 1efd1cc9b8a0829fb46303a6a04722e62be45916..254792f9d09aa09dfa1d852fb6411c35324414e2 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -30,9 +30,32 @@
namespace net {
-namespace {
+// Parameters associated with the start of a HTTP stream job.
+class HttpStreamJobParameters : public NetLog::EventParameters {
+ public:
+ static scoped_refptr<HttpStreamJobParameters> Create(
+ const GURL& original_url,
+ const GURL& url) {
+ return make_scoped_refptr(new HttpStreamJobParameters(original_url, url));
+ }
+
+ virtual Value* ToValue() const;
+
+ private:
+ HttpStreamJobParameters(const GURL& original_url, const GURL& url)
+ : original_url_(original_url.GetOrigin().spec()),
+ url_(url.GetOrigin().spec()) {}
-} // namespace
+ const std::string original_url_;
+ const std::string url_;
+};
+
+Value* HttpStreamJobParameters::ToValue() const {
+ DictionaryValue* dict = new DictionaryValue();
+ dict->SetString("original_url", original_url_);
+ dict->SetString("url", url_);
+ return dict;
+}
HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory,
HttpNetworkSession* session,
@@ -440,9 +463,15 @@ int HttpStreamFactoryImpl::Job::DoLoop(int result) {
int HttpStreamFactoryImpl::Job::StartInternal() {
CHECK_EQ(STATE_NONE, next_state_);
+
+ origin_ = HostPortPair(request_info_.url.HostNoBrackets(),
+ request_info_.url.EffectiveIntPort());
+ origin_url_ = HttpStreamFactory::ApplyHostMappingRules(
+ request_info_.url, &origin_);
+
net_log_.BeginEvent(NetLog::TYPE_HTTP_STREAM_JOB,
- make_scoped_refptr(new NetLogStringParameter(
- "url", request_info_.url.GetOrigin().spec())));
+ HttpStreamJobParameters::Create(request_info_.url,
+ origin_url_));
next_state_ = STATE_RESOLVE_PROXY;
int rv = RunLoop(OK);
DCHECK_EQ(ERR_IO_PENDING, rv);
@@ -454,9 +483,6 @@ int HttpStreamFactoryImpl::Job::DoResolveProxy() {
next_state_ = STATE_RESOLVE_PROXY_COMPLETE;
- origin_ = HostPortPair(request_info_.url.HostNoBrackets(),
- request_info_.url.EffectiveIntPort());
-
if (request_info_.load_flags & LOAD_BYPASS_PROXY) {
proxy_info_.UseDirect();
return OK;
@@ -576,7 +602,11 @@ int HttpStreamFactoryImpl::Job::DoInitConnection() {
if (IsPreconnecting()) {
return ClientSocketPoolManager::PreconnectSocketsForHttpRequest(
- request_info_,
+ origin_url_,
+ request_info_.referrer,
+ request_info_.extra_headers,
+ request_info_.load_flags,
+ request_info_.priority,
session_,
proxy_info_,
ShouldForceSpdySSL(),
@@ -587,7 +617,11 @@ int HttpStreamFactoryImpl::Job::DoInitConnection() {
num_streams_);
} else {
return ClientSocketPoolManager::InitSocketHandleForHttpRequest(
- request_info_,
+ origin_url_,
+ request_info_.referrer,
+ request_info_.extra_headers,
+ request_info_.load_flags,
+ request_info_.priority,
session_,
proxy_info_,
ShouldForceSpdySSL(),
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/socket/client_socket_pool_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698