summaryrefslogtreecommitdiffstats
path: root/net/base/net_log.cc
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 05:22:13 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 05:22:13 +0000
commitfba65f7b1dbb530401030f9aac9886a0e75fe4c2 (patch)
tree2c292ca19939fe79e646d5f2b579186acc51d6b9 /net/base/net_log.cc
parent4fd13395a6cfaecb0463563b4deaa1e7b8eff87c (diff)
downloadchromium_src-fba65f7b1dbb530401030f9aac9886a0e75fe4c2.zip
chromium_src-fba65f7b1dbb530401030f9aac9886a0e75fe4c2.tar.gz
chromium_src-fba65f7b1dbb530401030f9aac9886a0e75fe4c2.tar.bz2
Add a source id to global NetLog entries, which makes them
easier to sort in about:net-internals, making the world a happier, fuzzier place. Also slightly simplifies the functions to add NetLog entries, and makes it impossible to create a BoundNetLog with both an invalid source and a non-NULL NetLog. BUG=116597 Review URL: https://chromiumcodereview.appspot.com/9585026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_log.cc')
-rw-r--r--net/base/net_log.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index 1de670e..0b23907 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -76,6 +76,14 @@ NetLog* NetLog::ThreadSafeObserver::net_log() const {
return net_log_;
}
+void NetLog::AddGlobalEntry(EventType type,
+ const scoped_refptr<EventParameters>& params) {
+ AddEntry(type,
+ Source(net::NetLog::SOURCE_NONE, this->NextID()),
+ net::NetLog::PHASE_NONE,
+ params);
+}
+
// static
std::string NetLog::TickCountToString(const base::TimeTicks& time) {
int64 delta_time = (time - base::TimeTicks()).InMilliseconds();
@@ -197,19 +205,8 @@ void BoundNetLog::AddEntry(
NetLog::EventType type,
NetLog::EventPhase phase,
const scoped_refptr<NetLog::EventParameters>& params) const {
- if (net_log_) {
- net_log_->AddEntry(type, base::TimeTicks::Now(), source_, phase, params);
- }
-}
-
-void BoundNetLog::AddEntryWithTime(
- NetLog::EventType type,
- const base::TimeTicks& time,
- NetLog::EventPhase phase,
- const scoped_refptr<NetLog::EventParameters>& params) const {
- if (net_log_) {
- net_log_->AddEntry(type, time, source_, phase, params);
- }
+ if (net_log_)
+ net_log_->AddEntry(type, source_, phase, params);
}
void BoundNetLog::AddEvent(