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

Unified Diff: third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp

Issue 2698083007: Port device_generic_sensor to be hosted in Device Service. (Closed)
Patch Set: Port device_generic_sensor to be hosted in Device Service. Created 3 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/sensor/SensorProviderProxy.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
index 45e61e7d48d0a63fe10a75f691d8e9783a8e1316..9dcd2fb36494682edfa16cba41809f79266a0948 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
+++ b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
@@ -6,8 +6,9 @@
#include "modules/sensor/SensorProxy.h"
#include "platform/mojo/MojoHelper.h"
-#include "public/platform/InterfaceProvider.h"
#include "public/platform/Platform.h"
+#include "services/device/public/interfaces/constants.mojom-blink.h"
+#include "services/service_manager/public/cpp/connector.h"
namespace blink {
@@ -15,12 +16,12 @@ namespace blink {
SensorProviderProxy::SensorProviderProxy(LocalFrame& frame)
: Supplement<LocalFrame>(frame) {}
-void SensorProviderProxy::initializeIfNeeded(LocalFrame* frame) {
+void SensorProviderProxy::initializeIfNeeded() {
if (isInitialized())
return;
- frame->interfaceProvider()->getInterface(
- mojo::MakeRequest(&m_sensorProvider));
+ Platform::current()->connector()->BindInterface(
blundell 2017/03/29 09:41:59 Just to sanity-check: This feature doesn't have la
ke.he 2017/03/29 10:05:11 It has, in LayoutTests/sensor/resources/. That's
+ device::mojom::blink::kServiceName, mojo::MakeRequest(&m_sensorProvider));
m_sensorProvider.set_connection_error_handler(convertToBaseCallback(
WTF::bind(&SensorProviderProxy::onSensorProviderConnectionError,
wrapWeakPersistent(this))));
@@ -39,7 +40,7 @@ SensorProviderProxy* SensorProviderProxy::from(LocalFrame* frame) {
providerProxy = new SensorProviderProxy(*frame);
Supplement<LocalFrame>::provideTo(*frame, supplementName(), providerProxy);
}
- providerProxy->initializeIfNeeded(frame);
+ providerProxy->initializeIfNeeded();
return providerProxy;
}

Powered by Google App Engine
This is Rietveld 408576698