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

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

Issue 10542153: NetLogEventParameter to Callback refactoring 11. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // be logged. This is only the case when |log_level| is LOG_ALL. 291 // be logged. This is only the case when |log_level| is LOG_ALL.
292 static bool IsLoggingBytes(LogLevel log_level); 292 static bool IsLoggingBytes(LogLevel log_level);
293 293
294 // Returns true if |log_level| indicates that all events should be logged, 294 // Returns true if |log_level| indicates that all events should be logged,
295 // including frequently occuring ones that may impact performances. 295 // including frequently occuring ones that may impact performances.
296 // This is the case when |log_level| is LOG_ALL or LOG_ALL_BUT_BYTES. 296 // This is the case when |log_level| is LOG_ALL or LOG_ALL_BUT_BYTES.
297 static bool IsLoggingAllEvents(LogLevel log_level); 297 static bool IsLoggingAllEvents(LogLevel log_level);
298 298
299 // Creates a ParametersCallback that encapsulates a single integer. 299 // Creates a ParametersCallback that encapsulates a single integer.
300 // Warning: |name| must remain valid for the life of the callback. 300 // Warning: |name| must remain valid for the life of the callback.
301 static ParametersCallback IntegerCallback(const char* name, int value); 301 static ParametersCallback IntegerCallback(const char* name, int value);
eroman 2012/06/14 18:04:31 We may want to add a todo to rename this to Int32C
mmenke 2012/06/14 18:49:42 TODO added.
302 302
303 // Creates a ParametersCallback that encapsulates a single int64. The
304 // callback will return the value as a StringValue, since IntegerValues
305 // only support 32-bit values.
306 // Warning: |name| must remain valid for the life of the callback.
307 static ParametersCallback Int64Callback(const char* name, int64 value);
308
303 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes 309 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes
304 // |value| as a pointer to avoid copying, and emphasize it must be valid for 310 // |value| as a pointer to avoid copying, and emphasize it must be valid for
305 // the life of the callback. |value| may not be NULL. 311 // the life of the callback. |value| may not be NULL.
306 // Warning: |name| and |value| must remain valid for the life of the callback. 312 // Warning: |name| and |value| must remain valid for the life of the callback.
307 static ParametersCallback StringCallback(const char* name, 313 static ParametersCallback StringCallback(const char* name,
308 const std::string* value); 314 const std::string* value);
309 315
310 // Same as above, but takes in a UTF16 string. 316 // Same as above, but takes in a UTF16 string.
311 static ParametersCallback StringCallback(const char* name, 317 static ParametersCallback StringCallback(const char* name,
312 const string16* value); 318 const string16* value);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 virtual ~NetLogSourceParameter() {} 486 virtual ~NetLogSourceParameter() {}
481 487
482 private: 488 private:
483 const char* name_; 489 const char* name_;
484 const NetLog::Source value_; 490 const NetLog::Source value_;
485 }; 491 };
486 492
487 } // namespace net 493 } // namespace net
488 494
489 #endif // NET_BASE_NET_LOG_H_ 495 #endif // NET_BASE_NET_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698