Chromium Code Reviews| Index: device/vr/vr_service_impl.cc |
| diff --git a/device/vr/vr_service_impl.cc b/device/vr/vr_service_impl.cc |
| index 05b75b07221d06b45bbbbd7a4705902fad213047..e058c8bfc1efef269cff517b04070cb0b7087688 100644 |
| --- a/device/vr/vr_service_impl.cc |
| +++ b/device/vr/vr_service_impl.cc |
| @@ -36,8 +36,8 @@ void VRServiceImpl::SetClient(mojom::VRServiceClientPtr service_client, |
| client_ = std::move(service_client); |
| VRDeviceManager* device_manager = VRDeviceManager::GetInstance(); |
| // Once a client has been connected AddService will force any VRDisplays to |
| - // send OnConnected to it so that it's populated with the currently active |
| - // displays. Thereafer it will stay up to date by virtue of listening for new |
| + // send ConnectDevice to it so that it's populated with the currently active |
| + // displays. Thereafter it will stay up to date by virtue of listening for new |
| // connected events. |
| device_manager->AddService(this); |
| callback.Run(device_manager->GetNumberOfConnectedDevices()); |
| @@ -69,6 +69,12 @@ void VRServiceImpl::OnVRDisplayInfoCreated( |
| "process is not established"; |
| return; |
| } |
| + if (!display_info) { |
| + // We cannot instantiate a display with a null display info. |
| + DLOG(WARNING) |
|
billorr
2017/03/24 21:46:55
NIT: Warning sounds like this is an invalid state,
tiborg
2017/03/24 22:16:36
Removed the warning.
|
| + << "Received null display info. Will not instantiate VRDisplayImpl."; |
| + return; |
| + } |
| displays_[device] = base::MakeUnique<VRDisplayImpl>( |
| device, this, client_.get(), std::move(display_info)); |
| } |