| 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);
|
| }
|
|
|