| OLD | NEW |
| 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_SOCKET_BLUETOOTH_SOCKET_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ | 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/extensions/api/bluetooth_socket/bluetooth_api_socket.h" | |
| 14 #include "chrome/common/extensions/api/bluetooth_socket.h" | |
| 15 #include "device/bluetooth/bluetooth_adapter.h" | 13 #include "device/bluetooth/bluetooth_adapter.h" |
| 16 #include "extensions/browser/api/api_resource_manager.h" | 14 #include "extensions/browser/api/api_resource_manager.h" |
| 17 #include "extensions/browser/api/async_api_function.h" | 15 #include "extensions/browser/api/async_api_function.h" |
| 16 #include "extensions/browser/api/bluetooth_socket/bluetooth_api_socket.h" |
| 18 #include "extensions/browser/extension_function.h" | 17 #include "extensions/browser/extension_function.h" |
| 19 #include "extensions/browser/extension_function_histogram_value.h" | 18 #include "extensions/browser/extension_function_histogram_value.h" |
| 19 #include "extensions/common/api/bluetooth_socket.h" |
| 20 | 20 |
| 21 namespace device { | 21 namespace device { |
| 22 class BluetoothSocket; | 22 class BluetoothSocket; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 class IOBuffer; | 26 class IOBuffer; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace extensions { | 29 namespace extensions { |
| 30 | 30 |
| 31 namespace api { | 31 namespace core_api { |
| 32 | 32 |
| 33 class BluetoothSocketEventDispatcher; | 33 class BluetoothSocketEventDispatcher; |
| 34 | 34 |
| 35 // Asynchronous API function that performs its work on the BluetoothApiSocket | 35 // Asynchronous API function that performs its work on the BluetoothApiSocket |
| 36 // thread while providing methods to manage resources of that class. This | 36 // thread while providing methods to manage resources of that class. This |
| 37 // follows the pattern of AsyncApiFunction, but does not derive from it, | 37 // follows the pattern of AsyncApiFunction, but does not derive from it, |
| 38 // because BluetoothApiSocket methods must be called on the UI Thread. | 38 // because BluetoothApiSocket methods must be called on the UI Thread. |
| 39 class BluetoothSocketAsyncApiFunction : public AsyncExtensionFunction { | 39 class BluetoothSocketAsyncApiFunction : public AsyncExtensionFunction { |
| 40 public: | 40 public: |
| 41 BluetoothSocketAsyncApiFunction(); | 41 BluetoothSocketAsyncApiFunction(); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 BluetoothSocketGetSocketsFunction(); | 319 BluetoothSocketGetSocketsFunction(); |
| 320 | 320 |
| 321 protected: | 321 protected: |
| 322 virtual ~BluetoothSocketGetSocketsFunction(); | 322 virtual ~BluetoothSocketGetSocketsFunction(); |
| 323 | 323 |
| 324 // BluetoothSocketAsyncApiFunction: | 324 // BluetoothSocketAsyncApiFunction: |
| 325 virtual bool Prepare() OVERRIDE; | 325 virtual bool Prepare() OVERRIDE; |
| 326 virtual void Work() OVERRIDE; | 326 virtual void Work() OVERRIDE; |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 } // namespace api | 329 } // namespace core_api |
| 330 } // namespace extensions | 330 } // namespace extensions |
| 331 | 331 |
| 332 #endif // CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H
_ | 332 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_ |
| OLD | NEW |