diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-21 20:03:19 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-21 20:03:19 +0000 |
commit | c1173dd1715877a08f641c4f94ff709de51ada58 (patch) | |
tree | 3a9eb057baa02f54dd863788562bbb6ea765bc45 /net/socket_stream/socket_stream.cc | |
parent | 4460d9ceda27029cd1474141ec9f114a5b4eadef (diff) | |
download | chromium_src-c1173dd1715877a08f641c4f94ff709de51ada58.zip chromium_src-c1173dd1715877a08f641c4f94ff709de51ada58.tar.gz chromium_src-c1173dd1715877a08f641c4f94ff709de51ada58.tar.bz2 |
Add the ability to enable full logging for LoadLogs.
This works by clicking a button in about:net-internals to turn on active logging.
Right now full logging means:
- Instead of just the most recent 25 requests, keep all requests info.
- Instead of limiting each request to 50 log entries, keep all log entries.
- Instead of saving the first 1000 bytes of request URLs, save all its bytes.
In the future full logging will be expanded to include other log events, and also string messages (so it can mirror what was sent to LOG(INFO) / LOG(WARNING)).
BUG=27552
Review URL: http://codereview.chromium.org/507055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream/socket_stream.cc')
-rw-r--r-- | net/socket_stream/socket_stream.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index 9d60a9e..402b8ec 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -29,7 +29,6 @@ #include "net/socket_stream/socket_stream_throttle.h" #include "net/url_request/url_request.h" -static const int kMaxNumLoadLogEntries = 50; static const int kMaxPendingSendAllowed = 32768; // 32 kilobytes. static const int kReadBufferSize = 4096; @@ -40,8 +39,7 @@ void SocketStream::ResponseHeaders::Realloc(size_t new_size) { } SocketStream::SocketStream(const GURL& url, Delegate* delegate) - : load_log_(new net::LoadLog(kMaxNumLoadLogEntries)), - url_(url), + : url_(url), delegate_(delegate), max_pending_send_allowed_(kMaxPendingSendAllowed), next_state_(STATE_NONE), @@ -99,8 +97,14 @@ void SocketStream::set_context(URLRequestContext* context) { if (prev_context != context) { if (prev_context) prev_context->socket_stream_tracker()->Remove(this); - if (context) + if (context) { + if (!load_log_) { + // Create the LoadLog -- we waited until now to create it so we know + // what constraints the URLRequestContext is enforcing on log levels. + load_log_ = context->socket_stream_tracker()->CreateLoadLog(); + } context->socket_stream_tracker()->Add(this); + } } if (context_) |