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

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

Issue 1783008: Cleanup: Remove the implicit constructor for BoundNetLog that allowed passing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Sync 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/host_resolver_impl_unittest.cc ('k') | net/ftp/ftp_network_transaction_unittest.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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 private: 130 private:
131 DISALLOW_COPY_AND_ASSIGN(NetLog); 131 DISALLOW_COPY_AND_ASSIGN(NetLog);
132 }; 132 };
133 133
134 // Helper that binds a Source to a NetLog, and exposes convenience methods to 134 // Helper that binds a Source to a NetLog, and exposes convenience methods to
135 // output log messages without needing to pass in the source. 135 // output log messages without needing to pass in the source.
136 class BoundNetLog { 136 class BoundNetLog {
137 public: 137 public:
138 BoundNetLog() : net_log_(NULL) {} 138 BoundNetLog() : net_log_(NULL) {}
139 139
140 // TODO(eroman): This is a complete hack to allow passing in NULL in
141 // place of a BoundNetLog. I added this while refactoring to simplify the
142 // task of updating all the callers.
143 BoundNetLog(uint32) : net_log_(NULL) {}
144
145 BoundNetLog(const NetLog::Source& source, NetLog* net_log) 140 BoundNetLog(const NetLog::Source& source, NetLog* net_log)
146 : source_(source), net_log_(net_log) { 141 : source_(source), net_log_(net_log) {
147 } 142 }
148 143
149 // Convenience methods that call through to the NetLog, passing in the 144 // Convenience methods that call through to the NetLog, passing in the
150 // currently bound source. 145 // currently bound source.
151 void AddEntry(NetLog::EventType type, 146 void AddEntry(NetLog::EventType type,
152 NetLog::EventPhase phase, 147 NetLog::EventPhase phase,
153 const scoped_refptr<NetLog::EventParameters>& params) const; 148 const scoped_refptr<NetLog::EventParameters>& params) const;
154 149
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 virtual Value* ToValue() const; 210 virtual Value* ToValue() const;
216 211
217 private: 212 private:
218 const char* name_; 213 const char* name_;
219 const int value_; 214 const int value_;
220 }; 215 };
221 216
222 } // namespace net 217 } // namespace net
223 218
224 #endif // NET_BASE_NET_LOG_H_ 219 #endif // NET_BASE_NET_LOG_H_
OLDNEW
« no previous file with comments | « net/base/host_resolver_impl_unittest.cc ('k') | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698