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/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "core/dom/DOMDataView.h" | 9 #include "core/dom/DOMDataView.h" |
10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 BluetoothRemoteGATTCharacteristic::BluetoothRemoteGATTCharacteristic( | 43 BluetoothRemoteGATTCharacteristic::BluetoothRemoteGATTCharacteristic( |
44 ExecutionContext* context, | 44 ExecutionContext* context, |
45 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic, | 45 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic, |
46 BluetoothRemoteGATTService* service) | 46 BluetoothRemoteGATTService* service) |
47 : SuspendableObject(context), | 47 : SuspendableObject(context), |
48 m_webCharacteristic(std::move(webCharacteristic)), | 48 m_webCharacteristic(std::move(webCharacteristic)), |
49 m_service(service), | 49 m_service(service), |
50 m_stopped(false) { | 50 m_stopped(false) { |
51 m_properties = BluetoothCharacteristicProperties::create( | 51 m_properties = BluetoothCharacteristicProperties::create( |
52 m_webCharacteristic->characteristicProperties); | 52 m_webCharacteristic->characteristicProperties); |
53 // See example in Source/platform/heap/ThreadState.h | |
54 ThreadState::current()->registerPreFinalizer(this); | |
55 } | 53 } |
56 | 54 |
57 BluetoothRemoteGATTCharacteristic* BluetoothRemoteGATTCharacteristic::create( | 55 BluetoothRemoteGATTCharacteristic* BluetoothRemoteGATTCharacteristic::create( |
58 ExecutionContext* context, | 56 ExecutionContext* context, |
59 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic, | 57 std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic, |
60 BluetoothRemoteGATTService* service) { | 58 BluetoothRemoteGATTService* service) { |
61 DCHECK(webCharacteristic); | 59 DCHECK(webCharacteristic); |
62 | 60 |
63 BluetoothRemoteGATTCharacteristic* characteristic = | 61 BluetoothRemoteGATTCharacteristic* characteristic = |
64 new BluetoothRemoteGATTCharacteristic( | 62 new BluetoothRemoteGATTCharacteristic( |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 390 |
393 DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) { | 391 DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) { |
394 visitor->trace(m_service); | 392 visitor->trace(m_service); |
395 visitor->trace(m_properties); | 393 visitor->trace(m_properties); |
396 visitor->trace(m_value); | 394 visitor->trace(m_value); |
397 EventTargetWithInlineData::trace(visitor); | 395 EventTargetWithInlineData::trace(visitor); |
398 SuspendableObject::trace(visitor); | 396 SuspendableObject::trace(visitor); |
399 } | 397 } |
400 | 398 |
401 } // namespace blink | 399 } // namespace blink |
OLD | NEW |