OLD | NEW |
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 #ifndef CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H | 5 #ifndef CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H |
6 #define CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H | 6 #define CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "content/browser/vr/vr_device.h" | 17 #include "content/browser/vr/vr_device.h" |
18 #include "content/browser/vr/vr_device_provider.h" | 18 #include "content/browser/vr/vr_device_provider.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/vr_service.mojom.h" | 20 #include "content/common/vr_service.mojom.h" |
21 #include "mojo/public/cpp/bindings/weak_binding_set.h" | 21 #include "mojo/public/cpp/bindings/binding_set.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 class VRDeviceManager : public VRService { | 25 class VRDeviceManager : public VRService { |
26 public: | 26 public: |
27 ~VRDeviceManager() override; | 27 ~VRDeviceManager() override; |
28 | 28 |
29 static void BindRequest(mojo::InterfaceRequest<VRService> request); | 29 static void BindRequest(mojo::InterfaceRequest<VRService> request); |
30 | 30 |
31 // Returns the VRDeviceManager singleton. | 31 // Returns the VRDeviceManager singleton. |
(...skipping 26 matching lines...) Expand all Loading... |
58 | 58 |
59 using ProviderList = std::vector<linked_ptr<VRDeviceProvider>>; | 59 using ProviderList = std::vector<linked_ptr<VRDeviceProvider>>; |
60 ProviderList providers_; | 60 ProviderList providers_; |
61 | 61 |
62 // Devices are owned by their providers. | 62 // Devices are owned by their providers. |
63 using DeviceMap = std::map<unsigned int, VRDevice*>; | 63 using DeviceMap = std::map<unsigned int, VRDevice*>; |
64 DeviceMap devices_; | 64 DeviceMap devices_; |
65 | 65 |
66 bool vr_initialized_; | 66 bool vr_initialized_; |
67 | 67 |
68 mojo::WeakBindingSet<VRService> bindings_; | 68 mojo::BindingSet<VRService> bindings_; |
69 | 69 |
70 // For testing. If true will not delete self when consumer count reaches 0. | 70 // For testing. If true will not delete self when consumer count reaches 0. |
71 bool keep_alive_; | 71 bool keep_alive_; |
72 | 72 |
73 base::ThreadChecker thread_checker_; | 73 base::ThreadChecker thread_checker_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(VRDeviceManager); | 75 DISALLOW_COPY_AND_ASSIGN(VRDeviceManager); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace content | 78 } // namespace content |
79 | 79 |
80 #endif // CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H | 80 #endif // CONTENT_BROWSER_VR_VR_DEVICE_MANAGER_H |
OLD | NEW |