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

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: code rebase Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b4858eae51b1ce11ad612fb3a39c8fe3bcf6bdf3..8597e12d04fee1f93ab54dcecff584f4aa4d6688 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->GetInterfaceProvider()->GetInterface(
- mojo::MakeRequest(&sensor_provider_));
+ Platform::Current()->GetConnector()->BindInterface(
+ device::mojom::blink::kServiceName, mojo::MakeRequest(&sensor_provider_));
sensor_provider_.set_connection_error_handler(ConvertToBaseCallback(
WTF::Bind(&SensorProviderProxy::OnSensorProviderConnectionError,
WrapWeakPersistent(this))));
@@ -39,7 +40,7 @@ SensorProviderProxy* SensorProviderProxy::From(LocalFrame* frame) {
provider_proxy = new SensorProviderProxy(*frame);
Supplement<LocalFrame>::ProvideTo(*frame, SupplementName(), provider_proxy);
}
- provider_proxy->InitializeIfNeeded(frame);
+ provider_proxy->InitializeIfNeeded();
return provider_proxy;
}
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698