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

Side by Side Diff: net/base/net_log.h

Issue 2363003: Rework the logging for sockets/connectjobs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/test_server_test.cc ('k') | net/base/net_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_NET_LOG_H_ 5 #ifndef NET_BASE_NET_LOG_H_
6 #define NET_BASE_NET_LOG_H_ 6 #define NET_BASE_NET_LOG_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // The 'phase' of an event trace (whether it marks the beginning or end 46 // The 'phase' of an event trace (whether it marks the beginning or end
47 // of an event.). 47 // of an event.).
48 enum EventPhase { 48 enum EventPhase {
49 PHASE_NONE, 49 PHASE_NONE,
50 PHASE_BEGIN, 50 PHASE_BEGIN,
51 PHASE_END, 51 PHASE_END,
52 }; 52 };
53 53
54 // The "source" identifies the entity that generated the log message. 54 // The "source" identifies the entity that generated the log message.
55 enum SourceType { 55 enum SourceType {
56 #define SOURCE_TYPE(label) SOURCE_ ## label, 56 #define SOURCE_TYPE(label, value) SOURCE_ ## label = value,
57 #include "net/base/net_log_source_type_list.h" 57 #include "net/base/net_log_source_type_list.h"
58 #undef SOURCE_TYPE 58 #undef SOURCE_TYPE
59 }; 59 };
60 60
61 // Identifies the entity that generated this log. The |id| field should 61 // Identifies the entity that generated this log. The |id| field should
62 // uniquely identify the source, and is used by log observers to infer 62 // uniquely identify the source, and is used by log observers to infer
63 // message groupings. Can use NetLog::NextID() to create unique IDs. 63 // message groupings. Can use NetLog::NextID() to create unique IDs.
64 struct Source { 64 struct Source {
65 static const uint32 kInvalidId = 0; 65 static const uint32 kInvalidId = 0;
66 66
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return value_; 199 return value_;
200 } 200 }
201 201
202 virtual Value* ToValue() const; 202 virtual Value* ToValue() const;
203 203
204 private: 204 private:
205 const char* name_; 205 const char* name_;
206 const int value_; 206 const int value_;
207 }; 207 };
208 208
209 // NetLogSourceParameter is a subclass of EventParameters that encapsulates a
210 // single NetLog::Source parameter.
211 class NetLogSourceParameter : public NetLog::EventParameters {
212 public:
213 // |name| must be a string literal.
214 NetLogSourceParameter(const char* name, const NetLog::Source& value)
215 : name_(name), value_(value) {}
216
217 const NetLog::Source& value() const {
218 return value_;
219 }
220
221 virtual Value* ToValue() const;
222
223 private:
224 const char* name_;
225 const NetLog::Source value_;
226 };
227
209 } // namespace net 228 } // namespace net
210 229
211 #endif // NET_BASE_NET_LOG_H_ 230 #endif // NET_BASE_NET_LOG_H_
OLDNEW
« no previous file with comments | « chrome_frame/test/test_server_test.cc ('k') | net/base/net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698