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

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: ToT 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
« no previous file with comments | « base/threading/thread_id_name_manager.h ('k') | base/trace_event/trace_event_etw_export_win.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 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 namespace base {
16
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 bool IsCategoryEnabled(const char* category_name) const; 79 bool IsCategoryEnabled(const char* category_name) const;
80 80
81 // Called back by the update thread to check for potential changes to the 81 // Called back by the update thread to check for potential changes to the
82 // keyword. 82 // keyword.
83 static void UpdateETWKeyword(); 83 static void UpdateETWKeyword();
84 84
85 // True if ETW is enabled. Allows hiding the exporting behind a flag. 85 // True if ETW is enabled. Allows hiding the exporting behind a flag.
86 bool etw_export_enabled_; 86 bool etw_export_enabled_;
87 87
88 // Maps category names to their status (enabled/disabled). 88 // Maps category names to their status (enabled/disabled).
89 std::map<base::StringPiece, bool> categories_status_; 89 std::map<StringPiece, bool> categories_status_;
90 90
91 // Local copy of the ETW keyword. 91 // Local copy of the ETW keyword.
92 uint64 etw_match_any_keyword_; 92 uint64 etw_match_any_keyword_;
93 93
94 // Background thread that monitors changes to the ETW keyword and updates 94 // Background thread that monitors changes to the ETW keyword and updates
95 // the enabled categories when a change occurs. 95 // the enabled categories when a change occurs.
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
« no previous file with comments | « base/threading/thread_id_name_manager.h ('k') | base/trace_event/trace_event_etw_export_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698