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

Side by Side Diff: base/debug/trace_event_win.h

Issue 5527004: Access singletons with a new GetInstance() method instead of Singleton<T>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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) 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 // This file contains the Windows-specific declarations for trace_event.h. 5 // This file contains the Windows-specific declarations for trace_event.h.
6 #ifndef BASE_DEBUG_TRACE_EVENT_WIN_H_ 6 #ifndef BASE_DEBUG_TRACE_EVENT_WIN_H_
7 #define BASE_DEBUG_TRACE_EVENT_WIN_H_ 7 #define BASE_DEBUG_TRACE_EVENT_WIN_H_
8 #pragma once 8 #pragma once
9 9
10 #include <string> 10 #include <string>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // std::string instances where not needed. 78 // std::string instances where not needed.
79 static void Trace(const char* name, 79 static void Trace(const char* name,
80 EventType type, 80 EventType type,
81 const void* id, 81 const void* id,
82 const char* extra) { 82 const char* extra) {
83 return Trace(name, -1, type, id, extra, -1); 83 return Trace(name, -1, type, id, extra, -1);
84 } 84 }
85 85
86 // Retrieves the singleton. 86 // Retrieves the singleton.
87 // Note that this may return NULL post-AtExit processing. 87 // Note that this may return NULL post-AtExit processing.
88 static TraceLog* Get(); 88 static TraceLog* GetInstance();
89 89
90 // Returns true iff tracing is turned on. 90 // Returns true iff tracing is turned on.
91 bool IsTracing() { 91 bool IsTracing() {
92 return enable_level() >= TRACE_LEVEL_INFORMATION; 92 return enable_level() >= TRACE_LEVEL_INFORMATION;
93 } 93 }
94 94
95 // Emit a trace of type |type| containing |name|, |id|, and |extra|. 95 // Emit a trace of type |type| containing |name|, |id|, and |extra|.
96 // Note: |name| and |extra| must be NULL, or a zero-terminated string of 96 // Note: |name| and |extra| must be NULL, or a zero-terminated string of
97 // length |name_len| or |extra_len| respectively. 97 // length |name_len| or |extra_len| respectively.
98 // Note: if name_len or extra_len are -1, the length of the corresponding 98 // Note: if name_len or extra_len are -1, the length of the corresponding
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Optionally the stack trace, consisting of a DWORD "depth", followed 142 // Optionally the stack trace, consisting of a DWORD "depth", followed
143 // by an array of void* (machine bitness) of length "depth". 143 // by an array of void* (machine bitness) of length "depth".
144 144
145 // Forward decl. 145 // Forward decl.
146 struct TraceLogSingletonTraits; 146 struct TraceLogSingletonTraits;
147 147
148 } // nemspace debug 148 } // nemspace debug
149 } // namespace base 149 } // namespace base
150 150
151 #endif // BASE_DEBUG_TRACE_EVENT_WIN_H_ 151 #endif // BASE_DEBUG_TRACE_EVENT_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698