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

Unified Diff: chrome/browser/chromeos/cros_power_library.cc

Issue 339013: cros: doing dbus stuff on the file thread==disaster. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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/chromeos/cros_power_library.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros_power_library.cc
===================================================================
--- chrome/browser/chromeos/cros_power_library.cc (revision 29405)
+++ chrome/browser/chromeos/cros_power_library.cc (working copy)
@@ -19,17 +19,12 @@
CrosPowerLibrary::CrosPowerLibrary() : status_(chromeos::PowerStatus()) {
if (CrosLibrary::loaded()) {
- MessageLoop* loop = ChromeThread::GetMessageLoop(ChromeThread::FILE);
- if (loop)
- loop->PostTask(FROM_HERE, NewRunnableMethod(this,
- &CrosPowerLibrary::InitOnBackgroundThread));
+ Init();
}
}
CrosPowerLibrary::~CrosPowerLibrary() {
if (CrosLibrary::loaded()) {
- // FILE thread is already gone by the time we get to this destructor.
- // So it's ok to just make the disconnect call on the main thread.
chromeos::DisconnectPowerStatus(power_status_connection_);
}
}
@@ -80,7 +75,7 @@
power->UpdatePowerStatus(status);
}
-void CrosPowerLibrary::InitOnBackgroundThread() {
+void CrosPowerLibrary::Init() {
power_status_connection_ = chromeos::MonitorPowerStatus(
&PowerStatusChangedHandler, this);
}
« no previous file with comments | « chrome/browser/chromeos/cros_power_library.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698