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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 472383002: Add ProcessPowerCollector to audit power information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS doesn't actually run chrome_browser_main, so removed ifdefs related to ios. Created 6 years, 4 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 | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/power/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index a603ffd63d2a04aa5db9d6cef5282ba4f9019855..5734707eabcf29ee629030baeeb4126514d92e8d 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -69,6 +69,7 @@
#include "chrome/browser/performance_monitor/performance_monitor.h"
#include "chrome/browser/performance_monitor/startup_timer.h"
#include "chrome/browser/plugins/plugin_prefs.h"
+#include "chrome/browser/power/process_power_collector.h"
#include "chrome/browser/pref_service_flags_storage.h"
#include "chrome/browser/prefs/chrome_pref_service_factory.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
@@ -1547,6 +1548,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
performance_monitor::PerformanceMonitor::GetInstance()->Initialize();
+#if !defined(OS_ANDROID)
+ process_power_collector_.reset(new ProcessPowerCollector);
+ process_power_collector_->Initialize();
+#endif
+
PostBrowserStart();
if (parameters().ui_task) {
@@ -1619,6 +1625,10 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() {
// Disarm the startup hang detector time bomb if it is still Arm'ed.
startup_watcher_->Disarm();
+ // Remove observers attached to D-Bus clients before DbusThreadManager is
+ // shut down.
+ process_power_collector_.reset();
+
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostMainMessageLoopRun();
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/power/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698