| 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/BluetoothRemoteGATTCharacteristic.h" | 5 #include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/DOMDataView.h" | 10 #include "core/dom/DOMDataView.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const WTF::AtomicString& BluetoothRemoteGATTCharacteristic::interfaceName() cons
t | 88 const WTF::AtomicString& BluetoothRemoteGATTCharacteristic::interfaceName() cons
t |
| 89 { | 89 { |
| 90 return EventTargetNames::BluetoothRemoteGATTCharacteristic; | 90 return EventTargetNames::BluetoothRemoteGATTCharacteristic; |
| 91 } | 91 } |
| 92 | 92 |
| 93 ExecutionContext* BluetoothRemoteGATTCharacteristic::getExecutionContext() const | 93 ExecutionContext* BluetoothRemoteGATTCharacteristic::getExecutionContext() const |
| 94 { | 94 { |
| 95 return ActiveDOMObject::getExecutionContext(); | 95 return ActiveDOMObject::getExecutionContext(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicStr
ing& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListe
nerOptions& options) | 98 bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicStr
ing& eventType, RawPtr<EventListener> listener, const EventListenerOptions& opti
ons) |
| 99 { | 99 { |
| 100 // We will also need to unregister a characteristic once all the event | 100 // We will also need to unregister a characteristic once all the event |
| 101 // listeners have been removed. See http://crbug.com/541390 | 101 // listeners have been removed. See http://crbug.com/541390 |
| 102 if (eventType == EventTypeNames::characteristicvaluechanged) { | 102 if (eventType == EventTypeNames::characteristicvaluechanged) { |
| 103 WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(g
etExecutionContext()); | 103 WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(g
etExecutionContext()); |
| 104 webbluetooth->registerCharacteristicObject(m_webCharacteristic->characte
risticInstanceID, this); | 104 webbluetooth->registerCharacteristicObject(m_webCharacteristic->characte
risticInstanceID, this); |
| 105 } | 105 } |
| 106 return EventTarget::addEventListenerInternal(eventType, listener, options); | 106 return EventTarget::addEventListenerInternal(eventType, listener, options); |
| 107 } | 107 } |
| 108 | 108 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) | 216 DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) |
| 217 { | 217 { |
| 218 RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothRemoteGATTChara
cteristic>::trace(visitor); | 218 RefCountedGarbageCollectedEventTargetWithInlineData<BluetoothRemoteGATTChara
cteristic>::trace(visitor); |
| 219 ActiveDOMObject::trace(visitor); | 219 ActiveDOMObject::trace(visitor); |
| 220 visitor->trace(m_properties); | 220 visitor->trace(m_properties); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |