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

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

Issue 10546151: A pair of NetLog changes for ongoing refactoring: (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
« no previous file with comments | « no previous file | 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) 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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/string16.h"
mmenke 2012/06/13 19:42:13 I don't believe typedefs can be forward declared.
16 #include "net/base/net_export.h" 17 #include "net/base/net_export.h"
17 18
18 namespace base { 19 namespace base {
19 class DictionaryValue; 20 class DictionaryValue;
20 class TimeTicks; 21 class TimeTicks;
21 class Value; 22 class Value;
22 } 23 }
23 24
24 namespace net { 25 namespace net {
25 26
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 // Warning: |name| must remain valid for the life of the callback. 300 // Warning: |name| must remain valid for the life of the callback.
300 static ParametersCallback IntegerCallback(const char* name, int value); 301 static ParametersCallback IntegerCallback(const char* name, int value);
301 302
302 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes 303 // Creates a ParametersCallback that encapsulates a single UTF8 string. Takes
303 // |value| as a pointer to avoid copying, and emphasize it must be valid for 304 // |value| as a pointer to avoid copying, and emphasize it must be valid for
304 // the life of the callback. |value| may not be NULL. 305 // the life of the callback. |value| may not be NULL.
305 // Warning: |name| and |value| must remain valid for the life of the callback. 306 // Warning: |name| and |value| must remain valid for the life of the callback.
306 static ParametersCallback StringCallback(const char* name, 307 static ParametersCallback StringCallback(const char* name,
307 const std::string* value); 308 const std::string* value);
308 309
310 // Same as above, but takes in a UTF16 string.
311 static ParametersCallback StringCallback(const char* name,
312 const string16* value);
313
309 protected: 314 protected:
310 // Child classes should respond to the new entry here. This includes 315 // Child classes should respond to the new entry here. This includes
311 // creating the Entry object and alerting their observers. 316 // creating the Entry object and alerting their observers.
312 virtual void OnAddEntry(const Entry& entry) = 0; 317 virtual void OnAddEntry(const Entry& entry) = 0;
313 318
314 // Subclasses must call these in the corresponding functions to set an 319 // Subclasses must call these in the corresponding functions to set an
315 // observer's |net_log_| and |log_level_| values. 320 // observer's |net_log_| and |log_level_| values.
316 void OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level); 321 void OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level);
317 void OnSetObserverLogLevel(ThreadSafeObserver* observer, 322 void OnSetObserverLogLevel(ThreadSafeObserver* observer,
318 LogLevel log_level); 323 LogLevel log_level);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 virtual ~NetLogSourceParameter() {} 480 virtual ~NetLogSourceParameter() {}
476 481
477 private: 482 private:
478 const char* name_; 483 const char* name_;
479 const NetLog::Source value_; 484 const NetLog::Source value_;
480 }; 485 };
481 486
482 } // namespace net 487 } // namespace net
483 488
484 #endif // NET_BASE_NET_LOG_H_ 489 #endif // NET_BASE_NET_LOG_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698