diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-27 23:20:45 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-27 23:20:45 +0000 |
commit | d13f51bc832e8e7965e92f5aa4b16b8c10c3f913 (patch) | |
tree | d5a1a413bf8716befbae7d056cd8c6194eed5a98 /chrome/browser/net | |
parent | f2286c23e17c0012d53800a5ef28975b6e22393a (diff) | |
download | chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.zip chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.tar.gz chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.tar.bz2 |
Cleanup: Address some of the todos in net_log.h
- Get rid of the AddString() and AddStringLiteral() methods.
- Make EventParameters able to serialize to JSON, instead of a string.
BUG=37421
Review URL: http://codereview.chromium.org/1716007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r-- | chrome/browser/net/passive_log_collector.cc | 5 | ||||
-rw-r--r-- | chrome/browser/net/passive_log_collector_unittest.cc | 101 |
2 files changed, 56 insertions, 50 deletions
diff --git a/chrome/browser/net/passive_log_collector.cc b/chrome/browser/net/passive_log_collector.cc index 9ffac48..59d848c 100644 --- a/chrome/browser/net/passive_log_collector.cc +++ b/chrome/browser/net/passive_log_collector.cc @@ -320,7 +320,7 @@ void PassiveLogCollector::ConnectJobTracker::AppendLogEntries( RequestInfo* connect_info = GetRequestInfo(connect_id); if (!connect_info) { net::NetLogStringParameter* text = new net::NetLogStringParameter( - StringPrintf("Used ConnectJob id=%u", connect_id)); + "todo", StringPrintf("Used ConnectJob id=%u", connect_id)); Entry new_entry(0, net::NetLog::TYPE_TODO_STRING, base::TimeTicks(), net::NetLog::Source(net::NetLog::SOURCE_CONNECT_JOB, connect_id), @@ -383,7 +383,7 @@ void PassiveLogCollector::SocketTracker::AppendLogEntries( RequestInfo* socket_info = GetRequestInfo(socket_id); if (!socket_info) { net::NetLogStringParameter* text = new net::NetLogStringParameter( - StringPrintf("Used Socket id=%u.", socket_id)); + "todo", StringPrintf("Used Socket id=%u.", socket_id)); Entry new_entry(0, net::NetLog::TYPE_TODO_STRING, base::TimeTicks(), net::NetLog::Source(net::NetLog::SOURCE_SOCKET, socket_id), net::NetLog::PHASE_NONE, text); @@ -397,6 +397,7 @@ void PassiveLogCollector::SocketTracker::AppendLogEntries( // Synthesize a log entry for bytes sent and received. if (socket_info->bytes_transmitted > 0 || socket_info->bytes_received > 0) { net::NetLogStringParameter* text = new net::NetLogStringParameter( + "stats", StringPrintf("Tx/Rx: %"PRIu64"/%"PRIu64" [%"PRIu64"/%"PRIu64 " total on socket] (Bytes)", socket_info->bytes_transmitted, diff --git a/chrome/browser/net/passive_log_collector_unittest.cc b/chrome/browser/net/passive_log_collector_unittest.cc index 40dfc92e..1fa5b8e 100644 --- a/chrome/browser/net/passive_log_collector_unittest.cc +++ b/chrome/browser/net/passive_log_collector_unittest.cc @@ -25,7 +25,7 @@ PassiveLogCollector::Entry MakeStartLogEntryWithURL(int source_id, base::TimeTicks(), NetLog::Source(kSourceType, source_id), NetLog::PHASE_BEGIN, - new net::NetLogStringParameter(url)); + new net::NetLogStringParameter("url", url)); } PassiveLogCollector::Entry MakeStartLogEntry(int source_id) { @@ -50,7 +50,7 @@ void AddStartURLRequestEntries(PassiveLogCollector* collector, uint32 id) { collector->OnAddEntry(NetLog::TYPE_URL_REQUEST_START, base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, id), NetLog::PHASE_BEGIN, new net::NetLogStringParameter( - StringPrintf("http://req%d", id))); + "url", StringPrintf("http://req%d", id))); } void AddEndURLRequestEntries(PassiveLogCollector* collector, uint32 id) { @@ -59,6 +59,11 @@ void AddEndURLRequestEntries(PassiveLogCollector* collector, uint32 id) { NetLog::PHASE_END, NULL); } +std::string GetStringParam(const PassiveLogCollector::Entry& entry) { + return static_cast<net::NetLogStringParameter*>( + entry.extra_parameters.get())->value(); +} + static const int kMaxNumLoadLogEntries = 1; } // namespace @@ -231,14 +236,14 @@ TEST(PassiveLogCollectorTest, BasicConnectJobAssociation) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 21)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 21), NetLog::PHASE_BEGIN, NULL); @@ -275,7 +280,7 @@ TEST(PassiveLogCollectorTest, BasicSocketAssociation) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); @@ -285,7 +290,7 @@ TEST(PassiveLogCollectorTest, BasicSocketAssociation) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 21)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 21), NetLog::PHASE_BEGIN, NULL); @@ -304,10 +309,10 @@ TEST(PassiveLogCollectorTest, BasicSocketAssociation) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 21)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(2u, requests.size()); @@ -317,10 +322,10 @@ TEST(PassiveLogCollectorTest, BasicSocketAssociation) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(25)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 25)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), @@ -377,10 +382,10 @@ TEST(PassiveLogCollectorTest, IdleSocketAssociation) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(25)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 25)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), @@ -428,7 +433,7 @@ TEST(PassiveLogCollectorTest, IdleAssociateAfterConnectJobStarted) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); @@ -438,7 +443,7 @@ TEST(PassiveLogCollectorTest, IdleAssociateAfterConnectJobStarted) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 21)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 21), NetLog::PHASE_BEGIN, NULL); @@ -457,10 +462,10 @@ TEST(PassiveLogCollectorTest, IdleAssociateAfterConnectJobStarted) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(25)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 25)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), @@ -508,7 +513,7 @@ TEST(PassiveLogCollectorTest, LateBindDifferentConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); @@ -518,7 +523,7 @@ TEST(PassiveLogCollectorTest, LateBindDifferentConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 21)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 21), NetLog::PHASE_BEGIN, NULL); @@ -550,10 +555,10 @@ TEST(PassiveLogCollectorTest, LateBindDifferentConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 21)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(31)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 31)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(2u, requests.size()); @@ -563,10 +568,10 @@ TEST(PassiveLogCollectorTest, LateBindDifferentConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(25)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 25)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), @@ -637,10 +642,10 @@ TEST(PassiveLogCollectorTest, LateBindPendingConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(21)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 21)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(2u, requests.size()); @@ -650,10 +655,10 @@ TEST(PassiveLogCollectorTest, LateBindPendingConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(25)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 25)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), @@ -701,7 +706,7 @@ TEST(PassiveLogCollectorTest, ReconnectToIdleSocket) { // Initial socket. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), NetLog::PHASE_NONE, NULL); @@ -713,7 +718,7 @@ TEST(PassiveLogCollectorTest, ReconnectToIdleSocket) { // Reconnect. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(17)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 17)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 17), NetLog::PHASE_NONE, NULL); @@ -747,7 +752,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundSocket) { // Initial socket. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), NetLog::PHASE_NONE, NULL); @@ -759,7 +764,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundSocket) { // Now reconnect. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); @@ -771,7 +776,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundSocket) { // But we get late bound to an idle socket. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(17)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 17)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 17), NetLog::PHASE_NONE, NULL); @@ -805,7 +810,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundConnectJob) { // Initial socket. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), NetLog::PHASE_NONE, NULL); @@ -817,7 +822,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundConnectJob) { // Now reconnect. log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); @@ -835,7 +840,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundConnectJob) { NetLog::PHASE_END, NULL); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(12)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 12)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(1u, requests.size()); @@ -843,7 +848,7 @@ TEST(PassiveLogCollectorTest, ReconnectToLateBoundConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(17)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 17)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 17), NetLog::PHASE_NONE, NULL); @@ -876,7 +881,7 @@ TEST(PassiveLogCollectorTest, LostConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_BEGIN, new net::NetLogIntegerParameter("x", 11)); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_CONNECT_JOB, 11), NetLog::PHASE_BEGIN, NULL); @@ -895,7 +900,7 @@ TEST(PassiveLogCollectorTest, LostConnectJob) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(11)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 11)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(1u, requests.size()); @@ -912,7 +917,7 @@ TEST(PassiveLogCollectorTest, LostSocket) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), NetLog::PHASE_BEGIN, NULL); @@ -947,7 +952,7 @@ TEST(PassiveLogCollectorTest, AccumulateRxTxData) { log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 10), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), NetLog::PHASE_NONE, NULL); @@ -958,23 +963,23 @@ TEST(PassiveLogCollectorTest, AccumulateRxTxData) { log.OnAddEntry(NetLog::TYPE_SOCKET_BYTES_SENT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), - NetLog::PHASE_END, new net::NetLogIntegerParameter(1)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 1)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(1u, requests.size()); EXPECT_EQ(5u, requests[0].entries.size()); EXPECT_EQ(NetLog::TYPE_TODO_STRING, requests[0].entries[4].type); EXPECT_EQ("Tx/Rx: 1/0 [1/0 total on socket] (Bytes)", - requests[0].entries[4].extra_parameters->ToString()); + GetStringParam(requests[0].entries[4])); log.OnAddEntry(NetLog::TYPE_SOCKET_BYTES_RECEIVED , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), - NetLog::PHASE_END, new net::NetLogIntegerParameter(2)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 2)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(1u, requests.size()); EXPECT_EQ(5u, requests[0].entries.size()); EXPECT_EQ(NetLog::TYPE_TODO_STRING, requests[0].entries[4].type); EXPECT_EQ("Tx/Rx: 1/2 [1/2 total on socket] (Bytes)", - requests[0].entries[4].extra_parameters->ToString()); + GetStringParam(requests[0].entries[4])); AddEndURLRequestEntries(&log, 10); requests = log.url_request_tracker()->GetLiveRequests(); @@ -984,13 +989,13 @@ TEST(PassiveLogCollectorTest, AccumulateRxTxData) { EXPECT_EQ(6u, requests[0].entries.size()); EXPECT_EQ(NetLog::TYPE_TODO_STRING, requests[0].entries[4].type); EXPECT_EQ("Tx/Rx: 1/2 [1/2 total on socket] (Bytes)", - requests[0].entries[4].extra_parameters->ToString()); + GetStringParam(requests[0].entries[4])); AddStartURLRequestEntries(&log, 20); log.OnAddEntry(NetLog::TYPE_SOCKET_POOL_SOCKET_ID , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_URL_REQUEST, 20), - NetLog::PHASE_END, new net::NetLogIntegerParameter(15)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 15)); log.OnAddEntry(NetLog::TYPE_SOCKS_CONNECT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), NetLog::PHASE_NONE, NULL); @@ -1001,16 +1006,16 @@ TEST(PassiveLogCollectorTest, AccumulateRxTxData) { log.OnAddEntry(NetLog::TYPE_SOCKET_BYTES_SENT , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), - NetLog::PHASE_END, new net::NetLogIntegerParameter(4)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 4)); log.OnAddEntry(NetLog::TYPE_SOCKET_BYTES_RECEIVED , base::TimeTicks(), NetLog::Source(NetLog::SOURCE_SOCKET, 15), - NetLog::PHASE_END, new net::NetLogIntegerParameter(8)); + NetLog::PHASE_END, new net::NetLogIntegerParameter("x", 8)); requests = log.url_request_tracker()->GetLiveRequests(); EXPECT_EQ(1u, requests.size()); EXPECT_EQ(5u, requests[0].entries.size()); EXPECT_EQ(NetLog::TYPE_TODO_STRING, requests[0].entries[4].type); EXPECT_EQ("Tx/Rx: 4/8 [5/10 total on socket] (Bytes)", - requests[0].entries[4].extra_parameters->ToString()); + GetStringParam(requests[0].entries[4])); AddEndURLRequestEntries(&log, 20); requests = log.url_request_tracker()->GetLiveRequests(); |