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

Side by Side Diff: chrome/common/profiling.cc

Issue 9192024: Add a convenience typedef LazyInstance<T>::Leaky to avoid repeating T. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 | Annotate | Revision Log
« no previous file with comments | « base/win/sampling_profiler.cc ('k') | crypto/nss_util.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) 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 "chrome/common/profiling.h" 5 #include "chrome/common/profiling.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/profiler.h" 10 #include "base/debug/profiler.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 thread_ = NULL; 82 thread_ = NULL;
83 } 83 }
84 84
85 private: 85 private:
86 base::Thread* thread_; 86 base::Thread* thread_;
87 base::Lock lock_; 87 base::Lock lock_;
88 88
89 DISALLOW_COPY_AND_ASSIGN(ProfilingThreadControl); 89 DISALLOW_COPY_AND_ASSIGN(ProfilingThreadControl);
90 }; 90 };
91 91
92 base::LazyInstance<ProfilingThreadControl, 92 base::LazyInstance<ProfilingThreadControl>::Leaky
93 base::LeakyLazyInstanceTraits<ProfilingThreadControl> >
94 g_flush_thread_control = LAZY_INSTANCE_INITIALIZER; 93 g_flush_thread_control = LAZY_INSTANCE_INITIALIZER;
95 94
96 } // namespace 95 } // namespace
97 96
98 // static 97 // static
99 void Profiling::ProcessStarted() { 98 void Profiling::ProcessStarted() {
100 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 99 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
101 std::string process_type = 100 std::string process_type =
102 command_line.GetSwitchValueASCII(switches::kProcessType); 101 command_line.GetSwitchValueASCII(switches::kProcessType);
103 102
(...skipping 28 matching lines...) Expand all
132 return base::debug::BeingProfiled(); 131 return base::debug::BeingProfiled();
133 } 132 }
134 133
135 // static 134 // static
136 void Profiling::Toggle() { 135 void Profiling::Toggle() {
137 if (BeingProfiled()) 136 if (BeingProfiled())
138 Stop(); 137 Stop();
139 else 138 else
140 Start(); 139 Start();
141 } 140 }
OLDNEW
« no previous file with comments | « base/win/sampling_profiler.cc ('k') | crypto/nss_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698