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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Implement WebBluetooth getDescriptor[s] 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/BluetoothDevice.h" 5 #include "modules/bluetooth/BluetoothDevice.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/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return m_attributeInstanceMap->getOrCreateRemoteGATTCharacteristic( 56 return m_attributeInstanceMap->getOrCreateRemoteGATTCharacteristic(
57 context, std::move(characteristic), service); 57 context, std::move(characteristic), service);
58 } 58 }
59 59
60 bool BluetoothDevice::isValidCharacteristic( 60 bool BluetoothDevice::isValidCharacteristic(
61 const String& characteristicInstanceId) { 61 const String& characteristicInstanceId) {
62 return m_attributeInstanceMap->containsCharacteristic( 62 return m_attributeInstanceMap->containsCharacteristic(
63 characteristicInstanceId); 63 characteristicInstanceId);
64 } 64 }
65 65
66 BluetoothRemoteGATTDescriptor*
67 BluetoothDevice::getOrCreateBluetoothRemoteGATTDescriptor(
68 mojom::blink::WebBluetoothRemoteGATTDescriptorPtr descriptor,
69 BluetoothRemoteGATTCharacteristic* characteristic) {
70 return m_attributeInstanceMap->getOrCreateBluetoothRemoteGATTDescriptor(
71 std::move(descriptor), characteristic);
72 }
73
66 void BluetoothDevice::dispose() { 74 void BluetoothDevice::dispose() {
67 disconnectGATTIfConnected(); 75 disconnectGATTIfConnected();
68 } 76 }
69 77
70 void BluetoothDevice::contextDestroyed() { 78 void BluetoothDevice::contextDestroyed() {
71 disconnectGATTIfConnected(); 79 disconnectGATTIfConnected();
72 } 80 }
73 81
74 void BluetoothDevice::disconnectGATTIfConnected() { 82 void BluetoothDevice::disconnectGATTIfConnected() {
75 if (m_gatt->connected()) { 83 if (m_gatt->connected()) {
(...skipping 30 matching lines...) Expand all
106 114
107 DEFINE_TRACE(BluetoothDevice) { 115 DEFINE_TRACE(BluetoothDevice) {
108 visitor->trace(m_attributeInstanceMap); 116 visitor->trace(m_attributeInstanceMap);
109 visitor->trace(m_gatt); 117 visitor->trace(m_gatt);
110 visitor->trace(m_bluetooth); 118 visitor->trace(m_bluetooth);
111 EventTargetWithInlineData::trace(visitor); 119 EventTargetWithInlineData::trace(visitor);
112 ContextLifecycleObserver::trace(visitor); 120 ContextLifecycleObserver::trace(visitor);
113 } 121 }
114 122
115 } // namespace blink 123 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698