Commit 71fd6178 authored by ortuno's avatar ortuno Committed by Commit bot

bluetooth: Add NetworkError for Bluetooth on browser side

Return the NetworkError if the connectGATT fails.

This is the second of two patches to implement NetworkError:
  [1] https://codereview.chromium.org/1124973003
  [2] This patch.

BUG=484779

Review URL: https://codereview.chromium.org/1118053003

Cr-Commit-Position: refs/heads/master@{#329512}
parent 0182b37e
...@@ -39,6 +39,8 @@ int CurrentWorkerId() { ...@@ -39,6 +39,8 @@ int CurrentWorkerId() {
WebBluetoothError::ErrorType WebBluetoothErrorFromBluetoothError( WebBluetoothError::ErrorType WebBluetoothErrorFromBluetoothError(
BluetoothError error_type) { BluetoothError error_type) {
switch (error_type) { switch (error_type) {
case BluetoothError::NETWORK_ERROR:
return WebBluetoothError::NetworkError;
case BluetoothError::NOT_FOUND: case BluetoothError::NOT_FOUND:
return WebBluetoothError::NotFoundError; return WebBluetoothError::NotFoundError;
case BluetoothError::SECURITY: case BluetoothError::SECURITY:
......
...@@ -9,7 +9,12 @@ namespace content { ...@@ -9,7 +9,12 @@ namespace content {
// Error enumerations corresponding to blink::WebBluetoothError::ErrorType // Error enumerations corresponding to blink::WebBluetoothError::ErrorType
// used to create DOMExceptions. // used to create DOMExceptions.
enum class BluetoothError { NOT_FOUND, SECURITY, ENUM_MAX_VALUE = SECURITY }; enum class BluetoothError {
NOT_FOUND,
NETWORK_ERROR,
SECURITY,
ENUM_MAX_VALUE = SECURITY
};
} // namespace content } // namespace content
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment