diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-19 21:47:55 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-19 21:47:55 +0000 |
commit | 68697a4cc8372d40c9b0a75e7bd7ec2654f7f316 (patch) | |
tree | be485ac95fa4e62f558d6ae77c07ab07ba5b09ba /net | |
parent | f24f4b5e5d0a1e6dc1b4eeceb129285893c9d509 (diff) | |
download | chromium_src-68697a4cc8372d40c9b0a75e7bd7ec2654f7f316.zip chromium_src-68697a4cc8372d40c9b0a75e7bd7ec2654f7f316.tar.gz chromium_src-68697a4cc8372d40c9b0a75e7bd7ec2654f7f316.tar.bz2 |
In net-internals, have HTTP_STREAM_JOBs link to the
URL_REQUEST they were attached to. With source_dependencies
now being clickable, this makes navigation between
URLRequests on the same socket a little easier.
BUG=107000
Review URL: http://codereview.chromium.org/8930014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_log.cc | 4 | ||||
-rw-r--r-- | net/base/net_log_event_type_list.h | 14 | ||||
-rw-r--r-- | net/http/http_pipelined_connection.h | 4 | ||||
-rw-r--r-- | net/http/http_pipelined_connection_impl.cc | 4 | ||||
-rw-r--r-- | net/http/http_pipelined_connection_impl.h | 2 | ||||
-rw-r--r-- | net/http/http_pipelined_host_impl_unittest.cc | 2 | ||||
-rw-r--r-- | net/http/http_pipelined_stream.cc | 4 | ||||
-rw-r--r-- | net/http/http_pipelined_stream.h | 4 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl.cc | 6 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl.h | 2 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_job.cc | 6 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_request.cc | 16 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_request.h | 5 |
13 files changed, 41 insertions, 32 deletions
diff --git a/net/base/net_log.cc b/net/base/net_log.cc index 259786ef..9460f74 100644 --- a/net/base/net_log.cc +++ b/net/base/net_log.cc @@ -271,8 +271,8 @@ Value* NetLogStringParameter::ToValue() const { Value* NetLogSourceParameter::ToValue() const { DictionaryValue* dict = new DictionaryValue(); - - dict->Set(name_, value_.ToValue()); + if (value_.is_valid()) + dict->Set(name_, value_.ToValue()); return dict; } diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 2d354d4..aa5f140 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -784,13 +784,21 @@ EVENT_TYPE(HTTP_STREAM_REQUEST) // Measures the time taken to execute the HttpStreamFactoryImpl::Job EVENT_TYPE(HTTP_STREAM_JOB) -// Identifies the NetLog::Source() for the Job that fulfilled the request. -// request. The event parameters are: +// Identifies the NetLog::Source() for the Job that fulfilled the Request. +// The event parameters are: // { -// "source_dependency": <Source identifier for the job we acquired>, +// "source_dependency": <Source identifier for Job we acquired>, // } EVENT_TYPE(HTTP_STREAM_REQUEST_BOUND_TO_JOB) +// Identifies the NetLog::Source() for the Request that the Job was attached to. +// The event parameters are: +// { +// "source_dependency": <Source identifier for the Request to which we were +// attached>, +// } +EVENT_TYPE(HTTP_STREAM_JOB_BOUND_TO_REQUEST) + // Logs the protocol negotiated with the server. The event parameters are: // { // "status": <The NPN status ("negotiated", "unsupported", "no-overlap")>, diff --git a/net/http/http_pipelined_connection.h b/net/http/http_pipelined_connection.h index e8c332b..ddf9671 100644 --- a/net/http/http_pipelined_connection.h +++ b/net/http/http_pipelined_connection.h @@ -74,8 +74,8 @@ class NET_EXPORT_PRIVATE HttpPipelinedConnection { // The ProxyInfo used to establish this connection. virtual const ProxyInfo& used_proxy_info() const = 0; - // The source of this pipelined connection. - virtual const NetLog::Source& source() const = 0; + // The BoundNetLog of this pipelined connection. + virtual const BoundNetLog& net_log() const = 0; // True if this connection was NPN negotiated. virtual bool was_npn_negotiated() const = 0; diff --git a/net/http/http_pipelined_connection_impl.cc b/net/http/http_pipelined_connection_impl.cc index 95d27a6..05bc9b8 100644 --- a/net/http/http_pipelined_connection_impl.cc +++ b/net/http/http_pipelined_connection_impl.cc @@ -706,8 +706,8 @@ const ProxyInfo& HttpPipelinedConnectionImpl::used_proxy_info() const { return used_proxy_info_; } -const NetLog::Source& HttpPipelinedConnectionImpl::source() const { - return net_log_.source(); +const BoundNetLog& HttpPipelinedConnectionImpl::net_log() const { + return net_log_; } bool HttpPipelinedConnectionImpl::was_npn_negotiated() const { diff --git a/net/http/http_pipelined_connection_impl.h b/net/http/http_pipelined_connection_impl.h index 64577b7..8e155d8 100644 --- a/net/http/http_pipelined_connection_impl.h +++ b/net/http/http_pipelined_connection_impl.h @@ -66,7 +66,7 @@ class NET_EXPORT_PRIVATE HttpPipelinedConnectionImpl // Used by HttpStreamFactoryImpl. virtual const SSLConfig& used_ssl_config() const OVERRIDE; virtual const ProxyInfo& used_proxy_info() const OVERRIDE; - virtual const NetLog::Source& source() const OVERRIDE; + virtual const BoundNetLog& net_log() const OVERRIDE; virtual bool was_npn_negotiated() const OVERRIDE; // Used by HttpPipelinedStream. diff --git a/net/http/http_pipelined_host_impl_unittest.cc b/net/http/http_pipelined_host_impl_unittest.cc index 3eace82..a428ae0 100644 --- a/net/http/http_pipelined_host_impl_unittest.cc +++ b/net/http/http_pipelined_host_impl_unittest.cc @@ -68,7 +68,7 @@ class MockPipeline : public HttpPipelinedConnection { MOCK_METHOD1(OnStreamDeleted, void(int pipeline_id)); MOCK_CONST_METHOD0(used_ssl_config, const SSLConfig&()); MOCK_CONST_METHOD0(used_proxy_info, const ProxyInfo&()); - MOCK_CONST_METHOD0(source, const NetLog::Source&()); + MOCK_CONST_METHOD0(net_log, const BoundNetLog&()); MOCK_CONST_METHOD0(was_npn_negotiated, bool()); private: diff --git a/net/http/http_pipelined_stream.cc b/net/http/http_pipelined_stream.cc index 943c2c0..c4d64ac 100644 --- a/net/http/http_pipelined_stream.cc +++ b/net/http/http_pipelined_stream.cc @@ -130,8 +130,8 @@ const ProxyInfo& HttpPipelinedStream::used_proxy_info() const { return pipeline_->used_proxy_info(); } -const NetLog::Source& HttpPipelinedStream::source() const { - return pipeline_->source(); +const BoundNetLog& HttpPipelinedStream::net_log() const { + return pipeline_->net_log(); } bool HttpPipelinedStream::was_npn_negotiated() const { diff --git a/net/http/http_pipelined_stream.h b/net/http/http_pipelined_stream.h index fce7a08..ca62584 100644 --- a/net/http/http_pipelined_stream.h +++ b/net/http/http_pipelined_stream.h @@ -90,8 +90,8 @@ class HttpPipelinedStream : public HttpStream { // The ProxyInfo used to establish this this stream's pipeline. const ProxyInfo& used_proxy_info() const; - // The source of this stream's pipelined connection. - const NetLog::Source& source() const; + // The BoundNetLog of this stream's pipelined connection. + const BoundNetLog& net_log() const; // True if this stream's pipeline was NPN negotiated. bool was_npn_negotiated() const; diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc index 735532d..f080e18 100644 --- a/net/http/http_stream_factory_impl.cc +++ b/net/http/http_stream_factory_impl.cc @@ -191,7 +191,7 @@ void HttpStreamFactoryImpl::OnSpdySessionReady( const ProxyInfo& used_proxy_info, bool was_npn_negotiated, bool using_spdy, - const NetLog::Source& source) { + const BoundNetLog& net_log) { const HostPortProxyPair& spdy_session_key = spdy_session->host_port_proxy_pair(); while (!spdy_session->IsClosed()) { @@ -207,7 +207,7 @@ void HttpStreamFactoryImpl::OnSpdySessionReady( Request* request = *spdy_session_request_map_[spdy_session_key].begin(); request->Complete(was_npn_negotiated, using_spdy, - source); + net_log); bool use_relative_url = direct || request->url().SchemeIs("https"); request->OnStreamReady(NULL, used_ssl_config, used_proxy_info, new SpdyHttpStream(spdy_session, use_relative_url)); @@ -235,7 +235,7 @@ void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity( Request* request = *http_pipelining_request_map_[origin].begin(); request->Complete(stream->was_npn_negotiated(), false, // not using_spdy - stream->source()); + stream->net_log()); request->OnStreamReady(NULL, stream->used_ssl_config(), stream->used_proxy_info(), diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h index 8f13f3f..8586050 100644 --- a/net/http/http_stream_factory_impl.h +++ b/net/http/http_stream_factory_impl.h @@ -71,7 +71,7 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : const ProxyInfo& used_proxy_info, bool was_npn_negotiated, bool using_spdy, - const NetLog::Source& source); + const BoundNetLog& net_log); // Called when the Job detects that the endpoint indicated by the // Alternate-Protocol does not work. Lets the factory update diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 8a1f69f..e3afbc5 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc @@ -281,7 +281,7 @@ void HttpStreamFactoryImpl::Job::OnStreamReadyCallback() { } else { request_->Complete(was_npn_negotiated(), using_spdy(), - net_log_.source()); + net_log_); request_->OnStreamReady(this, server_ssl_config_, proxy_info_, stream_.release()); } @@ -298,7 +298,7 @@ void HttpStreamFactoryImpl::Job::OnSpdySessionReadyCallback() { if (IsOrphaned()) { stream_factory_->OnSpdySessionReady( spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_, - was_npn_negotiated(), using_spdy(), net_log_.source()); + was_npn_negotiated(), using_spdy(), net_log_); stream_factory_->OnOrphanedJobComplete(this); } else { request_->OnSpdySessionReady(this, spdy_session, spdy_session_direct_); @@ -364,7 +364,7 @@ void HttpStreamFactoryImpl::Job::OnPreconnectsComplete() { if (new_spdy_session_) { stream_factory_->OnSpdySessionReady( new_spdy_session_, spdy_session_direct_, server_ssl_config_, - proxy_info_, was_npn_negotiated(), using_spdy(), net_log_.source()); + proxy_info_, was_npn_negotiated(), using_spdy(), net_log_); } stream_factory_->OnPreconnectsComplete(this); // |this| may be deleted after this call. diff --git a/net/http/http_stream_factory_impl_request.cc b/net/http/http_stream_factory_impl_request.cc index 493aa43..b13014d 100644 --- a/net/http/http_stream_factory_impl_request.cc +++ b/net/http/http_stream_factory_impl_request.cc @@ -75,7 +75,7 @@ void HttpStreamFactoryImpl::Request::AttachJob(Job* job) { void HttpStreamFactoryImpl::Request::Complete( bool was_npn_negotiated, bool using_spdy, - const NetLog::Source& job_source) { + const BoundNetLog& job_net_log) { DCHECK(!completed_); completed_ = true; was_npn_negotiated_ = was_npn_negotiated; @@ -83,7 +83,11 @@ void HttpStreamFactoryImpl::Request::Complete( net_log_.AddEvent( NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB, make_scoped_refptr(new NetLogSourceParameter( - "source_dependency", job_source))); + "source_dependency", job_net_log.source()))); + job_net_log.AddEvent( + NetLog::TYPE_HTTP_STREAM_JOB_BOUND_TO_REQUEST, + make_scoped_refptr(new NetLogSourceParameter( + "source_dependency", net_log_.source()))); } void HttpStreamFactoryImpl::Request::OnStreamReady( @@ -272,11 +276,9 @@ void HttpStreamFactoryImpl::Request::OnSpdySessionReady( const ProxyInfo used_proxy_info = job->proxy_info(); const bool was_npn_negotiated = job->was_npn_negotiated(); const bool using_spdy = job->using_spdy(); - const NetLog::Source source = job->net_log().source(); + const BoundNetLog net_log = job->net_log(); - Complete(was_npn_negotiated, - using_spdy, - source); + Complete(was_npn_negotiated, using_spdy, net_log); // Cache this so we can still use it if the request is deleted. HttpStreamFactoryImpl* factory = factory_; @@ -289,7 +291,7 @@ void HttpStreamFactoryImpl::Request::OnSpdySessionReady( // |this| may be deleted after this point. factory->OnSpdySessionReady( spdy_session, direct, used_ssl_config, used_proxy_info, - was_npn_negotiated, using_spdy, source); + was_npn_negotiated, using_spdy, net_log); } void HttpStreamFactoryImpl::Request::OrphanJobsExcept(Job* job) { diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h index 98b2e63..16afb93 100644 --- a/net/http/http_stream_factory_impl_request.h +++ b/net/http/http_stream_factory_impl_request.h @@ -40,11 +40,10 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest { void AttachJob(HttpStreamFactoryImpl::Job* job); // Marks completion of the request. Must be called before OnStreamReady(). - // |source| is the NetLog::Source generated by the Job that fulfilled this - // request. + // |job_net_log| is the BoundNetLog of the Job that fulfilled this request. void Complete(bool was_npn_negotiated, bool using_spdy, - const NetLog::Source& source); + const BoundNetLog& job_net_log); // If this Request has a |spdy_session_key_|, remove this session from the // SpdySessionRequestMap. |