OLD | NEW |
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/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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 #endif | 81 #endif |
82 | 82 |
83 void CrashBecauseThreadWasUnresponsive(BrowserThread::ID thread_id) { | 83 void CrashBecauseThreadWasUnresponsive(BrowserThread::ID thread_id) { |
84 base::debug::Alias(&thread_id); | 84 base::debug::Alias(&thread_id); |
85 | 85 |
86 switch (thread_id) { | 86 switch (thread_id) { |
87 case BrowserThread::UI: | 87 case BrowserThread::UI: |
88 return ThreadUnresponsive_UI(); | 88 return ThreadUnresponsive_UI(); |
89 case BrowserThread::DB: | 89 case BrowserThread::DB: |
90 return ThreadUnresponsive_DB(); | 90 return ThreadUnresponsive_DB(); |
91 case BrowserThread::WEBKIT: | 91 case BrowserThread::WEBKIT_DEPRECATED: |
92 return ThreadUnresponsive_WEBKIT(); | 92 return ThreadUnresponsive_WEBKIT(); |
93 case BrowserThread::FILE: | 93 case BrowserThread::FILE: |
94 return ThreadUnresponsive_FILE(); | 94 return ThreadUnresponsive_FILE(); |
95 case BrowserThread::FILE_USER_BLOCKING: | 95 case BrowserThread::FILE_USER_BLOCKING: |
96 return ThreadUnresponsive_FILE_USER_BLOCKING(); | 96 return ThreadUnresponsive_FILE_USER_BLOCKING(); |
97 case BrowserThread::PROCESS_LAUNCHER: | 97 case BrowserThread::PROCESS_LAUNCHER: |
98 return ThreadUnresponsive_PROCESS_LAUNCHER(); | 98 return ThreadUnresponsive_PROCESS_LAUNCHER(); |
99 case BrowserThread::CACHE: | 99 case BrowserThread::CACHE: |
100 return ThreadUnresponsive_CACHE(); | 100 return ThreadUnresponsive_CACHE(); |
101 case BrowserThread::IO: | 101 case BrowserThread::IO: |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 916 |
917 #if defined(OS_WIN) | 917 #if defined(OS_WIN) |
918 // On Windows XP, give twice the time for shutdown. | 918 // On Windows XP, give twice the time for shutdown. |
919 if (base::win::GetVersion() <= base::win::VERSION_XP) | 919 if (base::win::GetVersion() <= base::win::VERSION_XP) |
920 actual_duration *= 2; | 920 actual_duration *= 2; |
921 #endif | 921 #endif |
922 | 922 |
923 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); | 923 shutdown_watchdog_ = new ShutdownWatchDogThread(actual_duration); |
924 shutdown_watchdog_->Arm(); | 924 shutdown_watchdog_->Arm(); |
925 } | 925 } |
OLD | NEW |