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

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

Issue 2188373002: DO NOT SUBMIT bluetooth-fuzzer: Draft fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-catch-and-connect
Patch Set: Created 4 years, 4 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return getPrimaryServicesImpl(scriptState, mojom::blink::WebBluetoothGATTQue ryQuantity::MULTIPLE, serviceUUID); 139 return getPrimaryServicesImpl(scriptState, mojom::blink::WebBluetoothGATTQue ryQuantity::MULTIPLE, serviceUUID);
140 } 140 }
141 141
142 ScriptPromise BluetoothRemoteGATTServer::getPrimaryServices(ScriptState* scriptS tate, ExceptionState&) 142 ScriptPromise BluetoothRemoteGATTServer::getPrimaryServices(ScriptState* scriptS tate, ExceptionState&)
143 { 143 {
144 return getPrimaryServicesImpl(scriptState, mojom::blink::WebBluetoothGATTQue ryQuantity::MULTIPLE); 144 return getPrimaryServicesImpl(scriptState, mojom::blink::WebBluetoothGATTQue ryQuantity::MULTIPLE);
145 } 145 }
146 146
147 ScriptPromise BluetoothRemoteGATTServer::getPrimaryServicesImpl(ScriptState* scr iptState, mojom::blink::WebBluetoothGATTQueryQuantity quantity, String servicesU UID) 147 ScriptPromise BluetoothRemoteGATTServer::getPrimaryServicesImpl(ScriptState* scr iptState, mojom::blink::WebBluetoothGATTQueryQuantity quantity, String servicesU UID)
148 { 148 {
149 if (!connected()) {
150 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(NetworkError, "yay"));
151 }
149 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 152 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
150 ScriptPromise promise = resolver->promise(); 153 ScriptPromise promise = resolver->promise();
151 154
152 WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptStat e); 155 WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptStat e);
153 webbluetooth->getPrimaryServices(device()->id(), static_cast<int32_t>(quanti ty), servicesUUID, new GetPrimaryServicesCallback(device(), quantity, resolver)) ; 156 webbluetooth->getPrimaryServices(device()->id(), static_cast<int32_t>(quanti ty), servicesUUID, new GetPrimaryServicesCallback(device(), quantity, resolver)) ;
154 157
155 return promise; 158 return promise;
156 } 159 }
157 160
158 } // namespace blink 161 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698