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

Side by Side Diff: chrome/browser/metrics/thread_watcher.h

Issue 6780035: Use lock-free lazy initialization for static histogram references (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | « chrome/browser/jankometer.cc ('k') | chrome/browser/metrics/thread_watcher.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 // This file defines a WatchDog thread that monitors the responsiveness of other 5 // This file defines a WatchDog thread that monitors the responsiveness of other
6 // browser threads like UI, IO, DB, FILE and CACHED threads. It also defines 6 // browser threads like UI, IO, DB, FILE and CACHED threads. It also defines
7 // ThreadWatcher class which performs health check on threads that would like to 7 // ThreadWatcher class which performs health check on threads that would like to
8 // be watched. This file also defines ThreadWatcherList class that has list of 8 // be watched. This file also defines ThreadWatcherList class that has list of
9 // all active ThreadWatcher objects. 9 // all active ThreadWatcher objects.
10 // 10 //
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // This is set to true if thread watcher is watching. 179 // This is set to true if thread watcher is watching.
180 bool active_; 180 bool active_;
181 181
182 // The counter tracks least number of ping messages that will be sent to 182 // The counter tracks least number of ping messages that will be sent to
183 // watched thread before the ping-pong mechanism will go into an extended 183 // watched thread before the ping-pong mechanism will go into an extended
184 // sleep. If this value is zero, then the mechanism is in an extended sleep, 184 // sleep. If this value is zero, then the mechanism is in an extended sleep,
185 // and awaiting some observed user action before continuing. 185 // and awaiting some observed user action before continuing.
186 int ping_count_; 186 int ping_count_;
187 187
188 // Histogram that keeps track of response times for the watched thread. 188 // Histogram that keeps track of response times for the watched thread.
189 scoped_refptr<base::Histogram> histogram_; 189 base::Histogram* histogram_;
190 190
191 // We use this factory to create callback tasks for ThreadWatcher object. We 191 // We use this factory to create callback tasks for ThreadWatcher object. We
192 // use this during ping-pong messaging between WatchDog thread and watched 192 // use this during ping-pong messaging between WatchDog thread and watched
193 // thread. 193 // thread.
194 ScopedRunnableMethodFactory<ThreadWatcher> method_factory_; 194 ScopedRunnableMethodFactory<ThreadWatcher> method_factory_;
195 195
196 DISALLOW_COPY_AND_ASSIGN(ThreadWatcher); 196 DISALLOW_COPY_AND_ASSIGN(ThreadWatcher);
197 }; 197 };
198 198
199 // Class with a list of all active thread watchers. A thread watcher is active 199 // Class with a list of all active thread watchers. A thread watcher is active
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 DISALLOW_COPY_AND_ASSIGN(WatchDogThread); 320 DISALLOW_COPY_AND_ASSIGN(WatchDogThread);
321 }; 321 };
322 322
323 // DISABLE_RUNNABLE_METHOD_REFCOUNT is a convenience macro for disabling 323 // DISABLE_RUNNABLE_METHOD_REFCOUNT is a convenience macro for disabling
324 // refcounting of ThreadWatcher and ThreadWatcherList classes. 324 // refcounting of ThreadWatcher and ThreadWatcherList classes.
325 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcher); 325 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcher);
326 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcherList); 326 DISABLE_RUNNABLE_METHOD_REFCOUNT(ThreadWatcherList);
327 327
328 #endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_ 328 #endif // CHROME_BROWSER_METRICS_THREAD_WATCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/jankometer.cc ('k') | chrome/browser/metrics/thread_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698