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

Side by Side Diff: chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h

Issue 1920353002: Implement create attribute API functions for BTLE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api_changes
Patch Set: owners 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 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 CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_ API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_ API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_ API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENERGY_ API_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // ExtensionFunction override. 120 // ExtensionFunction override.
121 ResponseAction Run() override; 121 ResponseAction Run() override;
122 122
123 // Implemented by individual bluetoothLowEnergy extension functions to perform 123 // Implemented by individual bluetoothLowEnergy extension functions to perform
124 // the body of the function. This invoked asynchonously after Run after 124 // the body of the function. This invoked asynchonously after Run after
125 // the BluetoothLowEnergyEventRouter has obtained a handle on the 125 // the BluetoothLowEnergyEventRouter has obtained a handle on the
126 // BluetoothAdapter. 126 // BluetoothAdapter.
127 virtual void DoWork() = 0; 127 virtual void DoWork() = 0;
128 128
129 BluetoothLowEnergyEventRouter* event_router_;
130
129 private: 131 private:
132 // Internal method to do common setup before actual DoWork is called.
133 void PreDoWork();
134
130 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction); 135 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyExtensionFunction);
131 }; 136 };
132 137
133 // Base class for bluetoothLowEnergy API peripheral mode functions. This class 138 // Base class for bluetoothLowEnergy API peripheral mode functions. This class
134 // handles some of the common logic involved in all API peripheral mode 139 // handles some of the common logic involved in all API peripheral mode
135 // functions, such as checking for peripheral permissions and returning the 140 // functions, such as checking for peripheral permissions and returning the
136 // correct error. 141 // correct error.
137 template <typename Params> 142 template <typename Params>
138 class BLEPeripheralExtensionFunction 143 class BLEPeripheralExtensionFunction
139 : public BluetoothLowEnergyExtensionFunction { 144 : public BluetoothLowEnergyExtensionFunction {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 ~BluetoothLowEnergySendRequestResponseFunction() override {} 565 ~BluetoothLowEnergySendRequestResponseFunction() override {}
561 566
562 // BluetoothLowEnergyPeripheralExtensionFunction override. 567 // BluetoothLowEnergyPeripheralExtensionFunction override.
563 void DoWork() override; 568 void DoWork() override;
564 }; 569 };
565 570
566 } // namespace api 571 } // namespace api
567 } // namespace extensions 572 } // namespace extensions
568 573
569 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER GY_API_H_ 574 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_LOW_ENERGY_BLUETOOTH_LOW_ENER GY_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698