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

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

Issue 2614143002: Use a new Supplement constructor for LocalFrame's supplements (Closed)
Patch Set: Created 3 years, 11 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 23 matching lines...) Expand all
34 Document*, 34 Document*,
35 std::unique_ptr<SensorReadingFactory>); 35 std::unique_ptr<SensorReadingFactory>);
36 36
37 SensorProxy* getSensorProxy(device::mojom::blink::SensorType); 37 SensorProxy* getSensorProxy(device::mojom::blink::SensorType);
38 38
39 DECLARE_VIRTUAL_TRACE(); 39 DECLARE_VIRTUAL_TRACE();
40 40
41 private: 41 private:
42 friend class SensorProxy; // To call getSensorProvider(). 42 friend class SensorProxy; // To call getSensorProvider().
43 43
44 explicit SensorProviderProxy(LocalFrame*); 44 explicit SensorProviderProxy(LocalFrame&);
45 static const char* supplementName(); 45 static const char* supplementName();
46 void initialize(LocalFrame*); 46 void initializeIfNeeded(LocalFrame*);
47 bool isInitialized() const { return m_sensorProvider; } 47 bool isInitialized() const { return m_sensorProvider; }
48 48
49 device::mojom::blink::SensorProvider* getSensorProvider() const { 49 device::mojom::blink::SensorProvider* getSensorProvider() const {
50 return m_sensorProvider.get(); 50 return m_sensorProvider.get();
51 } 51 }
52 52
53 void onSensorProviderConnectionError(); 53 void onSensorProviderConnectionError();
54 54
55 using SensorsSet = HeapHashSet<WeakMember<SensorProxy>>; 55 using SensorsSet = HeapHashSet<WeakMember<SensorProxy>>;
56 SensorsSet m_sensorProxies; 56 SensorsSet m_sensorProxies;
57 57
58 device::mojom::blink::SensorProviderPtr m_sensorProvider; 58 device::mojom::blink::SensorProviderPtr m_sensorProvider;
59 }; 59 };
60 60
61 } // namespace blink 61 } // namespace blink
62 62
63 #endif // SensorProviderProxy_h 63 #endif // SensorProviderProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698