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

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

Issue 1775953004: bluetooth: Move writeValue to mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Moar cleanup Created 4 years, 9 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 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 { 153 {
154 if (!m_resolver->executionContext() || m_resolver->executionContext()->a ctiveDOMObjectsAreStopped()) 154 if (!m_resolver->executionContext() || m_resolver->executionContext()->a ctiveDOMObjectsAreStopped())
155 return; 155 return;
156 156
157 if (m_webCharacteristic) { 157 if (m_webCharacteristic) {
158 m_webCharacteristic->setValue(ConvertWebVectorToDataView(value)); 158 m_webCharacteristic->setValue(ConvertWebVectorToDataView(value));
159 } 159 }
160 m_resolver->resolve(); 160 m_resolver->resolve();
161 } 161 }
162 162
163 void onError(const WebBluetoothError& e) override 163 void onError(const mojom::WebBluetoothError& e) override
164 { 164 {
165 if (!m_resolver->executionContext() || m_resolver->executionContext()->a ctiveDOMObjectsAreStopped()) 165 if (!m_resolver->executionContext() || m_resolver->executionContext()->a ctiveDOMObjectsAreStopped())
166 return; 166 return;
167 m_resolver->reject(BluetoothError::take(m_resolver, e)); 167 m_resolver->reject(BluetoothError::take(m_resolver, e));
168 } 168 }
169 169
170 private: 170 private:
171 WeakPersistent<BluetoothRemoteGATTCharacteristic> m_webCharacteristic; 171 WeakPersistent<BluetoothRemoteGATTCharacteristic> m_webCharacteristic;
172 Persistent<ScriptPromiseResolver> m_resolver; 172 Persistent<ScriptPromiseResolver> m_resolver;
173 }; 173 };
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698