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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h

Issue 2698083007: Port device_generic_sensor to be hosted in Device Service. (Closed)
Patch Set: code rebase Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 SensorProviderProxy_h 5 #ifndef SensorProviderProxy_h
6 #define SensorProviderProxy_h 6 #define SensorProviderProxy_h
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" 9 #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h"
10 #include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" 10 #include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h"
(...skipping 21 matching lines...) Expand all
32 32
33 SensorProxy* getSensorProxy(device::mojom::blink::SensorType); 33 SensorProxy* getSensorProxy(device::mojom::blink::SensorType);
34 34
35 DECLARE_VIRTUAL_TRACE(); 35 DECLARE_VIRTUAL_TRACE();
36 36
37 private: 37 private:
38 friend class SensorProxy; // To call getSensorProvider(). 38 friend class SensorProxy; // To call getSensorProvider().
39 39
40 explicit SensorProviderProxy(LocalFrame&); 40 explicit SensorProviderProxy(LocalFrame&);
41 static const char* supplementName(); 41 static const char* supplementName();
42 void initializeIfNeeded(LocalFrame*); 42 void initializeIfNeeded();
43 bool isInitialized() const { return m_sensorProvider; } 43 bool isInitialized() const { return m_sensorProvider; }
44 44
45 device::mojom::blink::SensorProvider* getSensorProvider() const { 45 device::mojom::blink::SensorProvider* getSensorProvider() const {
46 return m_sensorProvider.get(); 46 return m_sensorProvider.get();
47 } 47 }
48 48
49 void onSensorProviderConnectionError(); 49 void onSensorProviderConnectionError();
50 50
51 using SensorsSet = HeapHashSet<WeakMember<SensorProxy>>; 51 using SensorsSet = HeapHashSet<WeakMember<SensorProxy>>;
52 SensorsSet m_sensorProxies; 52 SensorsSet m_sensorProxies;
53 53
54 device::mojom::blink::SensorProviderPtr m_sensorProvider; 54 device::mojom::blink::SensorProviderPtr m_sensorProvider;
55 }; 55 };
56 56
57 } // namespace blink 57 } // namespace blink
58 58
59 #endif // SensorProviderProxy_h 59 #endif // SensorProviderProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698