summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-10 20:20:32 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-10 20:20:32 +0000
commit3abacd60fa00bc53d4cf3d28352e855d10533ac0 (patch)
tree444933dd014250163b78713a4e9d7a9ac8d4356b /chrome/browser/net
parent8b2d262447607c79fd3b18efa5eb1e5c2efa4cad (diff)
downloadchromium_src-3abacd60fa00bc53d4cf3d28352e855d10533ac0.zip
chromium_src-3abacd60fa00bc53d4cf3d28352e855d10533ac0.tar.gz
chromium_src-3abacd60fa00bc53d4cf3d28352e855d10533ac0.tar.bz2
Make NetLog take in callbacks that return Values rather
than refcounted objects. Avoids the need to create classes and copy data. Also no longer get time whenever an event is logged. BUG=126243 Review URL: https://chromiumcodereview.appspot.com/10399083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_net_log.cc11
-rw-r--r--chrome/browser/net/chrome_net_log.h5
-rw-r--r--chrome/browser/net/chrome_net_log_unittest.cc8
-rw-r--r--chrome/browser/net/load_timing_observer.cc203
-rw-r--r--chrome/browser/net/load_timing_observer.h36
-rw-r--r--chrome/browser/net/load_timing_observer_unittest.cc320
-rw-r--r--chrome/browser/net/net_log_logger.cc10
-rw-r--r--chrome/browser/net/net_log_logger.h6
8 files changed, 282 insertions, 317 deletions
diff --git a/chrome/browser/net/chrome_net_log.cc b/chrome/browser/net/chrome_net_log.cc
index fb6ccf8..7c345b4f 100644
--- a/chrome/browser/net/chrome_net_log.cc
+++ b/chrome/browser/net/chrome_net_log.cc
@@ -49,18 +49,11 @@ ChromeNetLog::~ChromeNetLog() {
RemoveThreadSafeObserver(net_log_logger_.get());
}
-void ChromeNetLog::AddEntry(
- EventType type,
- const Source& source,
- EventPhase phase,
- const scoped_refptr<EventParameters>& params) {
- base::TimeTicks time(base::TimeTicks::Now());
-
+void ChromeNetLog::OnAddEntry(const net::NetLog::Entry& entry) {
base::AutoLock lock(lock_);
// Notify all of the log observers.
- FOR_EACH_OBSERVER(ThreadSafeObserver, observers_,
- OnAddEntry(type, time, source, phase, params));
+ FOR_EACH_OBSERVER(ThreadSafeObserver, observers_, OnAddEntry(entry));
}
uint32 ChromeNetLog::NextID() {
diff --git a/chrome/browser/net/chrome_net_log.h b/chrome/browser/net/chrome_net_log.h
index e297d33..adbad5e 100644
--- a/chrome/browser/net/chrome_net_log.h
+++ b/chrome/browser/net/chrome_net_log.h
@@ -42,10 +42,7 @@ class ChromeNetLog : public net::NetLog {
private:
// NetLog implementation:
- virtual void AddEntry(EventType type,
- const Source& source,
- EventPhase phase,
- const scoped_refptr<EventParameters>& params) OVERRIDE;
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
// Called whenever an observer is added or removed, or has its log level
// changed. Must have acquired |lock_| prior to calling.
diff --git a/chrome/browser/net/chrome_net_log_unittest.cc b/chrome/browser/net/chrome_net_log_unittest.cc
index d04dfb7..4f89f7d 100644
--- a/chrome/browser/net/chrome_net_log_unittest.cc
+++ b/chrome/browser/net/chrome_net_log_unittest.cc
@@ -22,11 +22,7 @@ class CountingObserver : public net::NetLog::ThreadSafeObserver {
net_log()->RemoveThreadSafeObserver(this);
}
- virtual void OnAddEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) OVERRIDE {
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE {
++count_;
}
@@ -37,7 +33,7 @@ class CountingObserver : public net::NetLog::ThreadSafeObserver {
};
void AddEvent(ChromeNetLog* net_log) {
- net_log->AddGlobalEntry(net::NetLog::TYPE_CANCELLED, NULL);
+ net_log->AddGlobalEntry(net::NetLog::TYPE_CANCELLED);
}
// A thread that waits until an event has been signalled before calling
diff --git a/chrome/browser/net/load_timing_observer.cc b/chrome/browser/net/load_timing_observer.cc
index b6760bc..d230f2b 100644
--- a/chrome/browser/net/load_timing_observer.cc
+++ b/chrome/browser/net/load_timing_observer.cc
@@ -83,22 +83,18 @@ LoadTimingObserver::GetURLRequestRecord(uint32 source_id) {
return NULL;
}
-void LoadTimingObserver::OnAddEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
+void LoadTimingObserver::OnAddEntry(const net::NetLog::Entry& entry) {
// The events that the Observer is interested in only occur on the IO thread.
if (!BrowserThread::CurrentlyOn(BrowserThread::IO))
return;
- if (source.type == net::NetLog::SOURCE_URL_REQUEST)
- OnAddURLRequestEntry(type, time, source, phase, params);
- else if (source.type == net::NetLog::SOURCE_HTTP_STREAM_JOB)
- OnAddHTTPStreamJobEntry(type, time, source, phase, params);
- else if (source.type == net::NetLog::SOURCE_CONNECT_JOB)
- OnAddConnectJobEntry(type, time, source, phase, params);
- else if (source.type == net::NetLog::SOURCE_SOCKET)
- OnAddSocketEntry(type, time, source, phase, params);
+ if (entry.source().type == net::NetLog::SOURCE_URL_REQUEST)
+ OnAddURLRequestEntry(entry);
+ else if (entry.source().type == net::NetLog::SOURCE_HTTP_STREAM_JOB)
+ OnAddHTTPStreamJobEntry(entry);
+ else if (entry.source().type == net::NetLog::SOURCE_CONNECT_JOB)
+ OnAddConnectJobEntry(entry);
+ else if (entry.source().type == net::NetLog::SOURCE_SOCKET)
+ OnAddSocketEntry(entry);
}
// static
@@ -125,23 +121,23 @@ void LoadTimingObserver::PopulateTimingInfo(
}
}
-void LoadTimingObserver::OnAddURLRequestEntry(
- net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
+void LoadTimingObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool is_begin = phase == net::NetLog::PHASE_BEGIN;
- bool is_end = phase == net::NetLog::PHASE_END;
+ bool is_begin = entry.phase() == net::NetLog::PHASE_BEGIN;
+ bool is_end = entry.phase() == net::NetLog::PHASE_END;
- if (type == net::NetLog::TYPE_URL_REQUEST_START_JOB) {
+ if (entry.type() == net::NetLog::TYPE_URL_REQUEST_START_JOB) {
if (is_begin) {
// Only record timing for entries with corresponding flag.
- int load_flags =
- static_cast<net::URLRequestStartEventParameters*>(params)->
- load_flags();
+ int load_flags;
+ scoped_ptr<Value> event_params(entry.ParametersToValue());
+ if (!net::StartEventLoadFlagsFromEventParams(event_params.get(),
+ &load_flags)) {
+ NOTREACHED();
+ return;
+ }
+
if (!(load_flags & net::LOAD_ENABLE_LOAD_TIMING))
return;
@@ -153,38 +149,48 @@ void LoadTimingObserver::OnAddURLRequestEntry(
url_request_to_record_.clear();
}
- URLRequestRecord& record = url_request_to_record_[source.id];
- record.base_ticks = time;
+ URLRequestRecord& record = url_request_to_record_[entry.source().id];
+ base::TimeTicks now = GetCurrentTime();
+ record.base_ticks = now;
record.timing = ResourceLoadTimingInfo();
- record.timing.base_ticks = time;
- record.timing.base_time = TimeTicksToTime(time);
+ record.timing.base_ticks = now;
+ record.timing.base_time = TimeTicksToTime(now);
}
return;
- } else if (type == net::NetLog::TYPE_REQUEST_ALIVE) {
+ } else if (entry.type() == net::NetLog::TYPE_REQUEST_ALIVE) {
// Cleanup records based on the TYPE_REQUEST_ALIVE entry.
if (is_end)
- url_request_to_record_.erase(source.id);
+ url_request_to_record_.erase(entry.source().id);
return;
}
- URLRequestRecord* record = GetURLRequestRecord(source.id);
+ URLRequestRecord* record = GetURLRequestRecord(entry.source().id);
if (!record)
return;
ResourceLoadTimingInfo& timing = record->timing;
- switch (type) {
+ switch (entry.type()) {
case net::NetLog::TYPE_PROXY_SERVICE:
if (is_begin)
- timing.proxy_start = TimeTicksToOffset(time, record);
+ timing.proxy_start = TimeTicksToOffset(GetCurrentTime(), record);
else if (is_end)
- timing.proxy_end = TimeTicksToOffset(time, record);
+ timing.proxy_end = TimeTicksToOffset(GetCurrentTime(), record);
break;
case net::NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB: {
- uint32 http_stream_job_id = static_cast<net::NetLogSourceParameter*>(
- params)->value().id;
+ net::NetLog::Source http_stream_job_source;
+ scoped_ptr<Value> event_params(entry.ParametersToValue());
+ if (!net::NetLog::Source::FromEventParameters(
+ event_params.get(),
+ &http_stream_job_source)) {
+ NOTREACHED();
+ return;
+ }
+ DCHECK_EQ(net::NetLog::SOURCE_HTTP_STREAM_JOB,
+ http_stream_job_source.type);
+
HTTPStreamJobToRecordMap::iterator it =
- http_stream_job_to_record_.find(http_stream_job_id);
+ http_stream_job_to_record_.find(http_stream_job_source.id);
if (it == http_stream_job_to_record_.end())
return;
if (!it->second.connect_start.is_null()) {
@@ -207,15 +213,18 @@ void LoadTimingObserver::OnAddURLRequestEntry(
}
case net::NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST:
if (is_begin)
- timing.send_start = TimeTicksToOffset(time, record);
+ timing.send_start = TimeTicksToOffset(GetCurrentTime(), record);
else if (is_end)
- timing.send_end = TimeTicksToOffset(time, record);
+ timing.send_end = TimeTicksToOffset(GetCurrentTime(), record);
break;
case net::NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS:
- if (is_begin)
- timing.receive_headers_start = TimeTicksToOffset(time, record);
- else if (is_end)
- timing.receive_headers_end = TimeTicksToOffset(time, record);
+ if (is_begin) {
+ timing.receive_headers_start =
+ TimeTicksToOffset(GetCurrentTime(), record);
+ } else if (is_end) {
+ timing.receive_headers_end =
+ TimeTicksToOffset(GetCurrentTime(), record);
+ }
break;
default:
break;
@@ -223,17 +232,13 @@ void LoadTimingObserver::OnAddURLRequestEntry(
}
void LoadTimingObserver::OnAddHTTPStreamJobEntry(
- net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
+ const net::NetLog::Entry& entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool is_begin = phase == net::NetLog::PHASE_BEGIN;
- bool is_end = phase == net::NetLog::PHASE_END;
+ bool is_begin = entry.phase() == net::NetLog::PHASE_BEGIN;
+ bool is_end = entry.phase() == net::NetLog::PHASE_END;
- if (type == net::NetLog::TYPE_HTTP_STREAM_JOB) {
+ if (entry.type() == net::NetLog::TYPE_HTTP_STREAM_JOB) {
if (is_begin) {
// Prevents us from passively growing the memory unbounded in
// case something went wrong. Should not happen.
@@ -244,29 +249,36 @@ void LoadTimingObserver::OnAddHTTPStreamJobEntry(
}
http_stream_job_to_record_.insert(
- std::make_pair(source.id, HTTPStreamJobRecord()));
+ std::make_pair(entry.source().id, HTTPStreamJobRecord()));
} else if (is_end) {
- http_stream_job_to_record_.erase(source.id);
+ http_stream_job_to_record_.erase(entry.source().id);
}
return;
}
HTTPStreamJobToRecordMap::iterator it =
- http_stream_job_to_record_.find(source.id);
+ http_stream_job_to_record_.find(entry.source().id);
if (it == http_stream_job_to_record_.end())
return;
- switch (type) {
+ switch (entry.type()) {
case net::NetLog::TYPE_SOCKET_POOL:
if (is_begin)
- it->second.connect_start = time;
+ it->second.connect_start = GetCurrentTime();
else if (is_end)
- it->second.connect_end = time;
+ it->second.connect_end = GetCurrentTime();
break;
case net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB: {
- uint32 connect_job_id = static_cast<net::NetLogSourceParameter*>(
- params)->value().id;
- if (last_connect_job_id_ == connect_job_id &&
+ net::NetLog::Source connect_job_source;
+ scoped_ptr<Value> event_params(entry.ParametersToValue());
+ if (!net::NetLog::Source::FromEventParameters(event_params.get(),
+ &connect_job_source)) {
+ NOTREACHED();
+ return;
+ }
+ DCHECK_EQ(net::NetLog::SOURCE_CONNECT_JOB, connect_job_source.type);
+
+ if (last_connect_job_id_ == connect_job_source.id &&
!last_connect_job_record_.dns_start.is_null()) {
it->second.dns_start = last_connect_job_record_.dns_start;
it->second.dns_end = last_connect_job_record_.dns_end;
@@ -276,9 +288,17 @@ void LoadTimingObserver::OnAddHTTPStreamJobEntry(
case net::NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET:
it->second.socket_reused = true;
break;
- case net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET:
- it->second.socket_log_id = static_cast<net::NetLogSourceParameter*>(
- params)->value().id;
+ case net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET: {
+ net::NetLog::Source socket_source;
+ scoped_ptr<Value> event_params(entry.ParametersToValue());
+ if (!net::NetLog::Source::FromEventParameters(event_params.get(),
+ &socket_source)) {
+ NOTREACHED();
+ return;
+ }
+ DCHECK_EQ(net::NetLog::SOURCE_SOCKET, socket_source.type);
+
+ it->second.socket_log_id = socket_source.id;
if (!it->second.socket_reused) {
SocketToRecordMap::iterator socket_it =
socket_to_record_.find(it->second.socket_log_id);
@@ -289,24 +309,20 @@ void LoadTimingObserver::OnAddHTTPStreamJobEntry(
}
}
break;
+ }
default:
break;
}
}
-void LoadTimingObserver::OnAddConnectJobEntry(
- net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
+void LoadTimingObserver::OnAddConnectJobEntry(const net::NetLog::Entry& entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool is_begin = phase == net::NetLog::PHASE_BEGIN;
- bool is_end = phase == net::NetLog::PHASE_END;
+ bool is_begin = entry.phase() == net::NetLog::PHASE_BEGIN;
+ bool is_end = entry.phase() == net::NetLog::PHASE_END;
// Manage record lifetime based on the SOCKET_POOL_CONNECT_JOB entry.
- if (type == net::NetLog::TYPE_SOCKET_POOL_CONNECT_JOB) {
+ if (entry.type() == net::NetLog::TYPE_SOCKET_POOL_CONNECT_JOB) {
if (is_begin) {
// Prevents us from passively growing the memory unbounded in case
// something went wrong. Should not happen.
@@ -317,41 +333,36 @@ void LoadTimingObserver::OnAddConnectJobEntry(
}
connect_job_to_record_.insert(
- std::make_pair(source.id, ConnectJobRecord()));
+ std::make_pair(entry.source().id, ConnectJobRecord()));
} else if (is_end) {
ConnectJobToRecordMap::iterator it =
- connect_job_to_record_.find(source.id);
+ connect_job_to_record_.find(entry.source().id);
if (it != connect_job_to_record_.end()) {
last_connect_job_id_ = it->first;
last_connect_job_record_ = it->second;
connect_job_to_record_.erase(it);
}
}
- } else if (type == net::NetLog::TYPE_HOST_RESOLVER_IMPL) {
+ } else if (entry.type() == net::NetLog::TYPE_HOST_RESOLVER_IMPL) {
ConnectJobToRecordMap::iterator it =
- connect_job_to_record_.find(source.id);
+ connect_job_to_record_.find(entry.source().id);
if (it != connect_job_to_record_.end()) {
if (is_begin)
- it->second.dns_start = time;
+ it->second.dns_start = GetCurrentTime();
else if (is_end)
- it->second.dns_end = time;
+ it->second.dns_end = GetCurrentTime();
}
}
}
-void LoadTimingObserver::OnAddSocketEntry(
- net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
+void LoadTimingObserver::OnAddSocketEntry(const net::NetLog::Entry& entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool is_begin = phase == net::NetLog::PHASE_BEGIN;
- bool is_end = phase == net::NetLog::PHASE_END;
+ bool is_begin = entry.phase() == net::NetLog::PHASE_BEGIN;
+ bool is_end = entry.phase() == net::NetLog::PHASE_END;
// Manage record lifetime based on the SOCKET_ALIVE entry.
- if (type == net::NetLog::TYPE_SOCKET_ALIVE) {
+ if (entry.type() == net::NetLog::TYPE_SOCKET_ALIVE) {
if (is_begin) {
// Prevents us from passively growing the memory unbounded in case
// something went wrong. Should not happen.
@@ -362,20 +373,24 @@ void LoadTimingObserver::OnAddSocketEntry(
}
socket_to_record_.insert(
- std::make_pair(source.id, SocketRecord()));
+ std::make_pair(entry.source().id, SocketRecord()));
} else if (is_end) {
- socket_to_record_.erase(source.id);
+ socket_to_record_.erase(entry.source().id);
}
return;
}
- SocketToRecordMap::iterator it = socket_to_record_.find(source.id);
+ SocketToRecordMap::iterator it = socket_to_record_.find(entry.source().id);
if (it == socket_to_record_.end())
return;
- if (type == net::NetLog::TYPE_SSL_CONNECT) {
+ if (entry.type() == net::NetLog::TYPE_SSL_CONNECT) {
if (is_begin)
- it->second.ssl_start = time;
+ it->second.ssl_start = GetCurrentTime();
else if (is_end)
- it->second.ssl_end = time;
+ it->second.ssl_end = GetCurrentTime();
}
}
+
+base::TimeTicks LoadTimingObserver::GetCurrentTime() const {
+ return base::TimeTicks::Now();
+}
diff --git a/chrome/browser/net/load_timing_observer.h b/chrome/browser/net/load_timing_observer.h
index 56d3f8e..7df1c20 100644
--- a/chrome/browser/net/load_timing_observer.h
+++ b/chrome/browser/net/load_timing_observer.h
@@ -70,11 +70,7 @@ class LoadTimingObserver : public net::NetLog::ThreadSafeObserver {
URLRequestRecord* GetURLRequestRecord(uint32 source_id);
// net::NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) OVERRIDE;
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
static void PopulateTimingInfo(net::URLRequest* request,
content::ResourceResponse* response);
@@ -87,33 +83,17 @@ class LoadTimingObserver : public net::NetLog::ThreadSafeObserver {
FRIEND_TEST_ALL_PREFIXES(LoadTimingObserverTest,
SocketRecord);
- void OnAddURLRequestEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params);
-
- void OnAddHTTPStreamJobEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params);
-
- void OnAddConnectJobEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params);
-
- void OnAddSocketEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params);
+ void OnAddURLRequestEntry(const net::NetLog::Entry& entry);
+ void OnAddHTTPStreamJobEntry(const net::NetLog::Entry& entry);
+ void OnAddConnectJobEntry(const net::NetLog::Entry& entry);
+ void OnAddSocketEntry(const net::NetLog::Entry& entry);
URLRequestRecord* CreateURLRequestRecord(uint32 source_id);
void DeleteURLRequestRecord(uint32 source_id);
+ // Returns current time. Virtual for unit tests.
+ virtual base::TimeTicks GetCurrentTime() const;
+
typedef base::hash_map<uint32, URLRequestRecord> URLRequestToRecordMap;
typedef base::hash_map<uint32, HTTPStreamJobRecord> HTTPStreamJobToRecordMap;
typedef base::hash_map<uint32, ConnectJobRecord> ConnectJobToRecordMap;
diff --git a/chrome/browser/net/load_timing_observer_unittest.cc b/chrome/browser/net/load_timing_observer_unittest.cc
index 5859aad..564f10a 100644
--- a/chrome/browser/net/load_timing_observer_unittest.cc
+++ b/chrome/browser/net/load_timing_observer_unittest.cc
@@ -20,385 +20,379 @@ using base::TimeDelta;
using content::BrowserThread;
using net::NetLog;
+class TestLoadTimingObserver : public LoadTimingObserver {
+ public:
+ TestLoadTimingObserver() {}
+ virtual ~TestLoadTimingObserver() {}
+
+ void IncementTime(base::TimeDelta delta) {
+ current_time_ += delta;
+ }
+
+ virtual base::TimeTicks GetCurrentTime() const OVERRIDE {
+ return current_time_;
+ }
+
+ private:
+ base::TimeTicks current_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestLoadTimingObserver);
+};
+
// Serves to identify the current thread as the IO thread.
class LoadTimingObserverTest : public testing::Test {
public:
LoadTimingObserverTest() : io_thread_(BrowserThread::IO, &message_loop_) {
}
+ protected:
+ TestLoadTimingObserver observer_;
+
private:
MessageLoop message_loop_;
content::TestBrowserThread io_thread_;
};
-base::TimeTicks current_time;
+void AddStartEntry(LoadTimingObserver& observer,
+ const NetLog::Source& source,
+ NetLog::EventType type) {
+ net::NetLog::Entry entry(type,
+ source,
+ NetLog::PHASE_BEGIN,
+ NULL,
+ NetLog::LOG_BASIC);
+ observer.OnAddEntry(entry);
+}
void AddStartEntry(LoadTimingObserver& observer,
const NetLog::Source& source,
NetLog::EventType type,
- NetLog::EventParameters* params) {
- observer.OnAddEntry(type, current_time, source, NetLog::PHASE_BEGIN, params);
+ const NetLog::ParametersCallback& params_callback) {
+ net::NetLog::Entry entry(type,
+ source,
+ NetLog::PHASE_BEGIN,
+ &params_callback,
+ NetLog::LOG_BASIC);
+ observer.OnAddEntry(entry);
}
void AddEndEntry(LoadTimingObserver& observer,
const NetLog::Source& source,
- NetLog::EventType type,
- NetLog::EventParameters* params) {
- observer.OnAddEntry(type, current_time, source, NetLog::PHASE_END, params);
+ NetLog::EventType type) {
+ net::NetLog::Entry entry(type,
+ source,
+ NetLog::PHASE_END,
+ NULL,
+ NetLog::LOG_BASIC);
+ observer.OnAddEntry(entry);
}
void AddStartURLRequestEntries(LoadTimingObserver& observer,
uint32 id,
bool request_timing) {
- scoped_refptr<net::URLRequestStartEventParameters> params(
- new net::URLRequestStartEventParameters(
- GURL(base::StringPrintf("http://req%d", id)),
- "GET",
- request_timing ? net::LOAD_ENABLE_LOAD_TIMING : 0,
- net::LOW));
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, id);
- AddStartEntry(observer, source, NetLog::TYPE_REQUEST_ALIVE, NULL);
- AddStartEntry(observer,
- source,
- NetLog::TYPE_URL_REQUEST_START_JOB,
- params.get());
+ AddStartEntry(observer, source, NetLog::TYPE_REQUEST_ALIVE);
+
+ GURL url(base::StringPrintf("http://req%d", id));
+ std::string method = "GET";
+ AddStartEntry(
+ observer,
+ source,
+ NetLog::TYPE_URL_REQUEST_START_JOB,
+ base::Bind(&net::NetLogURLRequestStartCallback,
+ &url,
+ &method,
+ request_timing ? net::LOAD_ENABLE_LOAD_TIMING : 0,
+ net::LOW));
}
void AddEndURLRequestEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, id);
- AddEndEntry(observer, source, NetLog::TYPE_REQUEST_ALIVE, NULL);
- AddEndEntry(observer,
- source,
- NetLog::TYPE_URL_REQUEST_START_JOB,
- NULL);
+ AddEndEntry(observer, source, NetLog::TYPE_REQUEST_ALIVE);
+ AddEndEntry(observer, source, NetLog::TYPE_URL_REQUEST_START_JOB);
}
void AddStartHTTPStreamJobEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_HTTP_STREAM_JOB, id);
- AddStartEntry(observer, source, NetLog::TYPE_HTTP_STREAM_JOB, NULL);
+ AddStartEntry(observer, source, NetLog::TYPE_HTTP_STREAM_JOB);
}
void AddEndHTTPStreamJobEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_HTTP_STREAM_JOB, id);
- AddEndEntry(observer, source, NetLog::TYPE_HTTP_STREAM_JOB, NULL);
+ AddEndEntry(observer, source, NetLog::TYPE_HTTP_STREAM_JOB);
}
void AddStartConnectJobEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_CONNECT_JOB, id);
- AddStartEntry(observer, source, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB, NULL);
+ AddStartEntry(observer, source, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB);
}
void AddEndConnectJobEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_CONNECT_JOB, id);
- AddEndEntry(observer, source, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB, NULL);
+ AddEndEntry(observer, source, NetLog::TYPE_SOCKET_POOL_CONNECT_JOB);
}
void AddStartSocketEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_SOCKET, id);
- AddStartEntry(observer, source, NetLog::TYPE_SOCKET_ALIVE, NULL);
+ AddStartEntry(observer, source, NetLog::TYPE_SOCKET_ALIVE);
}
void AddEndSocketEntries(LoadTimingObserver& observer, uint32 id) {
NetLog::Source source(NetLog::SOURCE_SOCKET, id);
- AddEndEntry(observer, source, NetLog::TYPE_SOCKET_ALIVE, NULL);
+ AddEndEntry(observer, source, NetLog::TYPE_SOCKET_ALIVE);
}
void BindURLRequestToHTTPStreamJob(LoadTimingObserver& observer,
NetLog::Source url_request_source,
NetLog::Source http_stream_job_source) {
- scoped_refptr<net::NetLogSourceParameter> params(
- new net::NetLogSourceParameter("source_dependency",
- http_stream_job_source));
AddStartEntry(observer,
url_request_source,
NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB,
- params.get());
+ http_stream_job_source.ToEventParametersCallback());
}
void BindHTTPStreamJobToConnectJob(LoadTimingObserver& observer,
NetLog::Source& http_stream_job_source,
NetLog::Source& connect_source) {
- scoped_refptr<net::NetLogSourceParameter> params(
- new net::NetLogSourceParameter("source_dependency", connect_source));
AddStartEntry(observer,
http_stream_job_source,
NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB,
- params.get());
+ connect_source.ToEventParametersCallback());
}
void BindHTTPStreamJobToSocket(LoadTimingObserver& observer,
NetLog::Source& http_stream_job_source,
NetLog::Source& socket_source) {
- scoped_refptr<net::NetLogSourceParameter> params(
- new net::NetLogSourceParameter("source_dependency", socket_source));
AddStartEntry(observer,
http_stream_job_source,
NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET,
- params.get());
+ socket_source.ToEventParametersCallback());
}
} // namespace
// Test that net::URLRequest with no load timing flag is not processed.
TEST_F(LoadTimingObserverTest, NoLoadTimingEnabled) {
- LoadTimingObserver observer;
-
- AddStartURLRequestEntries(observer, 0, false);
+ AddStartURLRequestEntries(observer_, 0, false);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_TRUE(record == NULL);
}
// Test that URLRequestRecord is created, deleted and is not growing unbound.
TEST_F(LoadTimingObserverTest, URLRequestRecord) {
- LoadTimingObserver observer;
-
// Create record.
- AddStartURLRequestEntries(observer, 0, true);
+ AddStartURLRequestEntries(observer_, 0, true);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_FALSE(record == NULL);
// Collect record.
- AddEndURLRequestEntries(observer, 0);
- record = observer.GetURLRequestRecord(0);
+ AddEndURLRequestEntries(observer_, 0);
+ record = observer_.GetURLRequestRecord(0);
ASSERT_TRUE(record == NULL);
// Check unbound growth.
for (size_t i = 1; i < 1100; ++i)
- AddStartURLRequestEntries(observer, i, true);
- record = observer.GetURLRequestRecord(1);
+ AddStartURLRequestEntries(observer_, i, true);
+ record = observer_.GetURLRequestRecord(1);
ASSERT_TRUE(record == NULL);
}
// Test that HTTPStreamJobRecord is created, deleted and is not growing unbound.
TEST_F(LoadTimingObserverTest, HTTPStreamJobRecord) {
- LoadTimingObserver observer;
-
// Create record.
- AddStartHTTPStreamJobEntries(observer, 0);
- ASSERT_FALSE(observer.http_stream_job_to_record_.find(0) ==
- observer.http_stream_job_to_record_.end());
+ AddStartHTTPStreamJobEntries(observer_, 0);
+ ASSERT_FALSE(observer_.http_stream_job_to_record_.find(0) ==
+ observer_.http_stream_job_to_record_.end());
// Collect record.
- AddEndHTTPStreamJobEntries(observer, 0);
- ASSERT_TRUE(observer.http_stream_job_to_record_.find(0) ==
- observer.http_stream_job_to_record_.end());
+ AddEndHTTPStreamJobEntries(observer_, 0);
+ ASSERT_TRUE(observer_.http_stream_job_to_record_.find(0) ==
+ observer_.http_stream_job_to_record_.end());
// Check unbound growth.
for (size_t i = 1; i < 1100; ++i)
- AddStartHTTPStreamJobEntries(observer, i);
- ASSERT_TRUE(observer.http_stream_job_to_record_.find(1) ==
- observer.http_stream_job_to_record_.end());
+ AddStartHTTPStreamJobEntries(observer_, i);
+ ASSERT_TRUE(observer_.http_stream_job_to_record_.find(1) ==
+ observer_.http_stream_job_to_record_.end());
}
// Test that ConnectJobRecord is created, deleted and is not growing unbound.
TEST_F(LoadTimingObserverTest, ConnectJobRecord) {
- LoadTimingObserver observer;
-
// Create record.
- AddStartConnectJobEntries(observer, 0);
- ASSERT_FALSE(observer.connect_job_to_record_.find(0) ==
- observer.connect_job_to_record_.end());
+ AddStartConnectJobEntries(observer_, 0);
+ ASSERT_FALSE(observer_.connect_job_to_record_.find(0) ==
+ observer_.connect_job_to_record_.end());
// Collect record.
- AddEndConnectJobEntries(observer, 0);
- ASSERT_TRUE(observer.connect_job_to_record_.find(0) ==
- observer.connect_job_to_record_.end());
+ AddEndConnectJobEntries(observer_, 0);
+ ASSERT_TRUE(observer_.connect_job_to_record_.find(0) ==
+ observer_.connect_job_to_record_.end());
// Check unbound growth.
for (size_t i = 1; i < 1100; ++i)
- AddStartConnectJobEntries(observer, i);
- ASSERT_TRUE(observer.connect_job_to_record_.find(1) ==
- observer.connect_job_to_record_.end());
+ AddStartConnectJobEntries(observer_, i);
+ ASSERT_TRUE(observer_.connect_job_to_record_.find(1) ==
+ observer_.connect_job_to_record_.end());
}
// Test that SocketRecord is created, deleted and is not growing unbound.
TEST_F(LoadTimingObserverTest, SocketRecord) {
- LoadTimingObserver observer;
-
// Create record.
- AddStartSocketEntries(observer, 0);
- ASSERT_FALSE(observer.socket_to_record_.find(0) ==
- observer.socket_to_record_.end());
+ AddStartSocketEntries(observer_, 0);
+ ASSERT_FALSE(observer_.socket_to_record_.find(0) ==
+ observer_.socket_to_record_.end());
// Collect record.
- AddEndSocketEntries(observer, 0);
- ASSERT_TRUE(observer.socket_to_record_.find(0) ==
- observer.socket_to_record_.end());
-
+ AddEndSocketEntries(observer_, 0);
+ ASSERT_TRUE(observer_.socket_to_record_.find(0) ==
+ observer_.socket_to_record_.end());
// Check unbound growth.
for (size_t i = 1; i < 1100; ++i)
- AddStartSocketEntries(observer, i);
- ASSERT_TRUE(observer.socket_to_record_.find(1) ==
- observer.socket_to_record_.end());
+ AddStartSocketEntries(observer_, i);
+ ASSERT_TRUE(observer_.socket_to_record_.find(1) ==
+ observer_.socket_to_record_.end());
}
// Test that basic time is set to the request.
TEST_F(LoadTimingObserverTest, BaseTicks) {
- LoadTimingObserver observer;
- current_time += TimeDelta::FromSeconds(1);
- AddStartURLRequestEntries(observer, 0, true);
+ observer_.IncementTime(TimeDelta::FromSeconds(1));
+ AddStartURLRequestEntries(observer_, 0, true);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(1000000, record->base_ticks.ToInternalValue());
}
// Test proxy time detection.
TEST_F(LoadTimingObserverTest, ProxyTime) {
- LoadTimingObserver observer;
- current_time += TimeDelta::FromSeconds(1);
+ observer_.IncementTime(TimeDelta::FromSeconds(1));
- AddStartURLRequestEntries(observer, 0, true);
+ AddStartURLRequestEntries(observer_, 0, true);
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, 0);
- current_time += TimeDelta::FromSeconds(2);
- AddStartEntry(observer, source, NetLog::TYPE_PROXY_SERVICE, NULL);
- current_time += TimeDelta::FromSeconds(3);
- AddEndEntry(observer, source, NetLog::TYPE_PROXY_SERVICE, NULL);
+ observer_.IncementTime(TimeDelta::FromSeconds(2));
+ AddStartEntry(observer_, source, NetLog::TYPE_PROXY_SERVICE);
+ observer_.IncementTime(TimeDelta::FromSeconds(3));
+ AddEndEntry(observer_, source, NetLog::TYPE_PROXY_SERVICE);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(2000, record->timing.proxy_start);
ASSERT_EQ(5000, record->timing.proxy_end);
}
// Test connect time detection.
TEST_F(LoadTimingObserverTest, ConnectTime) {
- LoadTimingObserver observer;
- current_time += TimeDelta::FromSeconds(1);
+ observer_.IncementTime(TimeDelta::FromSeconds(1));
- AddStartURLRequestEntries(observer, 0, true);
+ AddStartURLRequestEntries(observer_, 0, true);
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, 0);
NetLog::Source http_stream_job_source(NetLog::SOURCE_HTTP_STREAM_JOB, 1);
- AddStartHTTPStreamJobEntries(observer, 1);
+ AddStartHTTPStreamJobEntries(observer_, 1);
- current_time += TimeDelta::FromSeconds(2);
- AddStartEntry(observer, http_stream_job_source, NetLog::TYPE_SOCKET_POOL,
- NULL);
- current_time += TimeDelta::FromSeconds(3);
- AddEndEntry(observer, http_stream_job_source, NetLog::TYPE_SOCKET_POOL, NULL);
+ observer_.IncementTime(TimeDelta::FromSeconds(2));
+ AddStartEntry(observer_, http_stream_job_source, NetLog::TYPE_SOCKET_POOL);
+ observer_.IncementTime(TimeDelta::FromSeconds(3));
+ AddEndEntry(observer_, http_stream_job_source, NetLog::TYPE_SOCKET_POOL);
- BindURLRequestToHTTPStreamJob(observer, source, http_stream_job_source);
+ BindURLRequestToHTTPStreamJob(observer_, source, http_stream_job_source);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(2000, record->timing.connect_start);
ASSERT_EQ(5000, record->timing.connect_end);
}
// Test dns time detection.
TEST_F(LoadTimingObserverTest, DnsTime) {
- LoadTimingObserver observer;
-
// Start request.
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, 0);
- AddStartURLRequestEntries(observer, 0, true);
- current_time += TimeDelta::FromSeconds(1);
+ AddStartURLRequestEntries(observer_, 0, true);
+ observer_.IncementTime(TimeDelta::FromSeconds(1));
// Add resolver entry.
- AddStartConnectJobEntries(observer, 1);
+ AddStartConnectJobEntries(observer_, 1);
NetLog::Source connect_source(NetLog::SOURCE_CONNECT_JOB, 1);
- AddStartEntry(observer,
- connect_source,
- NetLog::TYPE_HOST_RESOLVER_IMPL,
- NULL);
- current_time += TimeDelta::FromSeconds(2);
- AddEndEntry(observer, connect_source, NetLog::TYPE_HOST_RESOLVER_IMPL, NULL);
- AddEndConnectJobEntries(observer, 1);
+ AddStartEntry(observer_, connect_source, NetLog::TYPE_HOST_RESOLVER_IMPL);
+ observer_.IncementTime(TimeDelta::FromSeconds(2));
+ AddEndEntry(observer_, connect_source, NetLog::TYPE_HOST_RESOLVER_IMPL);
+ AddEndConnectJobEntries(observer_, 1);
NetLog::Source http_stream_job_source(NetLog::SOURCE_HTTP_STREAM_JOB, 2);
- AddStartHTTPStreamJobEntries(observer, 2);
+ AddStartHTTPStreamJobEntries(observer_, 2);
- BindHTTPStreamJobToConnectJob(observer, http_stream_job_source,
+ BindHTTPStreamJobToConnectJob(observer_, http_stream_job_source,
connect_source);
- BindURLRequestToHTTPStreamJob(observer, source, http_stream_job_source);
+ BindURLRequestToHTTPStreamJob(observer_, source, http_stream_job_source);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(1000, record->timing.dns_start);
ASSERT_EQ(3000, record->timing.dns_end);
}
// Test send time detection.
TEST_F(LoadTimingObserverTest, SendTime) {
- LoadTimingObserver observer;
-
// Start request.
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, 0);
- AddStartURLRequestEntries(observer, 0, true);
- current_time += TimeDelta::FromSeconds(2);
+ AddStartURLRequestEntries(observer_, 0, true);
+ observer_.IncementTime(TimeDelta::FromSeconds(2));
// Add send request entry.
- AddStartEntry(observer,
- source,
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST,
- NULL);
- current_time += TimeDelta::FromSeconds(5);
- AddEndEntry(observer,
- source,
- NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST,
- NULL);
+ AddStartEntry(observer_, source, NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST);
+ observer_.IncementTime(TimeDelta::FromSeconds(5));
+ AddEndEntry(observer_, source, NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(2000, record->timing.send_start);
ASSERT_EQ(7000, record->timing.send_end);
}
// Test receive time detection.
TEST_F(LoadTimingObserverTest, ReceiveTime) {
- LoadTimingObserver observer;
-
// Start request.
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, 0);
- AddStartURLRequestEntries(observer, 0, true);
- current_time += TimeDelta::FromSeconds(2);
+ AddStartURLRequestEntries(observer_, 0, true);
+ observer_.IncementTime(TimeDelta::FromSeconds(2));
// Add send request entry.
- AddStartEntry(observer,
- source,
- NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS,
- NULL);
- current_time += TimeDelta::FromSeconds(5);
- AddEndEntry(observer,
- source,
- NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS,
- NULL);
+ AddStartEntry(observer_, source, NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS);
+ observer_.IncementTime(TimeDelta::FromSeconds(5));
+ AddEndEntry(observer_, source, NetLog::TYPE_HTTP_TRANSACTION_READ_HEADERS);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(2000, record->timing.receive_headers_start);
ASSERT_EQ(7000, record->timing.receive_headers_end);
}
// Test ssl time detection.
TEST_F(LoadTimingObserverTest, SslTime) {
- LoadTimingObserver observer;
-
// Start request.
NetLog::Source source(NetLog::SOURCE_URL_REQUEST, 0);
- AddStartURLRequestEntries(observer, 0, true);
- current_time += TimeDelta::FromSeconds(1);
+ AddStartURLRequestEntries(observer_, 0, true);
+ observer_.IncementTime(TimeDelta::FromSeconds(1));
// Add resolver entry.
- AddStartSocketEntries(observer, 1);
+ AddStartSocketEntries(observer_, 1);
NetLog::Source socket_source(NetLog::SOURCE_SOCKET, 1);
- AddStartEntry(observer, socket_source, NetLog::TYPE_SSL_CONNECT, NULL);
- current_time += TimeDelta::FromSeconds(2);
- AddEndEntry(observer, socket_source, NetLog::TYPE_SSL_CONNECT, NULL);
+ AddStartEntry(observer_, socket_source, NetLog::TYPE_SSL_CONNECT);
+ observer_.IncementTime(TimeDelta::FromSeconds(2));
+ AddEndEntry(observer_, socket_source, NetLog::TYPE_SSL_CONNECT);
NetLog::Source http_stream_job_source(NetLog::SOURCE_HTTP_STREAM_JOB, 2);
- AddStartHTTPStreamJobEntries(observer, 2);
+ AddStartHTTPStreamJobEntries(observer_, 2);
- BindHTTPStreamJobToSocket(observer, http_stream_job_source, socket_source);
- BindURLRequestToHTTPStreamJob(observer, source, http_stream_job_source);
+ BindHTTPStreamJobToSocket(observer_, http_stream_job_source, socket_source);
+ BindURLRequestToHTTPStreamJob(observer_, source, http_stream_job_source);
LoadTimingObserver::URLRequestRecord* record =
- observer.GetURLRequestRecord(0);
+ observer_.GetURLRequestRecord(0);
ASSERT_EQ(1000, record->timing.ssl_start);
ASSERT_EQ(3000, record->timing.ssl_end);
}
diff --git a/chrome/browser/net/net_log_logger.cc b/chrome/browser/net/net_log_logger.cc
index 9ef34d5..f91648d 100644
--- a/chrome/browser/net/net_log_logger.cc
+++ b/chrome/browser/net/net_log_logger.cc
@@ -37,14 +37,8 @@ void NetLogLogger::StartObserving(net::NetLog* net_log) {
net_log->AddThreadSafeObserver(this, net::NetLog::LOG_ALL_BUT_BYTES);
}
-void NetLogLogger::OnAddEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
- scoped_ptr<Value> value(
- net::NetLog::EntryToDictionaryValue(
- type, time, source, phase, params, false));
+void NetLogLogger::OnAddEntry(const net::NetLog::Entry& entry) {
+ scoped_ptr<Value> value(entry.ToValue());
// Don't pretty print, so each JSON value occupies a single line, with no
// breaks (Line breaks in any text field will be escaped). Using strings
// instead of integer identifiers allows logs from older versions to be
diff --git a/chrome/browser/net/net_log_logger.h b/chrome/browser/net/net_log_logger.h
index fc54462..0aa69a9 100644
--- a/chrome/browser/net/net_log_logger.h
+++ b/chrome/browser/net/net_log_logger.h
@@ -34,11 +34,7 @@ class NetLogLogger : public net::NetLog::ThreadSafeObserver {
void StartObserving(net::NetLog* net_log);
// net::NetLog::ThreadSafeObserver implementation:
- virtual void OnAddEntry(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) OVERRIDE;
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
private:
ScopedStdioHandle file_;