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

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

Issue 2384463002: bluetooth: mac: Reject requestDevice promise if Mac version is <= 10.9 (Closed)
Patch Set: Created 4 years, 2 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 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 MAP_ERROR(NO_BLUETOOTH_ADAPTER, NotFoundError, "Bluetooth adapter not av ailable."); 53 MAP_ERROR(NO_BLUETOOTH_ADAPTER, NotFoundError, "Bluetooth adapter not av ailable.");
54 MAP_ERROR(CHOSEN_DEVICE_VANISHED, NotFoundError, "User selected a device that doesn't exist anymore."); 54 MAP_ERROR(CHOSEN_DEVICE_VANISHED, NotFoundError, "User selected a device that doesn't exist anymore.");
55 MAP_ERROR(CHOOSER_CANCELLED, NotFoundError, "User cancelled the requestD evice() chooser."); 55 MAP_ERROR(CHOOSER_CANCELLED, NotFoundError, "User cancelled the requestD evice() chooser.");
56 MAP_ERROR(CHOOSER_NOT_SHOWN_API_GLOBALLY_DISABLED, NotFoundError, "Web B luetooth API globally disabled."); 56 MAP_ERROR(CHOOSER_NOT_SHOWN_API_GLOBALLY_DISABLED, NotFoundError, "Web B luetooth API globally disabled.");
57 MAP_ERROR(CHOOSER_NOT_SHOWN_API_LOCALLY_DISABLED, NotFoundError, "User o r their enterprise policy has disabled Web Bluetooth."); 57 MAP_ERROR(CHOOSER_NOT_SHOWN_API_LOCALLY_DISABLED, NotFoundError, "User o r their enterprise policy has disabled Web Bluetooth.");
58 MAP_ERROR(CHOOSER_NOT_SHOWN_USER_DENIED_PERMISSION_TO_SCAN, NotFoundErro r, "User denied the browser permission to scan for Bluetooth devices."); 58 MAP_ERROR(CHOOSER_NOT_SHOWN_USER_DENIED_PERMISSION_TO_SCAN, NotFoundErro r, "User denied the browser permission to scan for Bluetooth devices.");
59 MAP_ERROR(SERVICE_NOT_FOUND, NotFoundError, "No Services with specified UUID found in Device."); 59 MAP_ERROR(SERVICE_NOT_FOUND, NotFoundError, "No Services with specified UUID found in Device.");
60 MAP_ERROR(NO_SERVICES_FOUND, NotFoundError, "No Services found in device ."); 60 MAP_ERROR(NO_SERVICES_FOUND, NotFoundError, "No Services found in device .");
61 MAP_ERROR(CHARACTERISTIC_NOT_FOUND, NotFoundError, "No Characteristics w ith specified UUID found in Service."); 61 MAP_ERROR(CHARACTERISTIC_NOT_FOUND, NotFoundError, "No Characteristics w ith specified UUID found in Service.");
62 MAP_ERROR(NO_CHARACTERISTICS_FOUND, NotFoundError, "No Characteristics f ound in service."); 62 MAP_ERROR(NO_CHARACTERISTICS_FOUND, NotFoundError, "No Characteristics f ound in service.");
63 MAP_ERROR(BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, NotFoundError, "Bluetooth Low Energy not available.");
63 64
64 // NotSupportedErrors: 65 // NotSupportedErrors:
65 MAP_ERROR(GATT_UNKNOWN_ERROR, NotSupportedError, "GATT Error Unknown."); 66 MAP_ERROR(GATT_UNKNOWN_ERROR, NotSupportedError, "GATT Error Unknown.");
66 MAP_ERROR(GATT_UNKNOWN_FAILURE, NotSupportedError, "GATT operation faile d for unknown reason."); 67 MAP_ERROR(GATT_UNKNOWN_FAILURE, NotSupportedError, "GATT operation faile d for unknown reason.");
67 MAP_ERROR(GATT_NOT_PERMITTED, NotSupportedError, "GATT operation not per mitted."); 68 MAP_ERROR(GATT_NOT_PERMITTED, NotSupportedError, "GATT operation not per mitted.");
68 MAP_ERROR(GATT_NOT_SUPPORTED, NotSupportedError, "GATT Error: Not suppor ted."); 69 MAP_ERROR(GATT_NOT_SUPPORTED, NotSupportedError, "GATT Error: Not suppor ted.");
69 MAP_ERROR(GATT_UNTRANSLATED_ERROR_CODE, NotSupportedError, "GATT Error: Unknown GattErrorCode."); 70 MAP_ERROR(GATT_UNTRANSLATED_ERROR_CODE, NotSupportedError, "GATT Error: Unknown GattErrorCode.");
70 71
71 // SecurityErrors: 72 // SecurityErrors:
72 MAP_ERROR(GATT_NOT_AUTHORIZED, SecurityError, "GATT operation not author ized."); 73 MAP_ERROR(GATT_NOT_AUTHORIZED, SecurityError, "GATT operation not author ized.");
73 MAP_ERROR(BLACKLISTED_CHARACTERISTIC_UUID, SecurityError, "getCharacteri stic(s) called with blacklisted UUID. https://goo.gl/4NeimX"); 74 MAP_ERROR(BLACKLISTED_CHARACTERISTIC_UUID, SecurityError, "getCharacteri stic(s) called with blacklisted UUID. https://goo.gl/4NeimX");
74 MAP_ERROR(BLACKLISTED_READ, SecurityError, "readValue() called on blackl isted object marked exclude-reads. https://goo.gl/4NeimX"); 75 MAP_ERROR(BLACKLISTED_READ, SecurityError, "readValue() called on blackl isted object marked exclude-reads. https://goo.gl/4NeimX");
75 MAP_ERROR(BLACKLISTED_WRITE, SecurityError, "writeValue() called on blac klisted object marked exclude-writes. https://goo.gl/4NeimX"); 76 MAP_ERROR(BLACKLISTED_WRITE, SecurityError, "writeValue() called on blac klisted object marked exclude-writes. https://goo.gl/4NeimX");
76 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError, "Origin is not a llowed to access the service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options. https://goo.gl/HxfxSQ"); 77 MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError, "Origin is not a llowed to access the service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options. https://goo.gl/HxfxSQ");
77 MAP_ERROR(REQUEST_DEVICE_WITH_BLACKLISTED_UUID, SecurityError, "requestD evice() called with a filter containing a blacklisted UUID. https://goo.gl/4Neim X"); 78 MAP_ERROR(REQUEST_DEVICE_WITH_BLACKLISTED_UUID, SecurityError, "requestD evice() called with a filter containing a blacklisted UUID. https://goo.gl/4Neim X");
78 MAP_ERROR(REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, SecurityError, "reque stDevice() called from cross-origin iframe."); 79 MAP_ERROR(REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, SecurityError, "reque stDevice() called from cross-origin iframe.");
79 MAP_ERROR(REQUEST_DEVICE_WITHOUT_FRAME, SecurityError, "No window to sho w the requestDevice() dialog."); 80 MAP_ERROR(REQUEST_DEVICE_WITHOUT_FRAME, SecurityError, "No window to sho w the requestDevice() dialog.");
80 81
81 #undef MAP_ERROR 82 #undef MAP_ERROR
82 } 83 }
83 84
84 ASSERT_NOT_REACHED(); 85 ASSERT_NOT_REACHED();
85 return DOMException::create(UnknownError); 86 return DOMException::create(UnknownError);
86 } 87 }
87 88
88 } // namespace blink 89 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698