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

Unified Diff: base/logging_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 side-by-side diff with in-line comments
Download patch
Index: base/logging_win.h
diff --git a/base/logging_win.h b/base/logging_win.h
index 695c7f24b55da65fc9242b3e94a179dc11ccac58..2185309c39b02d9bf42bcf026a52dc244e70c84f 100644
--- a/base/logging_win.h
+++ b/base/logging_win.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/win/event_trace_provider.h"
#include "base/logging.h"
+#include "base/singleton.h"
M-A Ruel 2010/12/03 21:06:07 I think you could forward declare the trait instea
Satish 2010/12/04 23:00:40 Done.
namespace logging {
@@ -47,7 +48,7 @@ enum LogMessageTypes {
// with Event Tracing for Windows.
class LogEventProvider : public base::win::EtwTraceProvider {
public:
- LogEventProvider();
+ static LogEventProvider* GetInstance();
static bool LogMessage(logging::LogSeverity severity, const char* file,
int line, size_t message_start, const std::string& str);
@@ -61,10 +62,13 @@ class LogEventProvider : public base::win::EtwTraceProvider {
virtual void OnEventsDisabled();
private:
+ LogEventProvider();
+
// The log severity prior to OnEventsEnabled,
// restored in OnEventsDisabled.
logging::LogSeverity old_log_level_;
+ friend StaticMemorySingletonTraits<LogEventProvider>;
DISALLOW_COPY_AND_ASSIGN(LogEventProvider);
};

Powered by Google App Engine
This is Rietveld 408576698