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

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

Issue 2459523002: bluetooth: Return specific error if getPrimaryServices() is called without requesting access to any… (Closed)
Patch Set: s/foo/TestName/ Created 4 years, 1 month 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 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 "modules/bluetooth/BluetoothError.h" 5 #include "modules/bluetooth/BluetoothError.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj om-blink.h" 9 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj om-blink.h"
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 "GATT operation not authorized."); 114 "GATT operation not authorized.");
115 MAP_ERROR(BLACKLISTED_CHARACTERISTIC_UUID, SecurityError, 115 MAP_ERROR(BLACKLISTED_CHARACTERISTIC_UUID, SecurityError,
116 "getCharacteristic(s) called with blacklisted UUID. " 116 "getCharacteristic(s) called with blacklisted UUID. "
117 "https://goo.gl/4NeimX"); 117 "https://goo.gl/4NeimX");
118 MAP_ERROR(BLACKLISTED_READ, SecurityError, 118 MAP_ERROR(BLACKLISTED_READ, SecurityError,
119 "readValue() called on blacklisted object marked " 119 "readValue() called on blacklisted object marked "
120 "exclude-reads. https://goo.gl/4NeimX"); 120 "exclude-reads. https://goo.gl/4NeimX");
121 MAP_ERROR(BLACKLISTED_WRITE, SecurityError, 121 MAP_ERROR(BLACKLISTED_WRITE, SecurityError,
122 "writeValue() called on blacklisted object marked " 122 "writeValue() called on blacklisted object marked "
123 "exclude-writes. https://goo.gl/4NeimX"); 123 "exclude-writes. https://goo.gl/4NeimX");
124 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, SecurityError,
125 "Origin is not allowed to access any service. Tip: Add the "
126 "service UUID to 'optionalServices' in requestDevice() "
127 "options. https://goo.gl/HxfxSQ");
124 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError, 128 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError,
125 "Origin is not allowed to access the service. Tip: Add the " 129 "Origin is not allowed to access the service. Tip: Add the "
126 "service UUID to 'optionalServices' in requestDevice() " 130 "service UUID to 'optionalServices' in requestDevice() "
127 "options. https://goo.gl/HxfxSQ"); 131 "options. https://goo.gl/HxfxSQ");
128 MAP_ERROR(REQUEST_DEVICE_WITH_BLACKLISTED_UUID, SecurityError, 132 MAP_ERROR(REQUEST_DEVICE_WITH_BLACKLISTED_UUID, SecurityError,
129 "requestDevice() called with a filter containing a blacklisted " 133 "requestDevice() called with a filter containing a blacklisted "
130 "UUID. https://goo.gl/4NeimX"); 134 "UUID. https://goo.gl/4NeimX");
131 MAP_ERROR(REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, SecurityError, 135 MAP_ERROR(REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, SecurityError,
132 "requestDevice() called from cross-origin iframe."); 136 "requestDevice() called from cross-origin iframe.");
133 MAP_ERROR(REQUEST_DEVICE_WITHOUT_FRAME, SecurityError, 137 MAP_ERROR(REQUEST_DEVICE_WITHOUT_FRAME, SecurityError,
134 "No window to show the requestDevice() dialog."); 138 "No window to show the requestDevice() dialog.");
135 139
136 #undef MAP_ERROR 140 #undef MAP_ERROR
137 } 141 }
138 142
139 ASSERT_NOT_REACHED(); 143 ASSERT_NOT_REACHED();
140 return DOMException::create(UnknownError); 144 return DOMException::create(UnknownError);
141 } 145 }
142 146
143 } // namespace blink 147 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698