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

Side by Side Diff: base/win/sampling_profiler.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/tracked_objects.cc ('k') | chrome/common/profiling.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/win/sampling_profiler.h" 5 #include "base/win/sampling_profiler.h"
6 6
7 #include <winternl.h> // for NTSTATUS. 7 #include <winternl.h> // for NTSTATUS.
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (ZwSetIntervalProfile && 97 if (ZwSetIntervalProfile &&
98 ZwQueryIntervalProfile && 98 ZwQueryIntervalProfile &&
99 ZwCreateProfile && 99 ZwCreateProfile &&
100 ZwStartProfile && 100 ZwStartProfile &&
101 ZwStopProfile) { 101 ZwStopProfile) {
102 initialized_ = true; 102 initialized_ = true;
103 } 103 }
104 } 104 }
105 } 105 }
106 106
107 base::LazyInstance<ProfilerFuncs, base::LeakyLazyInstanceTraits<ProfilerFuncs> > 107 base::LazyInstance<ProfilerFuncs>::Leaky funcs = LAZY_INSTANCE_INITIALIZER;
108 funcs = LAZY_INSTANCE_INITIALIZER;
109 108
110 } // namespace 109 } // namespace
111 110
112 111
113 namespace base { 112 namespace base {
114 namespace win { 113 namespace win {
115 114
116 SamplingProfiler::SamplingProfiler() : is_started_(false) { 115 SamplingProfiler::SamplingProfiler() : is_started_(false) {
117 } 116 }
118 117
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 return false; 229 return false;
231 230
232 // According to Nebbet, the sampling interval is in units of 100ns. 231 // According to Nebbet, the sampling interval is in units of 100ns.
233 *sampling_interval = base::TimeDelta::FromMicroseconds(interval / 10); 232 *sampling_interval = base::TimeDelta::FromMicroseconds(interval / 10);
234 233
235 return true; 234 return true;
236 } 235 }
237 236
238 } // namespace win 237 } // namespace win
239 } // namespace base 238 } // namespace base
OLDNEW
« no previous file with comments | « base/tracked_objects.cc ('k') | chrome/common/profiling.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698