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

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

Issue 10539094: NetLogEventParameter to Callback refactoring 1, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix headers Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 // Returns true if |log_level| indicates that all events should be logged, 290 // Returns true if |log_level| indicates that all events should be logged,
291 // including frequently occuring ones that may impact performances. 291 // including frequently occuring ones that may impact performances.
292 // This is the case when |log_level| is LOG_ALL or LOG_ALL_BUT_BYTES. 292 // This is the case when |log_level| is LOG_ALL or LOG_ALL_BUT_BYTES.
293 static bool IsLoggingAllEvents(LogLevel log_level); 293 static bool IsLoggingAllEvents(LogLevel log_level);
294 294
295 // Creates a ParametersCallback that encapsulates a single integer. 295 // Creates a ParametersCallback that encapsulates a single integer.
296 // Warning: |name| must remain valid for the life of the callback. 296 // Warning: |name| must remain valid for the life of the callback.
297 static ParametersCallback IntegerCallback(const char* name, int value); 297 static ParametersCallback IntegerCallback(const char* name, int value);
298 298
299 // Creates a ParametersCallback that encapsulates a single integer. Takes
eroman 2012/06/11 23:42:25 Update comment: "single integer" --> string
mmenke 2012/06/12 00:42:19 Done.
300 // |value| as a pointer to avoid copying, and emphasize it must be valid for
eroman 2012/06/11 23:42:25 Should we describe anything about the encoding of
mmenke 2012/06/12 00:42:19 Done, though we actually violate it at times (Sinc
301 // the life of the callback.
302 // Warning: |name| and |value| must remain valid for the life of the callback.
303 static ParametersCallback StringCallback(const char* name,
304 const std::string* value);
305
299 protected: 306 protected:
300 // Child classes should respond to the new entry here. This includes 307 // Child classes should respond to the new entry here. This includes
301 // creating the Entry object and alerting their observers. 308 // creating the Entry object and alerting their observers.
302 virtual void OnAddEntry(const Entry& entry) = 0; 309 virtual void OnAddEntry(const Entry& entry) = 0;
303 310
304 // Subclasses must call these in the corresponding functions to set an 311 // Subclasses must call these in the corresponding functions to set an
305 // observer's |net_log_| and |log_level_| values. 312 // observer's |net_log_| and |log_level_| values.
306 void OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level); 313 void OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level);
307 void OnSetObserverLogLevel(ThreadSafeObserver* observer, 314 void OnSetObserverLogLevel(ThreadSafeObserver* observer,
308 LogLevel log_level); 315 LogLevel log_level);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 virtual ~NetLogSourceParameter() {} 472 virtual ~NetLogSourceParameter() {}
466 473
467 private: 474 private:
468 const char* name_; 475 const char* name_;
469 const NetLog::Source value_; 476 const NetLog::Source value_;
470 }; 477 };
471 478
472 } // namespace net 479 } // namespace net
473 480
474 #endif // NET_BASE_NET_LOG_H_ 481 #endif // NET_BASE_NET_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698