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

Side by Side Diff: Source/modules/bluetooth/BluetoothError.cpp

Issue 1240763002: CallbackPromiseAdapter types should be more compatible with WebCallbacks (3/3). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 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 | Annotate | Revision Log
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 "config.h" 5 #include "config.h"
6 #include "modules/bluetooth/BluetoothError.h" 6 #include "modules/bluetooth/BluetoothError.h"
7 7
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 DOMException* BluetoothError::take(ScriptPromiseResolver*, PassOwnPtr<WebBluetoo thError> webError) 13 DOMException* BluetoothError::take(ScriptPromiseResolver*, const WebBluetoothErr or& webError)
14 { 14 {
15 switch (*webError) { 15 switch (webError) {
16 #define MAP_ERROR(enumeration, name, message) \ 16 #define MAP_ERROR(enumeration, name, message) \
17 case WebBluetoothError::enumeration: \ 17 case WebBluetoothError::enumeration: \
18 return DOMException::create(name, message) 18 return DOMException::create(name, message)
19 19
20 // InvalidModificationErrors: 20 // InvalidModificationErrors:
21 MAP_ERROR(GATTInvalidAttributeLength, InvalidModificationError, "GATT Er ror: invalid attribute length."); 21 MAP_ERROR(GATTInvalidAttributeLength, InvalidModificationError, "GATT Er ror: invalid attribute length.");
22 22
23 // InvalidStateErrors: 23 // InvalidStateErrors:
24 MAP_ERROR(ServiceNoLongerExists, InvalidStateError, "GATT Service no lon ger exists."); 24 MAP_ERROR(ServiceNoLongerExists, InvalidStateError, "GATT Service no lon ger exists.");
25 MAP_ERROR(CharacteristicNoLongerExists, InvalidStateError, "GATT Charact eristic no longer exists."); 25 MAP_ERROR(CharacteristicNoLongerExists, InvalidStateError, "GATT Charact eristic no longer exists.");
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t he requestDevice() dialog."); 58 MAP_ERROR(RequestDeviceWithoutFrame, SecurityError, "No window to show t he requestDevice() dialog.");
59 59
60 #undef MAP_ERROR 60 #undef MAP_ERROR
61 } 61 }
62 62
63 ASSERT_NOT_REACHED(); 63 ASSERT_NOT_REACHED();
64 return DOMException::create(UnknownError); 64 return DOMException::create(UnknownError);
65 } 65 }
66 66
67 } // namespace blink 67 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/bluetooth/BluetoothError.h ('k') | Source/modules/bluetooth/ConvertWebVectorToArrayBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698