Index: chrome/browser/browser_process_impl.cc |
=================================================================== |
--- chrome/browser/browser_process_impl.cc (revision 76198) |
+++ chrome/browser/browser_process_impl.cc (working copy) |
@@ -32,6 +32,7 @@ |
#include "chrome/browser/intranet_redirect_detector.h" |
#include "chrome/browser/io_thread.h" |
#include "chrome/browser/metrics/metrics_service.h" |
+#include "chrome/browser/metrics/thread_watcher.h" |
#include "chrome/browser/net/chrome_net_log.h" |
#include "chrome/browser/net/predictor_api.h" |
#include "chrome/browser/net/sdch_dictionary_fetcher.h" |
@@ -97,6 +98,7 @@ |
created_db_thread_(false), |
created_process_launcher_thread_(false), |
created_cache_thread_(false), |
+ created_watchdog_thread_(false), |
created_profile_manager_(false), |
created_local_state_(false), |
created_icon_manager_(false), |
@@ -245,6 +247,9 @@ |
// on the db thread too. |
db_thread_.reset(); |
+ // Stop the watchdog thread after stopping other threads. |
+ watchdog_thread_.reset(); |
+ |
// At this point, no render process exist and the file, io, db, and |
// webkit threads in this process have all terminated, so it's safe |
// to access local state data such as cookies, database, or local storage. |
@@ -390,6 +395,14 @@ |
} |
#endif |
+WatchDogThread* BrowserProcessImpl::watchdog_thread() { |
+ DCHECK(CalledOnValidThread()); |
+ if (!created_watchdog_thread_) |
+ CreateWatchdogThread(); |
+ DCHECK(watchdog_thread_.get() != NULL); |
+ return watchdog_thread_.get(); |
+} |
+ |
ProfileManager* BrowserProcessImpl::profile_manager() { |
DCHECK(CalledOnValidThread()); |
if (!created_profile_manager_) |
@@ -725,6 +738,18 @@ |
cache_thread_.swap(thread); |
} |
+void BrowserProcessImpl::CreateWatchdogThread() { |
+ DCHECK(!created_watchdog_thread_ && watchdog_thread_.get() == NULL); |
+ created_watchdog_thread_ = true; |
+ |
+ scoped_ptr<WatchDogThread> thread(new WatchDogThread()); |
+ base::Thread::Options options; |
+ options.stack_size = 48*1024; |
+ if (!thread->StartWithOptions(options)) |
+ return; |
+ watchdog_thread_.swap(thread); |
+} |
+ |
void BrowserProcessImpl::CreateProfileManager() { |
DCHECK(!created_profile_manager_ && profile_manager_.get() == NULL); |
created_profile_manager_ = true; |