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

Unified Diff: device/vr/vr_device.h

Issue 2537723002: Refine VRDevice Class (Closed)
Patch Set: address comments Created 4 years, 1 month 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
Index: device/vr/vr_device.h
diff --git a/device/vr/vr_device.h b/device/vr/vr_device.h
index 8de5491ee5ece57c5e6fab5467c8e34c62d8543a..9c6b5ea2088a2cdb26a61b65ecae54bb7b5462e8 100644
--- a/device/vr/vr_device.h
+++ b/device/vr/vr_device.h
@@ -20,7 +20,6 @@ class BaseWindow;
namespace device {
class VRDisplayImpl;
-class VRServiceImpl;
const unsigned int VR_DEVICE_LAST_ID = 0xFFFFFFFF;
@@ -42,13 +41,11 @@ class DEVICE_VR_EXPORT VRDevice {
virtual void UpdateLayerBounds(mojom::VRLayerBoundsPtr left_bounds,
mojom::VRLayerBoundsPtr right_bounds) = 0;
- virtual void AddService(VRServiceImpl* service);
- virtual void RemoveService(VRServiceImpl* service);
+ virtual void AddDisplay(VRDisplayImpl* display);
+ virtual void RemoveDisplay(VRDisplayImpl* display);
- // TODO(shaobo.yan@intel.com): Checks should be done against VRDisplayImpl and
- // the name should be considered.
- virtual bool IsAccessAllowed(VRServiceImpl* service);
- virtual bool IsPresentingService(VRServiceImpl* service);
+ virtual bool IsAccessAllowed(VRDisplayImpl* display);
+ virtual bool CheckPresentingDisplay(VRDisplayImpl* display);
virtual void OnChanged();
virtual void OnExitPresent();
@@ -61,18 +58,14 @@ class DEVICE_VR_EXPORT VRDevice {
friend class VRDisplayImpl;
friend class VRDisplayImplTest;
- void SetPresentingService(VRServiceImpl* service);
+ void SetPresentingDisplay(VRDisplayImpl* display);
private:
// Each Service have one VRDisplay with one VRDevice.
bajones 2016/11/30 17:41:22 This comment should be updated or removed. It's ac
- // TODO(shaobo.yan@intel.com): Since the VRDisplayImpl knows its VRServiceImpl
- // we should
- // only need to store the VRDisplayImpl.
- using DisplayClientMap = std::map<VRServiceImpl*, VRDisplayImpl*>;
- DisplayClientMap displays_;
-
- // TODO(shaobo.yan@intel.com): Should track presenting VRDisplayImpl instead.
- VRServiceImpl* presenting_service_;
+ using DisplaySet = std::set<VRDisplayImpl*>;
mthiesse 2016/11/30 13:59:04 nit: Not sure if this using is useful or improves
+ DisplaySet displays_;
+
+ VRDisplayImpl* presenting_display_;
unsigned int id_;
« no previous file with comments | « device/vr/test/fake_vr_device.cc ('k') | device/vr/vr_device.cc » ('j') | device/vr/vr_device.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698