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

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

Issue 2614523002: Shorten some method names in //third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h (Closed)
Patch Set: shorten some method names in //third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h 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 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/BluetoothRemoteGATTServer.h" 5 #include "modules/bluetooth/BluetoothRemoteGATTServer.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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 resolver->reject( 116 resolver->reject(
117 DOMException::create(NetworkError, kGATTServerDisconnected)); 117 DOMException::create(NetworkError, kGATTServerDisconnected));
118 return; 118 return;
119 } 119 }
120 120
121 if (result == mojom::blink::WebBluetoothResult::SUCCESS) { 121 if (result == mojom::blink::WebBluetoothResult::SUCCESS) {
122 DCHECK(services); 122 DCHECK(services);
123 123
124 if (quantity == mojom::blink::WebBluetoothGATTQueryQuantity::SINGLE) { 124 if (quantity == mojom::blink::WebBluetoothGATTQueryQuantity::SINGLE) {
125 DCHECK_EQ(1u, services->size()); 125 DCHECK_EQ(1u, services->size());
126 resolver->resolve(m_device->getOrCreateBluetoothRemoteGATTService( 126 resolver->resolve(m_device->getOrCreateRemoteGATTService(
127 services.value()[0]->instance_id, services.value()[0]->uuid, 127 services.value()[0]->instance_id, services.value()[0]->uuid,
128 true /* isPrimary */, device()->id())); 128 true /* isPrimary */, device()->id()));
129 return; 129 return;
130 } 130 }
131 131
132 HeapVector<Member<BluetoothRemoteGATTService>> gattServices; 132 HeapVector<Member<BluetoothRemoteGATTService>> gattServices;
133 gattServices.reserveInitialCapacity(services->size()); 133 gattServices.reserveInitialCapacity(services->size());
134 134
135 for (const auto& service : services.value()) { 135 for (const auto& service : services.value()) {
136 gattServices.append(m_device->getOrCreateBluetoothRemoteGATTService( 136 gattServices.append(m_device->getOrCreateRemoteGATTService(
137 service->instance_id, service->uuid, true /* isPrimary */, 137 service->instance_id, service->uuid, true /* isPrimary */,
138 device()->id())); 138 device()->id()));
139 } 139 }
140 resolver->resolve(gattServices); 140 resolver->resolve(gattServices);
141 } else { 141 } else {
142 resolver->reject(BluetoothError::take(resolver, result)); 142 resolver->reject(BluetoothError::take(resolver, result));
143 } 143 }
144 } 144 }
145 145
146 ScriptPromise BluetoothRemoteGATTServer::getPrimaryService( 146 ScriptPromise BluetoothRemoteGATTServer::getPrimaryService(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 service->RemoteServerGetPrimaryServices( 201 service->RemoteServerGetPrimaryServices(
202 std::move(deviceId), quantity, uuid, 202 std::move(deviceId), quantity, uuid,
203 convertToBaseCallback( 203 convertToBaseCallback(
204 WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback, 204 WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback,
205 wrapPersistent(this), quantity, wrapPersistent(resolver)))); 205 wrapPersistent(this), quantity, wrapPersistent(resolver))));
206 return promise; 206 return promise;
207 } 207 }
208 208
209 } // namespace blink 209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698