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

Unified Diff: services/device/device_service.cc

Issue 2603553002: Ports VRService to be hosted in the device service.
Patch Set: Ports VRService to be hosted in the device service. Created 3 years, 11 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: services/device/device_service.cc
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index 229695f19479593edfdeba9c5770079911bec358..c47e1e299f95b3ea741d75ec97f6720131d616e9 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -13,6 +13,15 @@
#include "services/service_manager/public/cpp/connection.h"
#include "services/service_manager/public/cpp/interface_registry.h"
+namespace {
+
+template <typename Interface>
+void IgnoreInterfaceRequest(mojo::InterfaceRequest<Interface> request) {
+ // Intentionally ignore the interface request.
+}
+
+} // namespace
+
namespace device {
std::unique_ptr<service_manager::Service> CreateDeviceService(
@@ -32,6 +41,7 @@ bool DeviceService::OnConnect(const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) {
registry->AddInterface<mojom::PowerMonitor>(this);
registry->AddInterface<mojom::TimeZoneMonitor>(this);
+ registry->AddInterface<mojom::VRService>(this);
return true;
}
@@ -47,4 +57,13 @@ void DeviceService::Create(const service_manager::Identity& remote_identity,
time_zone_monitor_->Bind(std::move(request));
}
+void DeviceService::Create(const service_manager::Identity& remote_identity,
+ mojom::VRServiceRequest request) {
+#if defined(ENABLE_WEBVR)
+ device::VRServiceImpl::Create(std::move(request));
+#else
+ IgnoreInterfaceRequest<mojom::VRService>(std::move(request));
+#endif
+}
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698