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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRController.h

Issue 1808203005: [OnionSoup] Moving VR service from content to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using std::unique_ptr and using [Sync] mojo call! Created 4 years, 7 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
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 #ifndef VRController_h 5 #ifndef VRController_h
6 #define VRController_h 6 #define VRController_h
7 7
8 #include "core/frame/LocalFrameLifecycleObserver.h" 8 #include "core/frame/LocalFrameLifecycleObserver.h"
9 #include "modules/ModulesExport.h" 9 #include "modules/ModulesExport.h"
10 #include "modules/vr/VRTypeConverters.h"
10 #include "platform/Supplementable.h" 11 #include "platform/Supplementable.h"
11 #include "public/platform/modules/vr/WebVR.h" 12 #include "wtf/Deque.h"
12 #include "public/platform/modules/vr/WebVRClient.h" 13 #include "wtf/PassOwnPtr.h"
dcheng 2016/05/03 21:48:14 Not needed anymore. But #include <memory> please.
RaviKasibhatla 2016/05/04 08:54:37 Done.
13 14
14 namespace blink { 15 namespace blink {
15 16
17 class ServiceRegistry;
18 class VRGetDevicesCallback;
19
16 class MODULES_EXPORT VRController final 20 class MODULES_EXPORT VRController final
17 : public GarbageCollectedFinalized<VRController> 21 : public GarbageCollectedFinalized<VRController>
18 , public Supplement<LocalFrame> 22 , public Supplement<LocalFrame>
19 , public LocalFrameLifecycleObserver { 23 , public LocalFrameLifecycleObserver {
20 USING_GARBAGE_COLLECTED_MIXIN(VRController); 24 USING_GARBAGE_COLLECTED_MIXIN(VRController);
21 WTF_MAKE_NONCOPYABLE(VRController); 25 WTF_MAKE_NONCOPYABLE(VRController);
22 public: 26 public:
23 virtual ~VRController(); 27 virtual ~VRController();
24 28
25 void getDevices(WebVRGetDevicesCallback*); 29 void getDevices(std::unique_ptr<VRGetDevicesCallback>);
26 30
27 void getSensorState(unsigned index, WebHMDSensorState& into); 31 void getSensorState(unsigned index, WebHMDSensorState& into);
28 32
29 void resetSensor(unsigned index); 33 void resetSensor(unsigned index);
30 34
31 static void provideTo(LocalFrame&, WebVRClient*); 35 static void provideTo(LocalFrame&, ServiceRegistry*);
32 static VRController* from(LocalFrame&); 36 static VRController* from(LocalFrame&);
33 static const char* supplementName(); 37 static const char* supplementName();
34 38
35 DECLARE_VIRTUAL_TRACE(); 39 DECLARE_VIRTUAL_TRACE();
36 40
37 private: 41 private:
38 VRController(LocalFrame&, WebVRClient*); 42 VRController(LocalFrame&, ServiceRegistry*);
39 43
40 // Inherited from LocalFrameLifecycleObserver. 44 // Inherited from LocalFrameLifecycleObserver.
41 void willDetachFrameHost() override; 45 void willDetachFrameHost() override;
42 46
43 WebVRClient* m_client; 47 // Binding callbacks.
48 void OnGetDevices(const mojo::Array<mojom::VRDeviceInfoPtr>&);
49
50 WTF::Deque<std::unique_ptr<VRGetDevicesCallback>> m_pendingGetDevicesCallbac ks;
51 mojom::VRServicePtr m_service;
44 }; 52 };
45 53
46 } // namespace blink 54 } // namespace blink
47 55
48 #endif // VRController_h 56 #endif // VRController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698