summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 00:35:22 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-02 00:35:22 +0000
commitf6c63db5717961da5fee29631da4c3dcbf9d038f (patch)
tree1ef3d5fecd8147946ecc94ccb4cab9d0ddb3bf0f /net/base
parent0d0b59d9367b35ff7d6649c8dd1b5deaadf80bf4 (diff)
downloadchromium_src-f6c63db5717961da5fee29631da4c3dcbf9d038f.zip
chromium_src-f6c63db5717961da5fee29631da4c3dcbf9d038f.tar.gz
chromium_src-f6c63db5717961da5fee29631da4c3dcbf9d038f.tar.bz2
LoadTiming in net part 5:
Add a NetLog event source for SpdyProxyClientSockets, and a couple new NetLog events as well. This results in all requests that go over the same tunnelled stream having the same unique socket ID. This also serves to prevent too much random stuff, like SSL handshakes and SSL reads/writes from being logged in the proxy's SPDY_SESSION. BUG=77446 Review URL: https://codereview.chromium.org/12093011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180214 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/capturing_net_log.cc17
-rw-r--r--net/base/capturing_net_log.h9
-rw-r--r--net/base/load_timing_info.h18
-rw-r--r--net/base/net_log.cc1
-rw-r--r--net/base/net_log_event_type_list.h16
-rw-r--r--net/base/net_log_source_type_list.h1
6 files changed, 55 insertions, 7 deletions
diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc
index 0ffdfb7..b90dcae 100644
--- a/net/base/capturing_net_log.cc
+++ b/net/base/capturing_net_log.cc
@@ -79,6 +79,17 @@ void CapturingNetLog::GetEntries(CapturedEntryList* entry_list) const {
*entry_list = captured_entries_;
}
+void CapturingNetLog::GetEntriesForSource(NetLog::Source source,
+ CapturedEntryList* entry_list) const {
+ base::AutoLock lock(lock_);
+ entry_list->clear();
+ for (CapturedEntryList::const_iterator entry = captured_entries_.begin();
+ entry != captured_entries_.end(); ++entry) {
+ if (entry->source.id == source.id)
+ entry_list->push_back(*entry);
+ }
+}
+
size_t CapturingNetLog::GetSize() const {
base::AutoLock lock(lock_);
return captured_entries_.size();
@@ -152,6 +163,12 @@ void CapturingBoundNetLog::GetEntries(
capturing_net_log_.GetEntries(entry_list);
}
+void CapturingBoundNetLog::GetEntriesForSource(
+ NetLog::Source source,
+ CapturingNetLog::CapturedEntryList* entry_list) const {
+ capturing_net_log_.GetEntriesForSource(source, entry_list);
+}
+
size_t CapturingBoundNetLog::GetSize() const {
return capturing_net_log_.GetSize();
}
diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h
index ec78a3f..d3586d1 100644
--- a/net/base/capturing_net_log.h
+++ b/net/base/capturing_net_log.h
@@ -74,6 +74,10 @@ class CapturingNetLog : public NetLog {
// Returns the list of all entries in the log.
void GetEntries(CapturedEntryList* entry_list) const;
+ // Fills |entry_list| with all entries in the log from the specified Source.
+ void GetEntriesForSource(NetLog::Source source,
+ CapturedEntryList* entry_list) const;
+
// Returns number of entries in the log.
size_t GetSize() const;
@@ -121,6 +125,11 @@ class CapturingBoundNetLog {
// Fills |entry_list| with all entries in the log.
void GetEntries(CapturingNetLog::CapturedEntryList* entry_list) const;
+ // Fills |entry_list| with all entries in the log from the specified Source.
+ void GetEntriesForSource(
+ NetLog::Source source,
+ CapturingNetLog::CapturedEntryList* entry_list) const;
+
// Returns number of entries in the log.
size_t GetSize() const;
diff --git a/net/base/load_timing_info.h b/net/base/load_timing_info.h
index 3e876bd..82cd9fb 100644
--- a/net/base/load_timing_info.h
+++ b/net/base/load_timing_info.h
@@ -11,6 +11,12 @@
namespace net {
+// Structure containing timing information for a request.
+// It addresses the needs of
+// http://groups.google.com/group/http-archive-specification/web/har-1-1-spec,
+// http://dev.w3.org/2006/webapi/WebTiming/, and
+// http://www.w3.org/TR/resource-timing/.
+//
// All events that do not apply to a request have null times. For non-HTTP
// requests, all times other than the request_start times are null.
//
@@ -96,11 +102,13 @@ struct NET_EXPORT LoadTimingInfo {
bool socket_reused;
// Unique socket ID, can be used to identify requests served by the same
- // socket.
- // TODO(mmenke): Do something reasonable for SPDY proxies. Currently, SPDY
- // sessions (And HTTPS requests?) over SPDY proxies use the ID
- // of the SPDY proxy's session. HTTP requests, however, use
- // the ID of the SPDY proxy's socket.
+ // socket. For connections tunnelled over SPDY proxies, this is the ID of
+ // the virtual connection (The SpdyProxyClientSocket), not the ID of the
+ // actual socket. HTTP requests handled by the SPDY proxy itself all use the
+ // actual socket's ID.
+ //
+ // 0 when there is no socket associated with the request, or it's not an HTTP
+ // request.
uint32 socket_log_id;
// Start time as a base::Time, so times can be coverted into actual times.
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index b811db4..d6b6f39 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -73,6 +73,7 @@ Value* NetLogString16Callback(const char* name,
} // namespace
+// LoadTimingInfo requires this be 0.
const uint32 NetLog::Source::kInvalidId = 0;
NetLog::Source::Source() : type(SOURCE_NONE), id(kInvalidId) {
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h
index faa231f7..10fa5c4 100644
--- a/net/base/net_log_event_type_list.h
+++ b/net/base/net_log_event_type_list.h
@@ -333,7 +333,7 @@ EVENT_TYPE(SUBMITTED_TO_RESOLVER_THREAD)
// Socket (Shared by stream and datagram sockets)
// ------------------------------------------------------------------------
-// Marks the begin/end of a socket (TCP/SOCKS/SSL/UDP).
+// Marks the begin/end of a socket (TCP/SOCKS/SSL/UDP/"SpdyProxyClientSocket").
//
// The BEGIN phase contains the following parameters:
//
@@ -518,7 +518,9 @@ EVENT_TYPE(SSL_VERIFICATION_MERGED)
// }
EVENT_TYPE(SSL_NSS_ERROR)
-// The specified number of bytes were sent on the socket.
+// The specified number of bytes were sent on the socket. Depending on the
+// source of the event, may be logged either once the data is sent, or when it
+// is queued to be sent.
// The following parameters are attached:
// {
// "byte_count": <Number of bytes that were just sent>,
@@ -1205,6 +1207,16 @@ EVENT_TYPE(SPDY_STREAM_UPDATE_RECV_WINDOW)
EVENT_TYPE(SPDY_STREAM_ERROR)
// ------------------------------------------------------------------------
+// SpdyProxyClientSocket
+// ------------------------------------------------------------------------
+
+EVENT_TYPE(SPDY_PROXY_CLIENT_SESSION)
+// Identifies the SPDY session a source is using.
+// {
+// "source_dependency": <Source identifier for the underlying session>,
+// }
+
+// ------------------------------------------------------------------------
// HttpStreamParser
// ------------------------------------------------------------------------
diff --git a/net/base/net_log_source_type_list.h b/net/base/net_log_source_type_list.h
index 24d9574..66a5298 100644
--- a/net/base/net_log_source_type_list.h
+++ b/net/base/net_log_source_type_list.h
@@ -27,3 +27,4 @@ SOURCE_TYPE(DOWNLOAD)
SOURCE_TYPE(FILESTREAM)
SOURCE_TYPE(IPV6_PROBE_JOB)
SOURCE_TYPE(DNS_PROBER)
+SOURCE_TYPE(PROXY_CLIENT_SOCKET)