OLD | NEW |
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 "chrome/browser/metrics/thread_watcher.h" | 5 #include "chrome/browser/metrics/thread_watcher.h" |
6 | 6 |
7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
33 #include "base/win/windows_version.h" | 33 #include "base/win/windows_version.h" |
34 #endif | 34 #endif |
35 | 35 |
36 using content::BrowserThread; | 36 using content::BrowserThread; |
37 | 37 |
38 // ThreadWatcher methods and members. | 38 // ThreadWatcher methods and members. |
39 ThreadWatcher::ThreadWatcher(const WatchingParams& params) | 39 ThreadWatcher::ThreadWatcher(const WatchingParams& params) |
40 : thread_id_(params.thread_id), | 40 : thread_id_(params.thread_id), |
41 thread_name_(params.thread_name), | 41 thread_name_(params.thread_name), |
42 watched_runner_( | 42 watched_runner_(BrowserThread::GetTaskRunnerForThread(params.thread_id)), |
43 BrowserThread::GetMessageLoopProxyForThread(params.thread_id)), | |
44 sleep_time_(params.sleep_time), | 43 sleep_time_(params.sleep_time), |
45 unresponsive_time_(params.unresponsive_time), | 44 unresponsive_time_(params.unresponsive_time), |
46 ping_time_(base::TimeTicks::Now()), | 45 ping_time_(base::TimeTicks::Now()), |
47 pong_time_(ping_time_), | 46 pong_time_(ping_time_), |
48 ping_sequence_number_(0), | 47 ping_sequence_number_(0), |
49 active_(false), | 48 active_(false), |
50 ping_count_(params.unresponsive_threshold), | 49 ping_count_(params.unresponsive_threshold), |
51 response_time_histogram_(nullptr), | 50 response_time_histogram_(nullptr), |
52 unresponsive_time_histogram_(nullptr), | 51 unresponsive_time_histogram_(nullptr), |
53 unresponsive_count_(0), | 52 unresponsive_count_(0), |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 | 999 |
1001 #if defined(OS_WIN) | 1000 #if defined(OS_WIN) |
1002 // On Windows XP, give twice the time for shutdown. | 1001 // On Windows XP, give twice the time for shutdown. |
1003 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1002 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1004 actual_duration *= 2; | 1003 actual_duration *= 2; |
1005 #endif | 1004 #endif |
1006 | 1005 |
1007 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); | 1006 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
1008 shutdown_watchdog_->Arm(); | 1007 shutdown_watchdog_->Arm(); |
1009 } | 1008 } |
OLD | NEW |