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

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

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/metrics/thread_watcher.h ('k') | chrome/browser/net/url_info.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 "base/threading/thread_restrictions.h" 5 #include "base/threading/thread_restrictions.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "chrome/browser/metrics/metrics_service.h" 7 #include "chrome/browser/metrics/metrics_service.h"
8 #include "chrome/browser/metrics/thread_watcher.h" 8 #include "chrome/browser/metrics/thread_watcher.h"
9 #include "content/common/notification_service.h" 9 #include "content/common/notification_service.h"
10 10
(...skipping 10 matching lines...) Expand all
21 const base::TimeDelta& sleep_time, 21 const base::TimeDelta& sleep_time,
22 const base::TimeDelta& unresponsive_time) 22 const base::TimeDelta& unresponsive_time)
23 : thread_id_(thread_id), 23 : thread_id_(thread_id),
24 thread_name_(thread_name), 24 thread_name_(thread_name),
25 sleep_time_(sleep_time), 25 sleep_time_(sleep_time),
26 unresponsive_time_(unresponsive_time), 26 unresponsive_time_(unresponsive_time),
27 ping_time_(base::TimeTicks::Now()), 27 ping_time_(base::TimeTicks::Now()),
28 ping_sequence_number_(0), 28 ping_sequence_number_(0),
29 active_(false), 29 active_(false),
30 ping_count_(kPingCount), 30 ping_count_(kPingCount),
31 histogram_(NULL),
31 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { 32 ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
32 Initialize(); 33 Initialize();
33 } 34 }
34 35
35 ThreadWatcher::~ThreadWatcher() {} 36 ThreadWatcher::~ThreadWatcher() {}
36 37
37 // static 38 // static
38 void ThreadWatcher::StartWatching(const BrowserThread::ID& thread_id, 39 void ThreadWatcher::StartWatching(const BrowserThread::ID& thread_id,
39 const std::string& thread_name, 40 const std::string& thread_name,
40 const base::TimeDelta& sleep_time, 41 const base::TimeDelta& sleep_time,
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 watchdog_thread_ = NULL; 421 watchdog_thread_ = NULL;
421 } 422 }
422 423
423 void WatchDogThread::CleanUpAfterMessageLoopDestruction() { 424 void WatchDogThread::CleanUpAfterMessageLoopDestruction() {
424 #if defined(OS_WIN) 425 #if defined(OS_WIN)
425 // Closes the COM library on the current thread. CoInitialize must 426 // Closes the COM library on the current thread. CoInitialize must
426 // be balanced by a corresponding call to CoUninitialize. 427 // be balanced by a corresponding call to CoUninitialize.
427 CoUninitialize(); 428 CoUninitialize();
428 #endif 429 #endif
429 } 430 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher.h ('k') | chrome/browser/net/url_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698