summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-26 06:37:21 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-26 06:37:21 +0000
commitc82b0682d1d66e38346a664ef83d1211f83b3b5f (patch)
treeb7b9cdf69e4f9af85a59cfd5b885729c890ee7df /chrome/browser/browser_process_impl.cc
parente9e0a7d9f8fe4a3faecd62091a1910b1b27488cf (diff)
downloadchromium_src-c82b0682d1d66e38346a664ef83d1211f83b3b5f.zip
chromium_src-c82b0682d1d66e38346a664ef83d1211f83b3b5f.tar.gz
chromium_src-c82b0682d1d66e38346a664ef83d1211f83b3b5f.tar.bz2
Revert 76015 - Added back thread watcher changes by
reverting the revert. will revert the changes right away. trying to test impact on memory on mac. BUG=73915 TEST=performance tests Review URL: http://codereview.chromium.org/6594011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index f65c65b..9f0fcee 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -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 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line)
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 @@ BrowserProcessImpl::~BrowserProcessImpl() {
// 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 @@ base::Thread* BrowserProcessImpl::background_x11_thread() {
}
#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,16 @@ void BrowserProcessImpl::CreateCacheThread() {
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());
+ if (!thread->Start())
+ return;
+ watchdog_thread_.swap(thread);
+}
+
void BrowserProcessImpl::CreateProfileManager() {
DCHECK(!created_profile_manager_ && profile_manager_.get() == NULL);
created_profile_manager_ = true;