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

Side by Side Diff: base/logging_win.cc

Issue 552004: Style cleanup in preparation for auto-linting base/. (Closed)
Patch Set: Created 10 years, 11 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/linked_ptr.h ('k') | base/md5.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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/atomicops.h" 6 #include "base/atomicops.h"
7 #include "base/singleton.h" 7 #include "base/singleton.h"
8 #include <initguid.h> // NOLINT 8 #include <initguid.h> // NOLINT
9 9
10 namespace { 10 namespace {
11 11
12 struct LogEventProviderTraits { 12 struct LogEventProviderTraits {
13 // WARNING: User has to deal with get() returning NULL. 13 // WARNING: User has to deal with get() returning NULL.
14 static logging::LogEventProvider* New() { 14 static logging::LogEventProvider* New() {
15 if (base::subtle::NoBarrier_AtomicExchange(&dead_, 1)) 15 if (base::subtle::NoBarrier_AtomicExchange(&dead_, 1))
16 return NULL; 16 return NULL;
17 logging::LogEventProvider* ptr = 17 logging::LogEventProvider* ptr =
18 reinterpret_cast<logging::LogEventProvider*>(buffer_); 18 reinterpret_cast<logging::LogEventProvider*>(buffer_);
19 // We are protected by a memory barrier. 19 // We are protected by a memory barrier.
20 new (ptr) logging::LogEventProvider(); 20 new(ptr) logging::LogEventProvider();
21 return ptr; 21 return ptr;
22 } 22 }
23 23
24 static void Delete(logging::LogEventProvider* p) { 24 static void Delete(logging::LogEventProvider* p) {
25 base::subtle::NoBarrier_Store(&dead_, 1); 25 base::subtle::NoBarrier_Store(&dead_, 1);
26 MemoryBarrier(); 26 MemoryBarrier();
27 p->logging::LogEventProvider::~LogEventProvider(); 27 p->logging::LogEventProvider::~LogEventProvider();
28 } 28 }
29 29
30 static const bool kRegisterAtExit = true; 30 static const bool kRegisterAtExit = true;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 break; 143 break;
144 } 144 }
145 } 145 }
146 146
147 void LogEventProvider::OnEventsDisabled() { 147 void LogEventProvider::OnEventsDisabled() {
148 // Restore the old log level. 148 // Restore the old log level.
149 SetMinLogLevel(old_log_level_); 149 SetMinLogLevel(old_log_level_);
150 } 150 }
151 151
152 } // namespace logging 152 } // namespace logging
OLDNEW
« no previous file with comments | « base/linked_ptr.h ('k') | base/md5.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698