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

Side by Side Diff: base/logging_win.cc

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/logging_win.h ('k') | base/memory/singleton.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/logging_win.h" 5 #include "base/logging_win.h"
6 #include "base/memory/singleton.h" 6 #include "base/memory/singleton.h"
7 #include <initguid.h> // NOLINT 7 #include <initguid.h> // NOLINT
8 8
9 namespace logging { 9 namespace logging {
10 10
11 using base::win::EtwEventLevel; 11 using base::win::EtwEventLevel;
12 using base::win::EtwMofEvent; 12 using base::win::EtwMofEvent;
13 13
14 DEFINE_GUID(kLogEventId, 14 DEFINE_GUID(kLogEventId,
15 0x7fe69228, 0x633e, 0x4f06, 0x80, 0xc1, 0x52, 0x7f, 0xea, 0x23, 0xe3, 0xa7); 15 0x7fe69228, 0x633e, 0x4f06, 0x80, 0xc1, 0x52, 0x7f, 0xea, 0x23, 0xe3, 0xa7);
16 16
17 LogEventProvider::LogEventProvider() : old_log_level_(LOG_NONE) { 17 LogEventProvider::LogEventProvider() : old_log_level_(LOG_NONE) {
18 } 18 }
19 19
20 LogEventProvider* LogEventProvider::GetInstance() { 20 LogEventProvider* LogEventProvider::GetInstance() {
21 return Singleton<LogEventProvider, 21 return base::Singleton<LogEventProvider, base::StaticMemorySingletonTraits<
22 StaticMemorySingletonTraits<LogEventProvider> >::get(); 22 LogEventProvider>>::get();
23 } 23 }
24 24
25 bool LogEventProvider::LogMessage(logging::LogSeverity severity, 25 bool LogEventProvider::LogMessage(logging::LogSeverity severity,
26 const char* file, int line, size_t message_start, 26 const char* file, int line, size_t message_start,
27 const std::string& message) { 27 const std::string& message) {
28 EtwEventLevel level = TRACE_LEVEL_NONE; 28 EtwEventLevel level = TRACE_LEVEL_NONE;
29 29
30 // Convert the log severity to the most appropriate ETW trace level. 30 // Convert the log severity to the most appropriate ETW trace level.
31 if (severity >= 0) { 31 if (severity >= 0) {
32 switch (severity) { 32 switch (severity) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 SetMinLogLevel(TRACE_LEVEL_INFORMATION - level); 129 SetMinLogLevel(TRACE_LEVEL_INFORMATION - level);
130 } 130 }
131 } 131 }
132 132
133 void LogEventProvider::OnEventsDisabled() { 133 void LogEventProvider::OnEventsDisabled() {
134 // Restore the old log level. 134 // Restore the old log level.
135 SetMinLogLevel(old_log_level_); 135 SetMinLogLevel(old_log_level_);
136 } 136 }
137 137
138 } // namespace logging 138 } // namespace logging
OLDNEW
« no previous file with comments | « base/logging_win.h ('k') | base/memory/singleton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698