| Index: device/vr/vr_display_impl.cc
|
| diff --git a/device/vr/vr_display_impl.cc b/device/vr/vr_display_impl.cc
|
| index c99b7dfc813f07ffa82f762cf81813accf699059..c14f8b736beecd8644d52d5101786ec48e25ca32 100644
|
| --- a/device/vr/vr_display_impl.cc
|
| +++ b/device/vr/vr_display_impl.cc
|
| @@ -15,11 +15,17 @@ VRDisplayImpl::VRDisplayImpl(device::VRDevice* device, VRServiceImpl* service)
|
| device_(device),
|
| service_(service),
|
| weak_ptr_factory_(this) {
|
| - mojom::VRDisplayInfoPtr display_info = device->GetVRDevice();
|
| - if (service->client()) {
|
| - service->client()->OnDisplayConnected(binding_.CreateInterfacePtrAndBind(),
|
| - mojo::MakeRequest(&client_),
|
| - std::move(display_info));
|
| + base::Callback<void(mojom::VRDisplayInfoPtr)> callback = base::Bind(
|
| + &VRDisplayImpl::OnVRDisplayInfoCreated, weak_ptr_factory_.GetWeakPtr());
|
| + device->GetVRDevice(callback);
|
| +}
|
| +
|
| +void VRDisplayImpl::OnVRDisplayInfoCreated(
|
| + mojom::VRDisplayInfoPtr display_info) {
|
| + if (service_->client()) {
|
| + service_->client()->OnDisplayConnected(binding_.CreateInterfacePtrAndBind(),
|
| + mojo::MakeRequest(&client_),
|
| + std::move(display_info));
|
| }
|
| }
|
|
|
|
|