diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 23:45:03 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 23:45:03 +0000 |
commit | be91bc6a48eb61df52759ddf5d5a191a2b2c9695 (patch) | |
tree | 54f21d04b35da5f652085ee883b28f495db776e4 /net | |
parent | 55b0771b098e32ae937c439fce77b87e09ce24d7 (diff) | |
download | chromium_src-be91bc6a48eb61df52759ddf5d5a191a2b2c9695.zip chromium_src-be91bc6a48eb61df52759ddf5d5a191a2b2c9695.tar.gz chromium_src-be91bc6a48eb61df52759ddf5d5a191a2b2c9695.tar.bz2 |
Enable LoadLog for Flip. Improve some LOG messages.
Review URL: http://codereview.chromium.org/465061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/load_log_event_type_list.h | 16 | ||||
-rw-r--r-- | net/flip/flip_network_transaction.cc | 17 | ||||
-rw-r--r-- | net/flip/flip_network_transaction.h | 2 | ||||
-rw-r--r-- | net/flip/flip_session.cc | 6 |
4 files changed, 40 insertions, 1 deletions
diff --git a/net/base/load_log_event_type_list.h b/net/base/load_log_event_type_list.h index 96b46c2..eeccfd3 100644 --- a/net/base/load_log_event_type_list.h +++ b/net/base/load_log_event_type_list.h @@ -162,6 +162,22 @@ EVENT_TYPE(HTTP_TRANSACTION_READ_BODY) EVENT_TYPE(HTTP_TRANSACTION_DRAIN_BODY_FOR_AUTH_RESTART) // ------------------------------------------------------------------------ +// FlipNetworkTransaction +// ------------------------------------------------------------------------ + +// Measures the time taken to get a flip stream. +EVENT_TYPE(FLIP_TRANSACTION_INIT_CONNECTION) + +// Measures the time taken to send the request to the server. +EVENT_TYPE(FLIP_TRANSACTION_SEND_REQUEST) + +// Measures the time to read HTTP response headers from the server. +EVENT_TYPE(FLIP_TRANSACTION_READ_HEADERS) + +// Measures the time to read the entity body from the server. +EVENT_TYPE(FLIP_TRANSACTION_READ_BODY) + +// ------------------------------------------------------------------------ // SocketStream // ------------------------------------------------------------------------ diff --git a/net/flip/flip_network_transaction.cc b/net/flip/flip_network_transaction.cc index c8c55d2..f331665 100644 --- a/net/flip/flip_network_transaction.cc +++ b/net/flip/flip_network_transaction.cc @@ -47,6 +47,7 @@ int FlipNetworkTransaction::Start(const HttpRequestInfo* request_info, CHECK(request_info); CHECK(callback); + load_log_ = load_log; request_ = request_info; start_time_ = base::TimeTicks::Now(); @@ -156,30 +157,46 @@ int FlipNetworkTransaction::DoLoop(int result) { switch (state) { case STATE_INIT_CONNECTION: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION); rv = DoInitConnection(); break; case STATE_INIT_CONNECTION_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_INIT_CONNECTION); rv = DoInitConnectionComplete(rv); break; case STATE_SEND_REQUEST: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST); rv = DoSendRequest(); break; case STATE_SEND_REQUEST_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_SEND_REQUEST); rv = DoSendRequestComplete(rv); break; case STATE_READ_HEADERS: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS); rv = DoReadHeaders(); break; case STATE_READ_HEADERS_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_HEADERS); rv = DoReadHeadersComplete(rv); break; case STATE_READ_BODY: DCHECK_EQ(OK, rv); + LoadLog::BeginEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY); rv = DoReadBody(); break; case STATE_READ_BODY_COMPLETE: + LoadLog::EndEvent(load_log_, + LoadLog::TYPE_FLIP_TRANSACTION_READ_BODY); rv = DoReadBodyComplete(rv); break; case STATE_NONE: diff --git a/net/flip/flip_network_transaction.h b/net/flip/flip_network_transaction.h index ae1588d..eab2f45 100644 --- a/net/flip/flip_network_transaction.h +++ b/net/flip/flip_network_transaction.h @@ -87,6 +87,8 @@ class FlipNetworkTransaction : public HttpTransaction { int DoReadBody(); int DoReadBodyComplete(int result); + scoped_refptr<LoadLog> load_log_; + // The Flip session servicing this request. If NULL, the request has not // started. scoped_refptr<FlipSession> flip_; diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index ec2a5f7..d02a506 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -477,7 +477,8 @@ void FlipSession::OnWriteComplete(int result) { write_pending_ = false; - LOG(INFO) << "Flip write complete (result=" << result << ")"; + LOG(INFO) << "Flip write complete (result=" << result << ") for stream: " + << in_flight_write_.stream()->stream_id(); if (result >= 0) { // It should not be possible to have written more bytes than our @@ -827,6 +828,9 @@ void FlipSession::OnSynReply(const flip::FlipSynReplyControlFrame* frame, return; } + LOG(INFO) << "FLIP SYN_REPLY RESPONSE HEADERS for stream: " << stream_id; + DumpFlipHeaders(*headers); + // We record content declared as being pushed so that we don't // request a duplicate stream which is already scheduled to be // sent to us. |