Chromium Code Reviews| Index: third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp |
| diff --git a/third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp b/third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp |
| index 21d167cc1d396659f8aa7a78b57d6e69bb247d9f..667e7f5e0b19b528d10be3c214d9e195741921b2 100644 |
| --- a/third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp |
| +++ b/third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp |
| @@ -6,6 +6,7 @@ |
| #include "platform/threading/BindForMojo.h" |
| #include "public/platform/Platform.h" |
| +#include "public/platform/ServiceRegistry.h" |
| #include "wtf/Assertions.h" |
| #include "wtf/PassOwnPtr.h" |
| @@ -53,7 +54,11 @@ void BatteryDispatcher::updateBatteryStatus(const BatteryStatus& batteryStatus) |
| void BatteryDispatcher::startListening() |
| { |
| ASSERT(!m_monitor.is_bound()); |
| - Platform::current()->connectToRemoteService(mojo::GetProxy(&m_monitor)); |
| + if (!Platform::current()->serviceRegistry()) |
|
esprehn
2016/03/31 05:10:43
So one thing we could do is have a static EmptySer
Sam McNally
2016/03/31 09:26:27
Done.
|
| + return; |
| + |
| + Platform::current()->serviceRegistry()->connectToRemoteService( |
| + mojo::GetProxy(&m_monitor)); |
| // m_monitor can be null during testing. |
| if (m_monitor) |
| queryNextStatus(); |