Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3828)

Unified Diff: chrome/browser/browser_main.cc

Issue 6602004: Trying changes to see the perfomance impact on Mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
===================================================================
--- chrome/browser/browser_main.cc (revision 76198)
+++ chrome/browser/browser_main.cc (working copy)
@@ -45,6 +45,7 @@
#include "chrome/browser/metrics/histogram_synchronizer.h"
#include "chrome/browser/metrics/metrics_log.h"
#include "chrome/browser/metrics/metrics_service.h"
+#include "chrome/browser/metrics/thread_watcher.h"
#include "chrome/browser/net/blob_url_request_job_factory.h"
#include "chrome/browser/net/chrome_dns_cert_provenance_checker.h"
#include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h"
@@ -702,6 +703,9 @@
process->process_launcher_thread();
process->cache_thread();
process->io_thread();
+ // Create watchdog thread after creating all other threads because it will
+ // watch the other threads and they must be running.
+ process->watchdog_thread();
}
// Returns the new local state object, guaranteed non-NULL.
@@ -1353,6 +1357,11 @@
scoped_refptr<HistogramSynchronizer> histogram_synchronizer(
new HistogramSynchronizer());
+ // Initialize thread watcher system. This is a singleton and is used by
+ // WatchDogThread to keep track of information about threads that are being
+ // watched.
+ scoped_ptr<ThreadWatcherList> thread_watcher_list(new ThreadWatcherList());
+
// Initialize the prefs of the local state.
browser::RegisterLocalState(local_state);
@@ -1386,6 +1395,14 @@
CreateChildThreads(browser_process.get());
+ // Start watching all browser threads for responsiveness.
+ MessageLoop* message_loop = WatchDogThread::CurrentMessageLoop();
+ if (message_loop)
+ message_loop->PostDelayedTask(
+ FROM_HERE,
+ NewRunnableFunction(&WatchDogThread::StartWatchingAll),
+ base::TimeDelta::FromSeconds(10).InMilliseconds());
+
#if defined(OS_CHROMEOS)
// Now that the file thread exists we can record our stats.
chromeos::BootTimesLoader::Get()->RecordChromeMainStats();
@@ -1903,6 +1920,9 @@
process_singleton.Cleanup();
+ // Stop all tasks that might run on WatchDogThread.
+ ThreadWatcherList::StopWatchingAll();
+
metrics->Stop();
// browser_shutdown takes care of deleting browser_process, so we need to
« no previous file with comments | « no previous file | chrome/browser/browser_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698