Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/renderer/vr_dispatcher.h" | |
| 6 | |
| 7 #include "content/public/renderer/render_thread.h" | |
| 8 #include "ipc/ipc_sync_message_filter.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 VRDispatcher::VRDispatcher() { | |
| 13 } | |
| 14 | |
| 15 VRDispatcher::~VRDispatcher() { | |
| 16 } | |
| 17 | |
| 18 void VRDispatcher::GetVRDevices( | |
| 19 blink::WebVector<blink::WebVRDevice>* devices) { | |
| 20 std::vector<blink::WebVRDevice> ipcDevices; | |
| 21 | |
| 22 CHECK(RenderThread::Get()->Send(new VRMsg_GetVRDevices( | |
|
no sievers
2015/03/19 01:24:53
not sure about the CHECKs(). or why we would do th
| |
| 23 &ipcDevices))); | |
| 24 | |
| 25 if (devices && ipcDevices.size() > 0) | |
| 26 devices->assign(&ipcDevices.front(), ipcDevices.size()); | |
| 27 } | |
| 28 | |
| 29 void VRDispatcher::GetHMDSensorState( | |
| 30 unsigned int index, blink::WebHMDSensorState& state) { | |
| 31 CHECK(RenderThread::Get()->Send(new VRMsg_GetHMDSensorState(index, &state))); | |
|
no sievers
2015/03/19 01:24:53
On a related note... for GetSensorState and GetRen
| |
| 32 } | |
| 33 | |
| 34 void VRDispatcher::ResetSensor(unsigned int index) { | |
| 35 CHECK(RenderThread::Get()->Send(new VRMsg_ResetSensor( | |
| 36 index))); | |
| 37 } | |
| 38 | |
| 39 void VRDispatcher::GetRenderTargetRects(unsigned index, | |
| 40 blink::WebVRFieldOfView leftFov, | |
| 41 blink::WebVRFieldOfView rightFov, | |
| 42 blink::WebVRVector4* leftRect, | |
| 43 blink::WebVRVector4* rightRect) { | |
| 44 CHECK(RenderThread::Get()->Send(new VRMsg_GetRenderTargetRects( | |
| 45 index, leftFov, rightFov, leftRect, rightRect))); | |
| 46 } | |
| 47 | |
| 48 bool VRDispatcher::OnControlMessageReceived( | |
| 49 const IPC::Message& message) { | |
| 50 return false; | |
|
no sievers
2015/03/19 01:24:53
Why is this a RenderProcessObserver then?
| |
| 51 } | |
| 52 | |
| 53 } // namespace content | |
| OLD | NEW |