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

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

Issue 9225028: Add NetLog entries to preconnect HttpStreamFactoryImpl::Jobs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.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/http/http_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "net/base/net_log.h" 10 #include "net/base/net_log.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 GURL alternate_url; 66 GURL alternate_url;
67 bool has_alternate_protocol = 67 bool has_alternate_protocol =
68 GetAlternateProtocolRequestFor(request_info.url, &alternate_url); 68 GetAlternateProtocolRequestFor(request_info.url, &alternate_url);
69 Job* alternate_job = NULL; 69 Job* alternate_job = NULL;
70 if (has_alternate_protocol) { 70 if (has_alternate_protocol) {
71 HttpRequestInfo alternate_request_info = request_info; 71 HttpRequestInfo alternate_request_info = request_info;
72 alternate_request_info.url = alternate_url; 72 alternate_request_info.url = alternate_url;
73 alternate_job = 73 alternate_job =
74 new Job(this, session_, alternate_request_info, server_ssl_config, 74 new Job(this, session_, alternate_request_info, server_ssl_config,
75 proxy_ssl_config, net_log); 75 proxy_ssl_config, net_log.net_log());
76 request->AttachJob(alternate_job); 76 request->AttachJob(alternate_job);
77 alternate_job->MarkAsAlternate(request_info.url); 77 alternate_job->MarkAsAlternate(request_info.url);
78 } 78 }
79 79
80 // We use |net_log|'s NetLog instead of |session_->net_log()| for unit
eroman 2012/01/27 20:09:10 i don't understand the reference to unit-testing h
mmenke1 2012/01/27 20:12:49 Some of the unit tests pass in a CapturingNetLog w
81 // testing.
80 Job* job = new Job(this, session_, request_info, server_ssl_config, 82 Job* job = new Job(this, session_, request_info, server_ssl_config,
81 proxy_ssl_config, net_log); 83 proxy_ssl_config, net_log.net_log());
82 request->AttachJob(job); 84 request->AttachJob(job);
83 if (alternate_job) { 85 if (alternate_job) {
84 job->WaitFor(alternate_job); 86 job->WaitFor(alternate_job);
85 // Make sure to wait until we call WaitFor(), before starting 87 // Make sure to wait until we call WaitFor(), before starting
86 // |alternate_job|, otherwise |alternate_job| will not notify |job| 88 // |alternate_job|, otherwise |alternate_job| will not notify |job|
87 // appropriately. 89 // appropriately.
88 alternate_job->Start(request); 90 alternate_job->Start(request);
89 } 91 }
90 // Even if |alternate_job| has already finished, it won't have notified the 92 // Even if |alternate_job| has already finished, it won't have notified the
91 // request yet, since we defer that to the next iteration of the MessageLoop, 93 // request yet, since we defer that to the next iteration of the MessageLoop,
92 // so starting |job| is always safe. 94 // so starting |job| is always safe.
93 job->Start(request); 95 job->Start(request);
94 return request; 96 return request;
95 } 97 }
96 98
97 void HttpStreamFactoryImpl::PreconnectStreams( 99 void HttpStreamFactoryImpl::PreconnectStreams(
98 int num_streams, 100 int num_streams,
99 const HttpRequestInfo& request_info, 101 const HttpRequestInfo& request_info,
100 const SSLConfig& server_ssl_config, 102 const SSLConfig& server_ssl_config,
101 const SSLConfig& proxy_ssl_config, 103 const SSLConfig& proxy_ssl_config) {
102 const BoundNetLog& net_log) {
103 GURL alternate_url; 104 GURL alternate_url;
104 bool has_alternate_protocol = 105 bool has_alternate_protocol =
105 GetAlternateProtocolRequestFor(request_info.url, &alternate_url); 106 GetAlternateProtocolRequestFor(request_info.url, &alternate_url);
106 Job* job = NULL; 107 Job* job = NULL;
107 if (has_alternate_protocol) { 108 if (has_alternate_protocol) {
108 HttpRequestInfo alternate_request_info = request_info; 109 HttpRequestInfo alternate_request_info = request_info;
109 alternate_request_info.url = alternate_url; 110 alternate_request_info.url = alternate_url;
110 job = new Job(this, session_, alternate_request_info, server_ssl_config, 111 job = new Job(this, session_, alternate_request_info, server_ssl_config,
111 proxy_ssl_config, net_log); 112 proxy_ssl_config, session_->net_log());
112 job->MarkAsAlternate(request_info.url); 113 job->MarkAsAlternate(request_info.url);
113 } else { 114 } else {
114 job = new Job(this, session_, request_info, server_ssl_config, 115 job = new Job(this, session_, request_info, server_ssl_config,
115 proxy_ssl_config, net_log); 116 proxy_ssl_config, session_->net_log());
116 } 117 }
117 preconnect_job_set_.insert(job); 118 preconnect_job_set_.insert(job);
118 job->Preconnect(num_streams); 119 job->Preconnect(num_streams);
119 } 120 }
120 121
121 void HttpStreamFactoryImpl::AddTLSIntolerantServer(const HostPortPair& server) { 122 void HttpStreamFactoryImpl::AddTLSIntolerantServer(const HostPortPair& server) {
122 tls_intolerant_servers_.insert(server); 123 tls_intolerant_servers_.insert(server);
123 } 124 }
124 125
125 bool HttpStreamFactoryImpl::IsTLSIntolerantServer( 126 bool HttpStreamFactoryImpl::IsTLSIntolerantServer(
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 false, // not using_spdy 245 false, // not using_spdy
245 stream->net_log()); 246 stream->net_log());
246 request->OnStreamReady(NULL, 247 request->OnStreamReady(NULL,
247 stream->used_ssl_config(), 248 stream->used_ssl_config(),
248 stream->used_proxy_info(), 249 stream->used_proxy_info(),
249 stream); 250 stream);
250 } 251 }
251 } 252 }
252 253
253 } // namespace net 254 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698