summaryrefslogtreecommitdiffstats
path: root/net/quic
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-13 23:27:19 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-13 23:27:19 +0000
commite6ca75e7b1dc3c2e3208317b8d12252d514a522a (patch)
treed11c4f46b57581a3aea1d77964faf8468ae04a0a /net/quic
parent42a0f617d0e501fafee5e5ba67768d31d3c9acfc (diff)
downloadchromium_src-e6ca75e7b1dc3c2e3208317b8d12252d514a522a.zip
chromium_src-e6ca75e7b1dc3c2e3208317b8d12252d514a522a.tar.gz
chromium_src-e6ca75e7b1dc3c2e3208317b8d12252d514a522a.tar.bz2
Revert 182331
> Enhance net internals/net log output for QUIC. > > > Review URL: https://chromiumcodereview.appspot.com/12207020 TBR=rch@chromium.org Review URL: https://codereview.chromium.org/12252024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic')
-rw-r--r--net/quic/quic_client_session.cc19
-rw-r--r--net/quic/quic_client_session.h7
-rw-r--r--net/quic/quic_client_session_test.cc3
-rw-r--r--net/quic/quic_http_stream.cc34
-rw-r--r--net/quic/quic_http_stream.h2
-rw-r--r--net/quic/quic_http_stream_test.cc2
-rw-r--r--net/quic/quic_reliable_client_stream.cc4
-rw-r--r--net/quic/quic_reliable_client_stream.h6
-rw-r--r--net/quic/quic_reliable_client_stream_test.cc2
-rw-r--r--net/quic/quic_stream_factory.cc2
10 files changed, 10 insertions, 71 deletions
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index b67e8d9..90b44e5 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -19,25 +19,17 @@ namespace net {
QuicClientSession::QuicClientSession(QuicConnection* connection,
QuicConnectionHelper* helper,
QuicStreamFactory* stream_factory,
- const string& server_hostname,
- NetLog* net_log)
+ const string& server_hostname)
: QuicSession(connection, false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(crypto_stream_(this, server_hostname)),
helper_(helper),
stream_factory_(stream_factory),
read_buffer_(new IOBufferWithSize(kMaxPacketSize)),
- read_pending_(false),
- num_total_streams_(0),
- net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)) {
- // TODO(rch): pass in full host port proxy pair
- net_log_.BeginEvent(
- NetLog::TYPE_QUIC_SESSION,
- NetLog::StringCallback("host", &server_hostname));
+ read_pending_(false) {
}
QuicClientSession::~QuicClientSession() {
- net_log_.EndEvent(NetLog::TYPE_QUIC_SESSION);
}
QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() {
@@ -51,9 +43,8 @@ QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() {
return NULL;
}
QuicReliableClientStream* stream =
- new QuicReliableClientStream(GetNextStreamId(), this, net_log_);
+ new QuicReliableClientStream(GetNextStreamId(), this);
ActivateStream(stream);
- ++num_total_streams_;
return stream;
}
@@ -125,16 +116,12 @@ void QuicClientSession::CloseSessionOnError(int error) {
CloseStream(id);
}
stream_factory_->OnSessionClose(this);
- net_log_.BeginEvent(
- NetLog::TYPE_QUIC_SESSION,
- NetLog::IntegerCallback("net_error", error));
}
Value* QuicClientSession::GetInfoAsValue(const HostPortPair& pair) const {
DictionaryValue* dict = new DictionaryValue();
dict->SetString("host_port_pair", pair.ToString());
dict->SetInteger("open_streams", GetNumOpenStreams());
- dict->SetInteger("total_streams", num_total_streams_);
dict->SetString("peer_address", peer_address().ToString());
dict->SetString("guid", base::Uint64ToString(guid()));
return dict;
diff --git a/net/quic/quic_client_session.h b/net/quic/quic_client_session.h
index 0247e4d..637514f 100644
--- a/net/quic/quic_client_session.h
+++ b/net/quic/quic_client_session.h
@@ -31,8 +31,7 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicSession {
QuicClientSession(QuicConnection* connection,
QuicConnectionHelper* helper,
QuicStreamFactory* stream_factory,
- const std::string& server_hostname,
- NetLog* net_log);
+ const std::string& server_hostname);
virtual ~QuicClientSession();
@@ -54,8 +53,6 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicSession {
base::Value* GetInfoAsValue(const HostPortPair& pair) const;
- const BoundNetLog& net_log() const { return net_log_; }
-
protected:
// QuicSession methods:
virtual ReliableQuicStream* CreateIncomingReliableStream(
@@ -72,8 +69,6 @@ class NET_EXPORT_PRIVATE QuicClientSession : public QuicSession {
scoped_refptr<IOBufferWithSize> read_buffer_;
bool read_pending_;
CompletionCallback callback_;
- size_t num_total_streams_;
- BoundNetLog net_log_;
DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
};
diff --git a/net/quic/quic_client_session_test.cc b/net/quic/quic_client_session_test.cc
index cac38b5..4d5b795 100644
--- a/net/quic/quic_client_session_test.cc
+++ b/net/quic/quic_client_session_test.cc
@@ -7,7 +7,6 @@
#include <vector>
#include "base/stl_util.h"
-#include "net/base/capturing_net_log.h"
#include "net/base/test_completion_callback.h"
#include "net/quic/crypto/crypto_protocol.h"
#include "net/quic/test_tools/quic_test_utils.h"
@@ -25,7 +24,7 @@ class QuicClientSessionTest : public ::testing::Test {
QuicClientSessionTest()
: guid_(1),
connection_(new PacketSavingConnection(guid_, IPEndPoint())),
- session_(connection_, NULL, NULL, kServerHostname, NULL) {
+ session_(connection_, NULL, NULL, kServerHostname) {
}
QuicGuid guid_;
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index 0eaf0a1..4439ef7 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -48,7 +48,6 @@ int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info,
const CompletionCallback& callback) {
CHECK(stream_);
- stream_net_log_ = stream_net_log;
request_info_ = request_info;
return OK;
@@ -73,32 +72,12 @@ int QuicHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
SpdyFramer::WriteHeaderBlock(&builder, 3, &headers);
scoped_ptr<SpdyFrame> frame(builder.take());
request_ = std::string(frame->data(), len);
- // Log the actual request with the URL Request's net log.
- stream_net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS,
- base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
- // Also log to the QuicSession's net log.
- stream_->net_log().AddEvent(
- NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS,
- base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
} else {
std::string path = HttpUtil::PathForRequest(request_info_->url);
std::string first_line = base::StringPrintf("%s %s HTTP/1.1\r\n",
request_info_->method.c_str(),
path.c_str());
request_ = first_line + request_headers.ToString();
- // Log the actual request with the URL Request's net log.
- stream_net_log_.AddEvent(
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS,
- base::Bind(&HttpRequestHeaders::NetLogCallback,
- base::Unretained(&request_headers),
- &first_line));
- // Also log to the QuicSession's net log.
- stream_->net_log().AddEvent(
- NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS,
- base::Bind(&HttpRequestHeaders::NetLogCallback,
- base::Unretained(&request_headers),
- &first_line));
}
// Store the request body.
@@ -479,12 +458,6 @@ int QuicHttpStream::ParseResponseHeaders() {
BufferResponseBody(read_buf_->data(), delta);
}
- // The URLRequest logs these headers, so only log to the QuicSession's
- // net log.
- stream_->net_log().AddEvent(
- NetLog::TYPE_QUIC_HTTP_STREAM_READ_RESPONSE_HEADERS,
- base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
-
SpdyHeadersToHttpResponse(headers, 3, response_info_);
// Put the peer's IP address and port into the response.
IPEndPoint address = stream_->GetPeerAddress();
@@ -514,13 +487,6 @@ int QuicHttpStream::ParseResponseHeaders() {
response_info_->vary_data.Init(*request_info_, *response_info_->headers);
response_headers_received_ = true;
- // The URLRequest logs these headers, so only log to the QuicSession's
- // net log.
- stream_->net_log().AddEvent(
- NetLog::TYPE_QUIC_HTTP_STREAM_READ_RESPONSE_HEADERS,
- base::Bind(&HttpResponseHeaders::NetLogCallback,
- response_info_->headers));
-
// Save the remaining received data.
int delta = read_buf_->offset() - end_offset;
if (delta > 0) {
diff --git a/net/quic/quic_http_stream.h b/net/quic/quic_http_stream.h
index 8e0853c..a3dd962 100644
--- a/net/quic/quic_http_stream.h
+++ b/net/quic/quic_http_stream.h
@@ -138,8 +138,6 @@ class NET_EXPORT_PRIVATE QuicHttpStream :
// Wraps raw_request_body_buf_ to read the remaining data progressively.
scoped_refptr<DrainableIOBuffer> request_body_buf_;
- BoundNetLog stream_net_log_;
-
base::WeakPtrFactory<QuicHttpStream> weak_factory_;
};
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index 4a5f333..641a306 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -174,7 +174,7 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<bool> {
connection_->SetSendAlgorithm(send_algorithm_);
connection_->SetReceiveAlgorithm(receive_algorithm_);
session_.reset(new QuicClientSession(connection_, helper_, NULL,
- "www.google.com", NULL));
+ "www.google.com"));
CryptoHandshakeMessage message;
message.tag = kSHLO;
session_->GetCryptoStream()->OnHandshakeMessage(message);
diff --git a/net/quic/quic_reliable_client_stream.cc b/net/quic/quic_reliable_client_stream.cc
index 676db77..d2960f8 100644
--- a/net/quic/quic_reliable_client_stream.cc
+++ b/net/quic/quic_reliable_client_stream.cc
@@ -10,10 +10,8 @@
namespace net {
QuicReliableClientStream::QuicReliableClientStream(QuicStreamId id,
- QuicSession* session,
- const BoundNetLog& net_log)
+ QuicSession* session)
: ReliableQuicStream(id, session),
- net_log_(net_log),
delegate_(NULL) {
}
diff --git a/net/quic/quic_reliable_client_stream.h b/net/quic/quic_reliable_client_stream.h
index 77ac787..fd5e6cc 100644
--- a/net/quic/quic_reliable_client_stream.h
+++ b/net/quic/quic_reliable_client_stream.h
@@ -56,8 +56,7 @@ class NET_EXPORT_PRIVATE QuicReliableClientStream : public ReliableQuicStream {
};
QuicReliableClientStream(QuicStreamId id,
- QuicSession* session,
- const BoundNetLog& net_log);
+ QuicSession* session);
virtual ~QuicReliableClientStream();
@@ -73,10 +72,7 @@ class NET_EXPORT_PRIVATE QuicReliableClientStream : public ReliableQuicStream {
Delegate* GetDelegate() { return delegate_; }
void OnError(int error);
- const BoundNetLog& net_log() const { return net_log_; }
-
private:
- BoundNetLog net_log_;
Delegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(QuicReliableClientStream);
diff --git a/net/quic/quic_reliable_client_stream_test.cc b/net/quic/quic_reliable_client_stream_test.cc
index 7990f16..aa50408 100644
--- a/net/quic/quic_reliable_client_stream_test.cc
+++ b/net/quic/quic_reliable_client_stream_test.cc
@@ -35,7 +35,7 @@ class QuicReliableClientStreamTest : public ::testing::Test {
public:
QuicReliableClientStreamTest()
: session_(new MockConnection(1, IPEndPoint()), false),
- stream_(1, &session_, BoundNetLog()) {
+ stream_(1, &session_) {
stream_.SetDelegate(&delegate_);
}
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index b388719..f9bb6e8 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -378,7 +378,7 @@ QuicClientSession* QuicStreamFactory::CreateSession(
QuicConnection* connection = new QuicConnection(guid, addr, helper);
QuicClientSession* session = new QuicClientSession(connection, helper, this,
- host, net_log.net_log());
+ host);
all_sessions_.insert(session); // owning pointer
return session;
}