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

Unified Diff: third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp

Issue 1830883002: Add blink::ServiceRegistry and expose it from LocalFrame and Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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();

Powered by Google App Engine
This is Rietveld 408576698