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

Side by Side Diff: device/vr/vr_device.cc

Issue 2729523002: Re-land^2 WebVR compositor bypass via BrowserMain context + mailbox (Closed)
Patch Set: Rebase to 11e28fd6b9380b77273db51ef0b6ccc7ea341944 Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « device/vr/vr_device.h ('k') | device/vr/vr_display_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/vr/vr_device.h" 5 #include "device/vr/vr_device.h"
6 #include "device/vr/vr_device_provider.h" 6 #include "device/vr/vr_device_provider.h"
7 #include "device/vr/vr_display_impl.h" 7 #include "device/vr/vr_display_impl.h"
8 8
9 namespace device { 9 namespace device {
10 10
11 unsigned int VRDevice::next_id_ = 1; 11 unsigned int VRDevice::next_id_ = 1;
12 12
13 VRDevice::VRDevice() 13 VRDevice::VRDevice()
14 : presenting_display_(nullptr), id_(next_id_), weak_ptr_factory_(this) { 14 : presenting_display_(nullptr), id_(next_id_), weak_ptr_factory_(this) {
15 // Prevent wraparound. Devices with this ID will be treated as invalid. 15 // Prevent wraparound. Devices with this ID will be treated as invalid.
16 if (next_id_ != VR_DEVICE_LAST_ID) 16 if (next_id_ != VR_DEVICE_LAST_ID)
17 next_id_++; 17 next_id_++;
18 } 18 }
19 19
20 VRDevice::~VRDevice() {} 20 VRDevice::~VRDevice() {}
21 21
22 void VRDevice::RequestPresent(const base::Callback<void(bool)>& callback) {
23 callback.Run(true);
24 }
25
26 void VRDevice::SetSecureOrigin(bool secure_origin) {}
27
28 void VRDevice::AddDisplay(VRDisplayImpl* display) { 22 void VRDevice::AddDisplay(VRDisplayImpl* display) {
29 displays_.insert(display); 23 displays_.insert(display);
30 } 24 }
31 25
32 void VRDevice::RemoveDisplay(VRDisplayImpl* display) { 26 void VRDevice::RemoveDisplay(VRDisplayImpl* display) {
33 if (CheckPresentingDisplay(display)) 27 if (CheckPresentingDisplay(display))
34 ExitPresent(); 28 ExitPresent();
35 displays_.erase(display); 29 displays_.erase(display);
36 } 30 }
37 31
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void VRDevice::OnDeactivate(mojom::VRDisplayEventReason reason) { 77 void VRDevice::OnDeactivate(mojom::VRDisplayEventReason reason) {
84 for (auto* display : displays_) 78 for (auto* display : displays_)
85 display->client()->OnDeactivate(reason); 79 display->client()->OnDeactivate(reason);
86 } 80 }
87 81
88 void VRDevice::SetPresentingDisplay(VRDisplayImpl* display) { 82 void VRDevice::SetPresentingDisplay(VRDisplayImpl* display) {
89 presenting_display_ = display; 83 presenting_display_ = display;
90 } 84 }
91 85
92 } // namespace device 86 } // namespace device
OLDNEW
« no previous file with comments | « device/vr/vr_device.h ('k') | device/vr/vr_display_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698