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 #include "modules/bluetooth/BluetoothSupplement.h" | 5 #include "modules/bluetooth/BluetoothSupplement.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 const char* BluetoothSupplement::supplementName() | 11 const char* BluetoothSupplement::supplementName() |
12 { | 12 { |
13 return "BluetoothSupplement"; | 13 return "BluetoothSupplement"; |
14 } | 14 } |
15 | 15 |
16 BluetoothSupplement::BluetoothSupplement(WebBluetooth* bluetooth) | 16 BluetoothSupplement::BluetoothSupplement(WebBluetooth* bluetooth, LocalFrame& fr
ame) |
17 : m_bluetooth(bluetooth) | 17 : Supplement<LocalFrame>(frame) |
| 18 , m_bluetooth(bluetooth) |
18 { | 19 { |
19 } | 20 } |
20 | 21 |
21 void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth) | 22 void BluetoothSupplement::provideTo(LocalFrame& frame, WebBluetooth* bluetooth) |
22 { | 23 { |
23 BluetoothSupplement* bluetoothSupplement = new BluetoothSupplement(bluetooth
); | 24 BluetoothSupplement* bluetoothSupplement = new BluetoothSupplement(bluetooth
, frame); |
24 Supplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSuppleme
nt); | 25 Supplement<LocalFrame>::provideTo(frame, supplementName(), bluetoothSuppleme
nt); |
25 }; | 26 }; |
26 | 27 |
27 WebBluetooth* BluetoothSupplement::from(LocalFrame* frame) | 28 WebBluetooth* BluetoothSupplement::from(LocalFrame* frame) |
28 { | 29 { |
29 BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(Suppleme
nt<LocalFrame>::from(frame, supplementName())); | 30 BluetoothSupplement* supplement = static_cast<BluetoothSupplement*>(Suppleme
nt<LocalFrame>::from(frame, supplementName())); |
30 | 31 |
31 ASSERT(supplement); | 32 ASSERT(supplement); |
32 ASSERT(supplement->m_bluetooth); | 33 ASSERT(supplement->m_bluetooth); |
33 | 34 |
(...skipping 12 matching lines...) Expand all Loading... |
46 } | 47 } |
47 return BluetoothSupplement::from(static_cast<Document*>(executionContext)->f
rame()); | 48 return BluetoothSupplement::from(static_cast<Document*>(executionContext)->f
rame()); |
48 } | 49 } |
49 | 50 |
50 DEFINE_TRACE(BluetoothSupplement) | 51 DEFINE_TRACE(BluetoothSupplement) |
51 { | 52 { |
52 Supplement<LocalFrame>::trace(visitor); | 53 Supplement<LocalFrame>::trace(visitor); |
53 } | 54 } |
54 | 55 |
55 } // namespace blink | 56 } // namespace blink |
OLD | NEW |