Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(984)

Unified Diff: net/base/capturing_net_log.h

Issue 10399083: Make NetLog take in callbacks that return Values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix net-internals Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/capturing_net_log.h
===================================================================
--- net/base/capturing_net_log.h (revision 137673)
+++ net/base/capturing_net_log.h (working copy)
@@ -17,29 +17,31 @@
#include "net/base/net_export.h"
#include "net/base/net_log.h"
+namespace base {
+class Value;
+}
+
namespace net {
// CapturingNetLog is an implementation of NetLog that saves messages to a
// bounded buffer.
class NET_EXPORT CapturingNetLog : public NetLog {
public:
- struct NET_EXPORT Entry {
- Entry(EventType type,
- const base::TimeTicks& time,
- Source source,
- EventPhase phase,
- EventParameters* extra_parameters);
- ~Entry();
+ struct NET_EXPORT CapturedEntry {
+ CapturedEntry(EventType type,
+ const base::TimeTicks& time,
+ Source source,
+ EventPhase phase);
+ ~CapturedEntry();
EventType type;
base::TimeTicks time;
Source source;
EventPhase phase;
- scoped_refptr<EventParameters> extra_parameters;
};
// Ordered set of entries that were logged.
- typedef std::vector<Entry> EntryList;
+ typedef std::vector<CapturedEntry> CapturedEntryList;
enum { kUnbounded = -1 };
@@ -49,18 +51,14 @@
virtual ~CapturingNetLog();
// Returns the list of all entries in the log.
- void GetEntries(EntryList* entry_list) const;
+ void GetEntries(CapturedEntryList* entry_list) const;
void Clear();
void SetLogLevel(NetLog::LogLevel log_level);
// NetLog implementation:
- virtual void AddEntry(
- EventType type,
- const Source& source,
- EventPhase phase,
- const scoped_refptr<EventParameters>& extra_parameters) OVERRIDE;
+ virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
virtual uint32 NextID() OVERRIDE;
virtual LogLevel GetLogLevel() const OVERRIDE;
virtual void AddThreadSafeObserver(ThreadSafeObserver* observer,
@@ -77,7 +75,7 @@
base::subtle::Atomic32 last_id_;
size_t max_num_entries_;
- EntryList entries_;
+ CapturedEntryList captured_entries_;
NetLog::LogLevel log_level_;
@@ -99,7 +97,7 @@
BoundNetLog bound() const { return net_log_; }
// Fills |entry_list| with all entries in the log.
- void GetEntries(CapturingNetLog::EntryList* entry_list) const;
+ void GetEntries(CapturingNetLog::CapturedEntryList* entry_list) const;
void Clear();

Powered by Google App Engine
This is Rietveld 408576698