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

Side by Side Diff: base/trace_event/trace_event_etw_export_win.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add \n Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 exporting to ETW. 5 // This file contains the Windows-specific exporting to ETW.
6 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ 6 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_
7 #define BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ 7 #define BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_
8 8
9 #include <map> 9 #include <map>
10 10
11 #include "base/base_export.h" 11 #include "base/base_export.h"
12 #include "base/strings/string_piece.h" 12 #include "base/strings/string_piece.h"
13 #include "base/trace_event/trace_event_impl.h" 13 #include "base/trace_event/trace_event_impl.h"
14 14
15 // Fwd. 15 // Fwd.
danakj 2015/09/01 20:55:13 put this comment on the forward decl, or remove it
16 namespace base {
danakj 2015/09/01 20:55:13 whitespace after this line
16 template <typename Type> 17 template <typename Type>
17 struct StaticMemorySingletonTraits; 18 struct StaticMemorySingletonTraits;
18 19
19 namespace base {
20 namespace trace_event { 20 namespace trace_event {
21 21
22 class BASE_EXPORT TraceEventETWExport { 22 class BASE_EXPORT TraceEventETWExport {
23 public: 23 public:
24 ~TraceEventETWExport(); 24 ~TraceEventETWExport();
25 25
26 // Retrieves the singleton. 26 // Retrieves the singleton.
27 // Note that this may return NULL post-AtExit processing. 27 // Note that this may return NULL post-AtExit processing.
28 static TraceEventETWExport* GetInstance(); 28 static TraceEventETWExport* GetInstance();
29 29
(...skipping 29 matching lines...) Expand all
59 const char* arg_name_2, 59 const char* arg_name_2,
60 const char* arg_value_2, 60 const char* arg_value_2,
61 const char* arg_name_3, 61 const char* arg_name_3,
62 const char* arg_value_3); 62 const char* arg_value_3);
63 63
64 // Returns true if any category in the group is enabled. 64 // Returns true if any category in the group is enabled.
65 static bool IsCategoryGroupEnabled(const char* category_group_name); 65 static bool IsCategoryGroupEnabled(const char* category_group_name);
66 66
67 private: 67 private:
68 // Ensure only the provider can construct us. 68 // Ensure only the provider can construct us.
69 friend struct StaticMemorySingletonTraits<TraceEventETWExport>; 69 friend struct base::StaticMemorySingletonTraits<TraceEventETWExport>;
70 // To have access to UpdateKeyword(). 70 // To have access to UpdateKeyword().
71 class ETWKeywordUpdateThread; 71 class ETWKeywordUpdateThread;
72 TraceEventETWExport(); 72 TraceEventETWExport();
73 73
74 // Updates the list of enabled categories by consulting the ETW keyword. 74 // Updates the list of enabled categories by consulting the ETW keyword.
75 // Returns true if there was a change, false otherwise. 75 // Returns true if there was a change, false otherwise.
76 bool UpdateEnabledCategories(); 76 bool UpdateEnabledCategories();
77 77
78 // Returns true if the category is enabled. 78 // Returns true if the category is enabled.
79 bool IsCategoryEnabled(const char* category_name) const; 79 bool IsCategoryEnabled(const char* category_name) const;
(...skipping 16 matching lines...) Expand all
96 scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_; 96 scoped_ptr<ETWKeywordUpdateThread> keyword_update_thread_;
97 PlatformThreadHandle keyword_update_thread_handle_; 97 PlatformThreadHandle keyword_update_thread_handle_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport); 99 DISALLOW_COPY_AND_ASSIGN(TraceEventETWExport);
100 }; 100 };
101 101
102 } // namespace trace_event 102 } // namespace trace_event
103 } // namespace base 103 } // namespace base
104 104
105 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_ 105 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ETW_EXPORT_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698