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

Side by Side Diff: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h

Issue 2727683003: bluetooth: Clean up connection errors (Closed)
Patch Set: merge Created 3 years, 9 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 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R OUTER_H_ 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R OUTER_H_
6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R OUTER_H_ 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVENT_R OUTER_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <cstdint> 9 #include <cstdint>
10 #include <map> 10 #include <map>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 }; 83 };
84 84
85 explicit BluetoothLowEnergyEventRouter(content::BrowserContext* context); 85 explicit BluetoothLowEnergyEventRouter(content::BrowserContext* context);
86 ~BluetoothLowEnergyEventRouter() override; 86 ~BluetoothLowEnergyEventRouter() override;
87 87
88 // Possible ways that an API method can fail or succeed. 88 // Possible ways that an API method can fail or succeed.
89 enum Status { 89 enum Status {
90 kStatusSuccess = 0, 90 kStatusSuccess = 0,
91 kStatusErrorAlreadyConnected, 91 kStatusErrorAlreadyConnected,
92 kStatusErrorAlreadyNotifying, 92 kStatusErrorAlreadyNotifying,
93 kStatusErrorAttributeLengthInvalid,
94 kStatusErrorAuthenticationFailed, 93 kStatusErrorAuthenticationFailed,
95 kStatusErrorCanceled, 94 kStatusErrorCanceled,
96 kStatusErrorConnectionCongested,
97 kStatusErrorFailed, 95 kStatusErrorFailed,
98 kStatusErrorGattNotSupported, 96 kStatusErrorGattNotSupported,
99 kStatusErrorHigherSecurity, 97 kStatusErrorHigherSecurity,
100 kStatusErrorInProgress, 98 kStatusErrorInProgress,
101 kStatusErrorInsufficientAuthorization, 99 kStatusErrorInsufficientAuthorization,
102 kStatusErrorInsufficientEncryption,
103 kStatusErrorInvalidArguments, 100 kStatusErrorInvalidArguments,
104 kStatusErrorInvalidLength, 101 kStatusErrorInvalidLength,
105 kStatusErrorNotConnected, 102 kStatusErrorNotConnected,
106 kStatusErrorNotFound, 103 kStatusErrorNotFound,
107 kStatusErrorNotNotifying, 104 kStatusErrorNotNotifying,
108 kStatusErrorOffsetInvalid,
109 kStatusErrorPermissionDenied, 105 kStatusErrorPermissionDenied,
110 kStatusErrorRequestNotSupported,
111 kStatusErrorTimeout, 106 kStatusErrorTimeout,
112 kStatusErrorUnsupportedDevice, 107 kStatusErrorUnsupportedDevice,
113 kStatusErrorInvalidServiceId, 108 kStatusErrorInvalidServiceId,
114 }; 109 };
115 110
116 // Error callback is used by asynchronous methods to report failures. 111 // Error callback is used by asynchronous methods to report failures.
117 using ErrorCallback = base::Callback<void(Status)>; 112 using ErrorCallback = base::Callback<void(Status)>;
118 113
119 // Returns true if Bluetooth is supported on the current platform or if the 114 // Returns true if Bluetooth is supported on the current platform or if the
120 // internal |adapter_| instance has been initialized for testing. 115 // internal |adapter_| instance has been initialized for testing.
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 // Note: This should remain the last member so it'll be destroyed and 574 // Note: This should remain the last member so it'll be destroyed and
580 // invalidate its weak pointers before any other members are destroyed. 575 // invalidate its weak pointers before any other members are destroyed.
581 base::WeakPtrFactory<BluetoothLowEnergyEventRouter> weak_ptr_factory_; 576 base::WeakPtrFactory<BluetoothLowEnergyEventRouter> weak_ptr_factory_;
582 577
583 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyEventRouter); 578 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyEventRouter);
584 }; 579 };
585 580
586 } // namespace extensions 581 } // namespace extensions
587 582
588 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVEN T_ROUTER_H_ 583 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_EVEN T_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698