summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-26 23:58:46 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-26 23:58:46 +0000
commit30ac64979c2a74a665ef40101afd5fd4f3c5f0c2 (patch)
tree3999015c27882c3e03db9de6b8effffd1ddae849 /net
parent7e8e701d344b4692977fc09c3b1ec4c6725d6fae (diff)
downloadchromium_src-30ac64979c2a74a665ef40101afd5fd4f3c5f0c2.zip
chromium_src-30ac64979c2a74a665ef40101afd5fd4f3c5f0c2.tar.gz
chromium_src-30ac64979c2a74a665ef40101afd5fd4f3c5f0c2.tar.bz2
Revert 94196 (broke win shared build) - Remove ChromeNetLog dependency from content/browser/debugger.
Add Observer concept to net::NetLog. Use net::NetLog::Observer in ChromeNetLog. Remove ChromeNetLog dependency in content/browser/debugger. Forked from http://codereview.chromium.org/7310029/ to finish Jói's patch. BUG=84078 TEST=existing Review URL: http://codereview.chromium.org/7468019 TBR=dpranke@chromium.org Review URL: http://codereview.chromium.org/7517004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94208 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/capturing_net_log.cc14
-rw-r--r--net/base/capturing_net_log.h10
-rw-r--r--net/base/net_log.cc11
-rw-r--r--net/base/net_log.h52
4 files changed, 5 insertions, 82 deletions
diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc
index ecdbc15..2daa73a 100644
--- a/net/base/capturing_net_log.cc
+++ b/net/base/capturing_net_log.cc
@@ -1,11 +1,9 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/base/capturing_net_log.h"
-#include "base/logging.h"
-
namespace net {
CapturingNetLog::Entry::Entry(EventType type,
@@ -62,16 +60,6 @@ NetLog::LogLevel CapturingNetLog::GetLogLevel() const {
return log_level_;
}
-void CapturingNetLog::AddThreadSafeObserver(
- NetLog::ThreadSafeObserver* observer) {
- NOTREACHED() << "Not currently used by net unit tests.";
-}
-
-void CapturingNetLog::RemoveThreadSafeObserver(
- NetLog::ThreadSafeObserver* observer) {
- NOTREACHED() << "Not currently used by net unit tests.";
-}
-
CapturingBoundNetLog::CapturingBoundNetLog(const NetLog::Source& source,
CapturingNetLog* net_log)
: source_(source), capturing_net_log_(net_log) {
diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h
index f60f6ed..9185f48 100644
--- a/net/base/capturing_net_log.h
+++ b/net/base/capturing_net_log.h
@@ -10,7 +10,6 @@
#include "base/atomicops.h"
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
@@ -61,11 +60,9 @@ class NET_API CapturingNetLog : public NetLog {
const base::TimeTicks& time,
const Source& source,
EventPhase phase,
- EventParameters* extra_parameters) OVERRIDE;
- virtual uint32 NextID() OVERRIDE;
- virtual LogLevel GetLogLevel() const OVERRIDE;
- virtual void AddThreadSafeObserver(ThreadSafeObserver* observer) OVERRIDE;
- virtual void RemoveThreadSafeObserver(ThreadSafeObserver* observer) OVERRIDE;
+ EventParameters* extra_parameters);
+ virtual uint32 NextID();
+ virtual LogLevel GetLogLevel() const;
private:
// Needs to be "mutable" so can use it in GetEntries().
@@ -118,3 +115,4 @@ class NET_TEST CapturingBoundNetLog {
} // namespace net
#endif // NET_BASE_CAPTURING_NET_LOG_H_
+
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index 6509801..110c8a4 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -56,17 +56,6 @@ Value* NetLog::Source::ToValue() const {
return dict;
}
-NetLog::ThreadSafeObserver::ThreadSafeObserver(LogLevel log_level)
- : log_level_(log_level) {
-}
-
-NetLog::ThreadSafeObserver::~ThreadSafeObserver() {
-}
-
-NetLog::LogLevel NetLog::ThreadSafeObserver::log_level() const {
- return log_level_;
-}
-
// static
std::string NetLog::TickCountToString(const base::TimeTicks& time) {
int64 delta_time = (time - base::TimeTicks()).InMilliseconds();
diff --git a/net/base/net_log.h b/net/base/net_log.h
index 051ba93..39fa915 100644
--- a/net/base/net_log.h
+++ b/net/base/net_log.h
@@ -104,50 +104,6 @@ class NET_API NetLog {
LOG_BASIC,
};
- // An observer, that must ensure its own thread safety, for events
- // being added to a NetLog.
- class ThreadSafeObserver {
- public:
- // Constructs an observer that wants to see network events, with
- // the specified minimum event granularity. A ThreadSafeObserver can only
- // observe a single NetLog at a time.
- //
- // Typical observers should specify LOG_BASIC.
- //
- // Observers that need to see the full granularity of events can
- // specify LOG_ALL. However doing so will have performance consequences.
- //
- // Observers will be called on the same thread an entry is added on,
- // and are responsible for ensuring their own thread safety.
- explicit ThreadSafeObserver(LogLevel log_level);
- virtual ~ThreadSafeObserver();
-
- // Returns the minimum log level for events this observer wants to
- // receive.
- LogLevel log_level() const;
-
- // This method will be called on the thread that the event occurs on. It
- // is the responsibility of the observer to handle it in a thread safe
- // manner.
- //
- // It is illegal for an Observer to call any NetLog or
- // NetLog::Observer functions in response to a call to OnAddEntry.
- virtual void OnAddEntry(EventType type,
- const base::TimeTicks& time,
- const Source& source,
- EventPhase phase,
- EventParameters* params) = 0;
-
- protected:
- // Subclasses should only ever modify this if they somehow
- // collaborate with concrete implementations of NetLog to enable
- // modification.
- LogLevel log_level_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ThreadSafeObserver);
- };
-
NetLog() {}
virtual ~NetLog() {}
@@ -174,14 +130,6 @@ class NET_API NetLog {
// and saving expensive log entries.
virtual LogLevel GetLogLevel() const = 0;
- // Adds an observer. Each observer may be added only once and must
- // be removed via |RemoveObserver()| before this object goes out of
- // scope.
- virtual void AddThreadSafeObserver(ThreadSafeObserver* observer) = 0;
-
- // Removes an observer.
- virtual void RemoveThreadSafeObserver(ThreadSafeObserver* observer) = 0;
-
// Converts a time to the string format that the NetLog uses to represent
// times. Strings are used since integers may overflow.
static std::string TickCountToString(const base::TimeTicks& time);