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

Unified Diff: net/base/net_log.h

Issue 1696005: Add net log entries that summarize transmit and receive byte counts. (Closed)
Patch Set: More tests and address comments Created 10 years, 8 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
« no previous file with comments | « chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc ('k') | net/base/net_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log.h
diff --git a/net/base/net_log.h b/net/base/net_log.h
index 3a85131a90f7e227fbef4bd76f400698aea578c6..cb2b3a69f347ab14ce6af187dc6ce134e8b73d63 100644
--- a/net/base/net_log.h
+++ b/net/base/net_log.h
@@ -67,17 +67,21 @@ class NetLog {
SOURCE_SOCKET_STREAM,
SOURCE_INIT_PROXY_RESOLVER,
SOURCE_CONNECT_JOB,
+ SOURCE_SOCKET,
};
// Identifies the entity that generated this log. The |id| field should
// uniquely identify the source, and is used by log observers to infer
// message groupings. Can use NetLog::NextID() to create unique IDs.
struct Source {
- Source() : type(SOURCE_NONE), id(-1) {}
- Source(SourceType type, int id) : type(type), id(id) {}
+ static const uint32 kInvalidId = 0;
+
+ Source() : type(SOURCE_NONE), id(kInvalidId) {}
+ Source(SourceType type, uint32 id) : type(type), id(id) {}
+ bool is_valid() { return id != kInvalidId; }
SourceType type;
- int id;
+ uint32 id;
};
// Base class for associating additional parameters with an event. Log
@@ -115,7 +119,7 @@ class NetLog {
EventParameters* extra_parameters) = 0;
// Returns a unique ID which can be used as a source ID.
- virtual int NextID() = 0;
+ virtual uint32 NextID() = 0;
// Returns true if more complicated messages should be sent to the log.
// TODO(eroman): This is a carry-over from refactoring; figure out
@@ -141,7 +145,7 @@ class BoundNetLog {
// TODO(eroman): This is a complete hack to allow passing in NULL in
// place of a BoundNetLog. I added this while refactoring to simplify the
// task of updating all the callers.
- BoundNetLog(int) : net_log_(NULL) {}
+ BoundNetLog(uint32) : net_log_(NULL) {}
BoundNetLog(const NetLog::Source& source, NetLog* net_log)
: source_(source), net_log_(net_log) {
@@ -167,6 +171,7 @@ class BoundNetLog {
NetLog::EventParameters* params) const;
void BeginEventWithString(NetLog::EventType event_type,
const std::string& string) const;
+ void BeginEventWithInteger(NetLog::EventType event_type, int integer) const;
void AddEventWithInteger(NetLog::EventType event_type, int integer) const;
void EndEvent(NetLog::EventType event_type) const;
void EndEventWithParameters(NetLog::EventType event_type,
@@ -278,7 +283,7 @@ class CapturingNetLog : public NetLog {
const Source& source,
EventPhase phase,
EventParameters* extra_parameters);
- virtual int NextID();
+ virtual uint32 NextID();
virtual bool HasListener() const { return true; }
// Returns the list of all entries in the log.
@@ -287,7 +292,7 @@ class CapturingNetLog : public NetLog {
void Clear();
private:
- int next_id_;
+ uint32 next_id_;
size_t max_num_entries_;
EntryList entries_;
« no previous file with comments | « chrome/browser/sync/notifier/communicator/ssl_socket_adapter.cc ('k') | net/base/net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698