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

Unified Diff: third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp

Issue 2460723003: Enable connection to Mojo services from Blink (Closed)
Patch Set: Fix build Created 4 years, 1 month 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/time_zone_monitor/TimeZoneMonitorClient.cpp
diff --git a/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp b/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp
index 4d211c04e70bc8cabc4f3e8549b5a2c931416a5d..85d04cc4e98b8f99bc7fe01144e71ad6aca45cc4 100644
--- a/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp
+++ b/third_party/WebKit/Source/modules/time_zone_monitor/TimeZoneMonitorClient.cpp
@@ -12,6 +12,8 @@
#include "core/workers/WorkerThread.h"
#include "public/platform/InterfaceProvider.h"
#include "public/platform/Platform.h"
+#include "services/device/public/cpp/constants.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
#include <v8.h>
@@ -33,11 +35,16 @@ void NotifyTimezoneChangeOnWorkerThread(ExecutionContext* context) {
// static
void TimeZoneMonitorClient::Init() {
+ if (!Platform::current()->serviceConnector())
+ return;
+
DEFINE_STATIC_LOCAL(TimeZoneMonitorClient, instance, ());
device::mojom::blink::TimeZoneMonitorPtr monitor;
- Platform::current()->interfaceProvider()->getInterface(
- mojo::GetProxy(&monitor));
+ std::unique_ptr<service_manager::Connection> deviceService =
+ Platform::current()->serviceConnector()->Connect(
+ device::kDeviceServiceName);
+ deviceService->GetInterface(mojo::GetProxy(&monitor));
monitor->AddClient(instance.m_binding.CreateInterfacePtrAndBind());
}

Powered by Google App Engine
This is Rietveld 408576698