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

Unified Diff: device/vr/vr_device_manager.cc

Issue 2537723002: Refine VRDevice Class (Closed)
Patch Set: Rebase Created 4 years 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 | « device/vr/vr_device_manager.h ('k') | device/vr/vr_display_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_device_manager.cc
diff --git a/device/vr/vr_device_manager.cc b/device/vr/vr_device_manager.cc
index 1f08be9c81e5dd884d8d945ed0e37ff3994549a8..ec73db1086f69156716decc453473b00aa002bd7 100644
--- a/device/vr/vr_device_manager.cc
+++ b/device/vr/vr_device_manager.cc
@@ -70,21 +70,17 @@ void VRDeviceManager::AddService(VRServiceImpl* service) {
// when they are created.
GetVRDevices(service);
- services_.push_back(service);
+ services_.insert(service);
}
void VRDeviceManager::RemoveService(VRServiceImpl* service) {
- services_.erase(std::remove(services_.begin(), services_.end(), service),
- services_.end());
-
- for (auto device : devices_) {
- device.second->RemoveService(service);
- }
if (service->listening_for_activate()) {
ListeningForActivateChanged(false);
}
+ services_.erase(service);
+
if (services_.empty() && !keep_alive_) {
// Delete the device manager when it has no active connections.
delete g_vr_device_manager;
@@ -110,7 +106,10 @@ bool VRDeviceManager::GetVRDevices(VRServiceImpl* service) {
if (devices_.find(device->id()) == devices_.end())
devices_[device->id()] = device;
- device->AddService(service);
+ // Create a VRDisplayImpl for this service/device pair and attach
+ // the VRDisplayImpl to the device.
+ VRDisplayImpl* display_impl = service->GetVRDisplayImpl(device);
+ device->AddDisplay(display_impl);
}
return true;
« no previous file with comments | « device/vr/vr_device_manager.h ('k') | device/vr/vr_display_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698