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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp

Issue 1940923002: bluetooth: Add JS error messages for unimplemented features (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
index 9c7c35de669077161c8e4d9e1d8415d5cfeb0036..67622ae5db1aa808dee473400f90834c24c0c8ed 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
@@ -9,6 +9,7 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
+#include "core/inspector/ConsoleMessage.h"
#include "modules/bluetooth/BluetoothError.h"
#include "modules/bluetooth/BluetoothRemoteGATTService.h"
#include "modules/bluetooth/BluetoothSupplement.h"
@@ -80,6 +81,13 @@ void BluetoothRemoteGATTServer::disconnect(ScriptState* scriptState)
ScriptPromise BluetoothRemoteGATTServer::getPrimaryService(ScriptState* scriptState, const StringOrUnsignedLong& service, ExceptionState& exceptionState)
{
+#if OS(MACOSX)
+ // TODO(jlebel): Remove when getPrimaryService is implemented.
+ return ScriptPromise::rejectWithDOMException(scriptState,
+ DOMException::create(NotSupportedError,
+ "getPrimaryService is not implemented yet. See https://goo.gl/J6ASzs"));
+#endif // OS(MACOSX)
+
WebBluetooth* webbluetooth = BluetoothSupplement::fromScriptState(scriptState);
String serviceUUID = BluetoothUUID::getService(service, exceptionState);

Powered by Google App Engine
This is Rietveld 408576698