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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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/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/events/Event.h" 9 #include "core/events/Event.h"
10 #include "core/inspector/ConsoleMessage.h" 10 #include "core/inspector/ConsoleMessage.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 195
196 // Partial implementation of writeValue algorithm: 196 // Partial implementation of writeValue algorithm:
197 // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattchar acteristic-writevalue 197 // https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattchar acteristic-writevalue
198 198
199 // If bytes is more than 512 bytes long (the maximum length of an attribute 199 // If bytes is more than 512 bytes long (the maximum length of an attribute
200 // value, per Long Attribute Values) return a promise rejected with an 200 // value, per Long Attribute Values) return a promise rejected with an
201 // InvalidModificationError and abort. 201 // InvalidModificationError and abort.
202 if (value.byteLength() > 512) 202 if (value.byteLength() > 512)
203 return ScriptPromise::rejectWithDOMException( 203 return ScriptPromise::rejectWithDOMException(
204 scriptState, DOMException::create(InvalidModificationError, 204 scriptState,
205 "Value can't exceed 512 bytes.")); 205 DOMException::create(InvalidModificationError,
206 "Value can't exceed 512 bytes."));
206 207
207 // Let valueVector be a copy of the bytes held by value. 208 // Let valueVector be a copy of the bytes held by value.
208 Vector<uint8_t> valueVector; 209 Vector<uint8_t> valueVector;
209 valueVector.append(value.bytes(), value.byteLength()); 210 valueVector.append(value.bytes(), value.byteLength());
210 211
211 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); 212 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
212 ScriptPromise promise = resolver->promise(); 213 ScriptPromise promise = resolver->promise();
213 getGatt()->AddToActiveAlgorithms(resolver); 214 getGatt()->AddToActiveAlgorithms(resolver);
214 215
215 mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service(); 216 mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) { 422 DEFINE_TRACE(BluetoothRemoteGATTCharacteristic) {
422 visitor->trace(m_service); 423 visitor->trace(m_service);
423 visitor->trace(m_properties); 424 visitor->trace(m_properties);
424 visitor->trace(m_value); 425 visitor->trace(m_value);
425 visitor->trace(m_device); 426 visitor->trace(m_device);
426 EventTargetWithInlineData::trace(visitor); 427 EventTargetWithInlineData::trace(visitor);
427 ContextLifecycleObserver::trace(visitor); 428 ContextLifecycleObserver::trace(visitor);
428 } 429 }
429 430
430 } // namespace blink 431 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698