| 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 "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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 // Record how many watched threads are responding. | 263 // Record how many watched threads are responding. |
| 264 responsive_count_histogram_->Add(no_of_responding_threads); | 264 responsive_count_histogram_->Add(no_of_responding_threads); |
| 265 | 265 |
| 266 // Record how many watched threads are not responding. | 266 // Record how many watched threads are not responding. |
| 267 unresponsive_count_histogram_->Add(no_of_unresponding_threads); | 267 unresponsive_count_histogram_->Add(no_of_unresponding_threads); |
| 268 | 268 |
| 269 // Crash the browser if IO thread hasn't responded atleast kUnresponsiveCount | 269 // Crash the browser if IO thread hasn't responded atleast kUnresponsiveCount |
| 270 // times and if the number of other threads is equal to 1. We picked 1 to | 270 // times and if the number of other threads is equal to 1. We picked 1 to |
| 271 // reduce the number of crashes and to get some sample data. | 271 // reduce the number of crashes and to get some sample data. |
| 272 // if (thread_id_ == BrowserThread::IO && no_of_responding_threads == 1) { | 272 if (thread_id_ == BrowserThread::IO && no_of_responding_threads == 1) { |
| 273 // int* crash = NULL; | 273 int* crash = NULL; |
| 274 // CHECK(crash++); | 274 CHECK(crash++); |
| 275 // } | 275 } |
| 276 | 276 |
| 277 hung_processing_complete_ = true; | 277 hung_processing_complete_ = true; |
| 278 } | 278 } |
| 279 | 279 |
| 280 // ThreadWatcherList methods and members. | 280 // ThreadWatcherList methods and members. |
| 281 // | 281 // |
| 282 // static | 282 // static |
| 283 ThreadWatcherList* ThreadWatcherList::global_ = NULL; | 283 ThreadWatcherList* ThreadWatcherList::global_ = NULL; |
| 284 // static | 284 // static |
| 285 const int ThreadWatcherList::kSleepSeconds = 2; | 285 const int ThreadWatcherList::kSleepSeconds = 2; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 watchdog_thread_ = NULL; | 539 watchdog_thread_ = NULL; |
| 540 } | 540 } |
| 541 | 541 |
| 542 void WatchDogThread::CleanUpAfterMessageLoopDestruction() { | 542 void WatchDogThread::CleanUpAfterMessageLoopDestruction() { |
| 543 #if defined(OS_WIN) | 543 #if defined(OS_WIN) |
| 544 // Closes the COM library on the current thread. CoInitialize must | 544 // Closes the COM library on the current thread. CoInitialize must |
| 545 // be balanced by a corresponding call to CoUninitialize. | 545 // be balanced by a corresponding call to CoUninitialize. |
| 546 CoUninitialize(); | 546 CoUninitialize(); |
| 547 #endif | 547 #endif |
| 548 } | 548 } |
| OLD | NEW |