summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
authorscheib <scheib@chromium.org>2014-12-05 10:32:32 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-05 18:32:51 +0000
commitff6eaf5adf4d6dc5a748e2ee4e8de080655d1975 (patch)
tree0e8179200f9330b47671f1243d3c9344239ac248 /device
parent74be87a0ec9dbfcd7ee9021e68ec2ce4cda442e7 (diff)
downloadchromium_src-ff6eaf5adf4d6dc5a748e2ee4e8de080655d1975.zip
chromium_src-ff6eaf5adf4d6dc5a748e2ee4e8de080655d1975.tar.gz
chromium_src-ff6eaf5adf4d6dc5a748e2ee4e8de080655d1975.tar.bz2
bluetooth: Make device/bluetooth a shared library component.
device/bluetooth will soon be accessed by content/browser. This change converts it from a static library to a shared component. BUG=438305 Review URL: https://codereview.chromium.org/778443002 Cr-Commit-Position: refs/heads/master@{#307049}
Diffstat (limited to 'device')
-rw-r--r--device/bluetooth/BUILD.gn6
-rw-r--r--device/bluetooth/bluetooth.gyp5
-rw-r--r--device/bluetooth/bluetooth_adapter.h6
-rw-r--r--device/bluetooth/bluetooth_adapter_chromeos.h3
-rw-r--r--device/bluetooth/bluetooth_adapter_factory.h3
-rw-r--r--device/bluetooth/bluetooth_adapter_mac.h6
-rw-r--r--device/bluetooth/bluetooth_adapter_win.h6
-rw-r--r--device/bluetooth/bluetooth_device.h3
-rw-r--r--device/bluetooth/bluetooth_device_chromeos.h3
-rw-r--r--device/bluetooth/bluetooth_device_win.h3
-rw-r--r--device/bluetooth/bluetooth_discovery_session.h3
-rw-r--r--device/bluetooth/bluetooth_export.h28
-rw-r--r--device/bluetooth/bluetooth_gatt_characteristic.h3
-rw-r--r--device/bluetooth/bluetooth_gatt_connection.h3
-rw-r--r--device/bluetooth/bluetooth_gatt_descriptor.h3
-rw-r--r--device/bluetooth/bluetooth_gatt_notify_session.h3
-rw-r--r--device/bluetooth/bluetooth_gatt_service.h3
-rw-r--r--device/bluetooth/bluetooth_init_win.h4
-rw-r--r--device/bluetooth/bluetooth_low_energy_win.h8
-rw-r--r--device/bluetooth/bluetooth_service_record_win.h3
-rw-r--r--device/bluetooth/bluetooth_socket.h4
-rw-r--r--device/bluetooth/bluetooth_socket_thread.h3
-rw-r--r--device/bluetooth/bluetooth_task_manager_win.h11
-rw-r--r--device/bluetooth/bluetooth_uuid.h7
24 files changed, 97 insertions, 33 deletions
diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn
index 28f9478..397e377 100644
--- a/device/bluetooth/BUILD.gn
+++ b/device/bluetooth/BUILD.gn
@@ -15,7 +15,7 @@ config("bluetooth_config") {
}
}
-static_library("bluetooth") {
+component("bluetooth") {
sources = [
"bluetooth_adapter.cc",
"bluetooth_adapter.h",
@@ -91,6 +91,10 @@ static_library("bluetooth") {
"bluetooth_uuid.h",
]
+ defines = [
+ "DEVICE_BLUETOOTH_IMPLEMENTATION",
+ ]
+
all_dependent_configs = [ ":bluetooth_config" ]
deps = [
diff --git a/device/bluetooth/bluetooth.gyp b/device/bluetooth/bluetooth.gyp
index d6b8c7e..328ccd6 100644
--- a/device/bluetooth/bluetooth.gyp
+++ b/device/bluetooth/bluetooth.gyp
@@ -10,13 +10,16 @@
{
# GN version: //device/bluetooth
'target_name': 'device_bluetooth',
- 'type': 'static_library',
+ 'type': '<(component)',
'dependencies': [
'../../base/base.gyp:base',
'../../net/net.gyp:net',
'../../ui/base/ui_base.gyp:ui_base',
'bluetooth_strings.gyp:device_bluetooth_strings',
],
+ 'defines': [
+ 'DEVICE_BLUETOOTH_IMPLEMENTATION',
+ ],
'sources': [
# Note: file list duplicated in GN build.
'bluetooth_adapter.cc',
diff --git a/device/bluetooth/bluetooth_adapter.h b/device/bluetooth/bluetooth_adapter.h
index f306768..6c70fdf 100644
--- a/device/bluetooth/bluetooth_adapter.h
+++ b/device/bluetooth/bluetooth_adapter.h
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
@@ -31,7 +32,8 @@ class BluetoothUUID;
// this class also provides support for obtaining the list of remote devices
// known to the adapter, discovering new devices, and providing notification of
// updates to device information.
-class BluetoothAdapter : public base::RefCounted<BluetoothAdapter> {
+class DEVICE_BLUETOOTH_EXPORT BluetoothAdapter
+ : public base::RefCounted<BluetoothAdapter> {
public:
// Interface for observing changes from bluetooth adapters.
class Observer {
@@ -158,7 +160,7 @@ class BluetoothAdapter : public base::RefCounted<BluetoothAdapter> {
};
// Used to configure a listening servie.
- struct ServiceOptions {
+ struct DEVICE_BLUETOOTH_EXPORT ServiceOptions {
ServiceOptions();
~ServiceOptions();
diff --git a/device/bluetooth/bluetooth_adapter_chromeos.h b/device/bluetooth/bluetooth_adapter_chromeos.h
index bd9ec9e..30deae6 100644
--- a/device/bluetooth/bluetooth_adapter_chromeos.h
+++ b/device/bluetooth/bluetooth_adapter_chromeos.h
@@ -17,6 +17,7 @@
#include "dbus/object_path.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
class BluetoothSocketThread;
@@ -33,7 +34,7 @@ class BluetoothRemoteGattServiceChromeOS;
// The BluetoothAdapterChromeOS class implements BluetoothAdapter for the
// Chrome OS platform.
-class BluetoothAdapterChromeOS
+class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterChromeOS
: public device::BluetoothAdapter,
public chromeos::BluetoothAdapterClient::Observer,
public chromeos::BluetoothDeviceClient::Observer,
diff --git a/device/bluetooth/bluetooth_adapter_factory.h b/device/bluetooth/bluetooth_adapter_factory.h
index 0e61a2c..9b98a21 100644
--- a/device/bluetooth/bluetooth_adapter_factory.h
+++ b/device/bluetooth/bluetooth_adapter_factory.h
@@ -8,12 +8,13 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
// A factory class for building a Bluetooth adapter on platforms where Bluetooth
// is available.
-class BluetoothAdapterFactory {
+class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterFactory {
public:
typedef base::Callback<void(scoped_refptr<BluetoothAdapter> adapter)>
AdapterCallback;
diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h
index 38002eb..a20bea7 100644
--- a/device/bluetooth/bluetooth_adapter_mac.h
+++ b/device/bluetooth/bluetooth_adapter_mac.h
@@ -17,6 +17,7 @@
#include "base/observer_list.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_discovery_manager_mac.h"
+#include "device/bluetooth/bluetooth_export.h"
@class IOBluetoothDevice;
@class NSArray;
@@ -32,8 +33,9 @@ namespace device {
class BluetoothAdapterMacTest;
-class BluetoothAdapterMac : public BluetoothAdapter,
- public BluetoothDiscoveryManagerMac::Observer {
+class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
+ : public BluetoothAdapter,
+ public BluetoothDiscoveryManagerMac::Observer {
public:
static base::WeakPtr<BluetoothAdapter> CreateAdapter();
diff --git a/device/bluetooth/bluetooth_adapter_win.h b/device/bluetooth/bluetooth_adapter_win.h
index 6d62d2e..7d19125 100644
--- a/device/bluetooth/bluetooth_adapter_win.h
+++ b/device/bluetooth/bluetooth_adapter_win.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_task_manager_win.h"
namespace base {
@@ -28,8 +29,9 @@ class BluetoothAdapterWinTest;
class BluetoothDevice;
class BluetoothSocketThread;
-class BluetoothAdapterWin : public BluetoothAdapter,
- public BluetoothTaskManagerWin::Observer {
+class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterWin
+ : public BluetoothAdapter,
+ public BluetoothTaskManagerWin::Observer {
public:
static base::WeakPtr<BluetoothAdapter> CreateAdapter(
const InitCallback& init_callback);
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 3c273ff..0234f17 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_uuid.h"
#include "net/base/net_log.h"
@@ -34,7 +35,7 @@ class BluetoothUUID;
// Since the lifecycle of BluetoothDevice instances is managed by
// BluetoothAdapter, that class rather than this provides observer methods
// for devices coming and going, as well as properties being updated.
-class BluetoothDevice {
+class DEVICE_BLUETOOTH_EXPORT BluetoothDevice {
public:
// Possible values that may be returned by GetVendorIDSource(),
// indicating different organisations that allocate the identifiers returned
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_chromeos.h
index 644bc26e..8e91cd7 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_chromeos.h
@@ -15,6 +15,7 @@
#include "chromeos/dbus/bluetooth_gatt_service_client.h"
#include "dbus/object_path.h"
#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
class BluetoothSocketThread;
@@ -27,7 +28,7 @@ class BluetoothPairingChromeOS;
// The BluetoothDeviceChromeOS class implements BluetoothDevice for the
// Chrome OS platform.
-class BluetoothDeviceChromeOS
+class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceChromeOS
: public device::BluetoothDevice,
public BluetoothGattServiceClient::Observer {
public:
diff --git a/device/bluetooth/bluetooth_device_win.h b/device/bluetooth/bluetooth_device_win.h
index afa5450..6394cfa 100644
--- a/device/bluetooth/bluetooth_device_win.h
+++ b/device/bluetooth/bluetooth_device_win.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/observer_list.h"
#include "device/bluetooth/bluetooth_device.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_task_manager_win.h"
namespace device {
@@ -19,7 +20,7 @@ class BluetoothAdapterWin;
class BluetoothServiceRecordWin;
class BluetoothSocketThread;
-class BluetoothDeviceWin : public BluetoothDevice {
+class DEVICE_BLUETOOTH_EXPORT BluetoothDeviceWin : public BluetoothDevice {
public:
explicit BluetoothDeviceWin(
const BluetoothTaskManagerWin::DeviceState& device_state,
diff --git a/device/bluetooth/bluetooth_discovery_session.h b/device/bluetooth/bluetooth_discovery_session.h
index 08a1de8..2dae0de 100644
--- a/device/bluetooth/bluetooth_discovery_session.h
+++ b/device/bluetooth/bluetooth_discovery_session.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
@@ -25,7 +26,7 @@ class BluetoothAdapter;
// AdapterDiscoveringChanged method of the BluetoothAdapter::Observer interface
// to be notified of such a change and promptly request a new
// BluetoothDiscoverySession if their existing sessions have become inactive.
-class BluetoothDiscoverySession {
+class DEVICE_BLUETOOTH_EXPORT BluetoothDiscoverySession {
public:
// The ErrorCallback is used by methods to asynchronously report errors.
typedef base::Closure ErrorCallback;
diff --git a/device/bluetooth/bluetooth_export.h b/device/bluetooth/bluetooth_export.h
new file mode 100644
index 0000000..90cc58c
--- /dev/null
+++ b/device/bluetooth/bluetooth_export.h
@@ -0,0 +1,28 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_BLUETOOTH_DEVICE_BLUETOOTH_EXPORT_H_
+#define DEVICE_BLUETOOTH_DEVICE_BLUETOOTH_EXPORT_H_
+
+#if defined(COMPONENT_BUILD) && defined(WIN32)
+
+#if defined(DEVICE_BLUETOOTH_IMPLEMENTATION)
+#define DEVICE_BLUETOOTH_EXPORT __declspec(dllexport)
+#else
+#define DEVICE_BLUETOOTH_EXPORT __declspec(dllimport)
+#endif
+
+#elif defined(COMPONENT_BUILD) && !defined(WIN32)
+
+#if defined(DEVICE_BLUETOOTH_IMPLEMENTATION)
+#define DEVICE_BLUETOOTH_EXPORT __attribute__((visibility("default")))
+#else
+#define DEVICE_BLUETOOTH_EXPORT
+#endif
+
+#else
+#define DEVICE_BLUETOOTH_EXPORT
+#endif
+
+#endif // DEVICE_BLUETOOTH_DEVICE_BLUETOOTH_EXPORT_H_
diff --git a/device/bluetooth/bluetooth_gatt_characteristic.h b/device/bluetooth/bluetooth_gatt_characteristic.h
index f67e0a7..f3a36e8 100644
--- a/device/bluetooth/bluetooth_gatt_characteristic.h
+++ b/device/bluetooth/bluetooth_gatt_characteristic.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_gatt_service.h"
#include "device/bluetooth/bluetooth_uuid.h"
@@ -31,7 +32,7 @@ class BluetoothGattNotifySession;
// service. To achieve this, users can construct instances of
// BluetoothGattCharacteristic directly and add it to the desired
// BluetoothGattService instance that represents a local service.
-class BluetoothGattCharacteristic {
+class DEVICE_BLUETOOTH_EXPORT BluetoothGattCharacteristic {
public:
// Values representing the possible properties of a characteristic, which
// define how the characteristic can be used. Each of these properties serve
diff --git a/device/bluetooth/bluetooth_gatt_connection.h b/device/bluetooth/bluetooth_gatt_connection.h
index da63043..81e1c8e 100644
--- a/device/bluetooth/bluetooth_gatt_connection.h
+++ b/device/bluetooth/bluetooth_gatt_connection.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/callback.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
@@ -17,7 +18,7 @@ namespace device {
// active BluetoothGattConnection object. BluetoothGattConnection objects
// automatically update themselves, when the connection is terminated by the
// operating system (e.g. due to user action).
-class BluetoothGattConnection {
+class DEVICE_BLUETOOTH_EXPORT BluetoothGattConnection {
public:
// Destructor automatically closes this GATT connection. If this is the last
// remaining GATT connection and this results in a call to the OS, that call
diff --git a/device/bluetooth/bluetooth_gatt_descriptor.h b/device/bluetooth/bluetooth_gatt_descriptor.h
index 4e2ee9c..442a6ae 100644
--- a/device/bluetooth/bluetooth_gatt_descriptor.h
+++ b/device/bluetooth/bluetooth_gatt_descriptor.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_gatt_characteristic.h"
#include "device/bluetooth/bluetooth_uuid.h"
@@ -18,7 +19,7 @@ namespace device {
// descriptor. A GATT characteristic descriptor provides further information
// about a characteristic's value. They can be used to describe the
// characteristic's features or to control certain behaviors.
-class BluetoothGattDescriptor {
+class DEVICE_BLUETOOTH_EXPORT BluetoothGattDescriptor {
public:
// The Bluetooth Specification declares several predefined descriptors that
// profiles can use. The following are definitions for the list of UUIDs
diff --git a/device/bluetooth/bluetooth_gatt_notify_session.h b/device/bluetooth/bluetooth_gatt_notify_session.h
index 929656a..4c63563 100644
--- a/device/bluetooth/bluetooth_gatt_notify_session.h
+++ b/device/bluetooth/bluetooth_gatt_notify_session.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/callback.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace device {
@@ -15,7 +16,7 @@ namespace device {
// to value updates from GATT characteristics that support notifications and/or
// indications. Instances are obtained by calling
// BluetoothGattCharacteristic::StartNotifySession.
-class BluetoothGattNotifySession {
+class DEVICE_BLUETOOTH_EXPORT BluetoothGattNotifySession {
public:
// Destructor automatically stops this session.
virtual ~BluetoothGattNotifySession();
diff --git a/device/bluetooth/bluetooth_gatt_service.h b/device/bluetooth/bluetooth_gatt_service.h
index 877cab5..58464fc 100644
--- a/device/bluetooth/bluetooth_gatt_service.h
+++ b/device/bluetooth/bluetooth_gatt_service.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_uuid.h"
namespace device {
@@ -31,7 +32,7 @@ class BluetoothGattDescriptor;
// adapter is used in the "peripheral" role. Such instances are meant to be
// constructed directly and registered. Once registered, a GATT attribute
// hierarchy will be visible to remote devices in the "central" role.
-class BluetoothGattService {
+class DEVICE_BLUETOOTH_EXPORT BluetoothGattService {
public:
// The Delegate class is used to send certain events that need to be handled
// when the device is in peripheral mode. The delegate handles read and write
diff --git a/device/bluetooth/bluetooth_init_win.h b/device/bluetooth/bluetooth_init_win.h
index 57fe5d7..ac8f7f0 100644
--- a/device/bluetooth/bluetooth_init_win.h
+++ b/device/bluetooth/bluetooth_init_win.h
@@ -17,6 +17,8 @@
#include <ws2def.h>
#include <ws2bth.h>
+#include "device/bluetooth/bluetooth_export.h"
+
#pragma comment(lib, "Bthprops.lib")
#pragma comment(lib, "BluetoothApis.lib")
@@ -26,7 +28,7 @@ namespace bluetooth_init_win {
// Returns true if the machine has a bluetooth stack available. The first call
// to this function will involve file IO, so it should be done on an appropriate
// thread. This function is not thread-safe.
-bool HasBluetoothStack();
+bool DEVICE_BLUETOOTH_EXPORT HasBluetoothStack();
} // namespace bluetooth_init_win
} // namespace device
diff --git a/device/bluetooth/bluetooth_low_energy_win.h b/device/bluetooth/bluetooth_low_energy_win.h
index 92834eb..f9873225 100644
--- a/device/bluetooth/bluetooth_low_energy_win.h
+++ b/device/bluetooth/bluetooth_low_energy_win.h
@@ -9,13 +9,14 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/win/scoped_handle.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_low_energy_defs_win.h"
namespace device {
namespace win {
// Represents a device registry property value
-class DeviceRegistryPropertyValue {
+class DEVICE_BLUETOOTH_EXPORT DeviceRegistryPropertyValue {
public:
// Creates a property value instance, where |property_type| is one of REG_xxx
// registry value type (e.g. REG_SZ, REG_DWORD), |value| is a byte array
@@ -47,7 +48,7 @@ class DeviceRegistryPropertyValue {
};
// Represents the value associated to a DEVPROPKEY.
-class DevicePropertyValue {
+class DEVICE_BLUETOOTH_EXPORT DevicePropertyValue {
public:
// Creates a property value instance, where |property_type| is one of
// DEVPROP_TYPE_xxx value type , |value| is a byte array containing the
@@ -111,7 +112,8 @@ bool EnumerateKnownBluetoothLowEnergyServices(
ScopedVector<BluetoothLowEnergyServiceInfo>* services,
std::string* error);
-bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting(
+bool DEVICE_BLUETOOTH_EXPORT
+ExtractBluetoothAddressFromDeviceInstanceIdForTesting(
const std::string& instance_id,
BLUETOOTH_ADDRESS* btha,
std::string* error);
diff --git a/device/bluetooth/bluetooth_service_record_win.h b/device/bluetooth/bluetooth_service_record_win.h
index 9612c9d..cedc67e 100644
--- a/device/bluetooth/bluetooth_service_record_win.h
+++ b/device/bluetooth/bluetooth_service_record_win.h
@@ -9,12 +9,13 @@
#include <vector>
#include "base/basictypes.h"
+#include "device/bluetooth/bluetooth_export.h"
#include "device/bluetooth/bluetooth_init_win.h"
#include "device/bluetooth/bluetooth_uuid.h"
namespace device {
-class BluetoothServiceRecordWin {
+class DEVICE_BLUETOOTH_EXPORT BluetoothServiceRecordWin {
public:
BluetoothServiceRecordWin(const std::string& device_address,
const std::string& name,
diff --git a/device/bluetooth/bluetooth_socket.h b/device/bluetooth/bluetooth_socket.h
index 66d4480..395c7cb 100644
--- a/device/bluetooth/bluetooth_socket.h
+++ b/device/bluetooth/bluetooth_socket.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace net {
class IOBuffer;
@@ -27,7 +28,8 @@ class BluetoothUUID;
// various instance methods on the same thread as the thread used at
// construction time -- platform specific implementation are responsible for
// marshalling calls to a different thread if required.
-class BluetoothSocket : public base::RefCountedThreadSafe<BluetoothSocket> {
+class DEVICE_BLUETOOTH_EXPORT BluetoothSocket
+ : public base::RefCountedThreadSafe<BluetoothSocket> {
public:
enum ErrorReason { kSystemError, kIOPending, kDisconnected };
diff --git a/device/bluetooth/bluetooth_socket_thread.h b/device/bluetooth/bluetooth_socket_thread.h
index 02de820..244640f 100644
--- a/device/bluetooth/bluetooth_socket_thread.h
+++ b/device/bluetooth/bluetooth_socket_thread.h
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread_checker.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace base {
class SequencedTaskRunner;
@@ -19,7 +20,7 @@ namespace device {
// Thread abstraction used by |BluetoothSocketChromeOS| and |BluetoothSocketWin|
// to perform IO operations on the underlying platform sockets. An instance of
// this class can be shared by many active sockets.
-class BluetoothSocketThread
+class DEVICE_BLUETOOTH_EXPORT BluetoothSocketThread
: public base::RefCountedThreadSafe<BluetoothSocketThread> {
public:
static scoped_refptr<BluetoothSocketThread> Get();
diff --git a/device/bluetooth/bluetooth_task_manager_win.h b/device/bluetooth/bluetooth_task_manager_win.h
index 2beda13..e8b7ae6 100644
--- a/device/bluetooth/bluetooth_task_manager_win.h
+++ b/device/bluetooth/bluetooth_task_manager_win.h
@@ -14,6 +14,7 @@
#include "base/observer_list.h"
#include "base/win/scoped_handle.h"
#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_export.h"
namespace base {
@@ -32,10 +33,10 @@ namespace device {
// It delegates the blocking Windows API calls to |bluetooth_task_runner_|'s
// message loop, and receives responses via methods like OnAdapterStateChanged
// posted to UI thread.
-class BluetoothTaskManagerWin
+class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
: public base::RefCountedThreadSafe<BluetoothTaskManagerWin> {
public:
- struct AdapterState {
+ struct DEVICE_BLUETOOTH_EXPORT AdapterState {
AdapterState();
~AdapterState();
std::string name;
@@ -43,7 +44,7 @@ class BluetoothTaskManagerWin
bool powered;
};
- struct ServiceRecordState {
+ struct DEVICE_BLUETOOTH_EXPORT ServiceRecordState {
ServiceRecordState();
~ServiceRecordState();
// Properties common to Bluetooth Classic and LE devices.
@@ -54,7 +55,7 @@ class BluetoothTaskManagerWin
BluetoothUUID gatt_uuid;
};
- struct DeviceState {
+ struct DEVICE_BLUETOOTH_EXPORT DeviceState {
DeviceState();
~DeviceState();
@@ -73,7 +74,7 @@ class BluetoothTaskManagerWin
base::FilePath path;
};
- class Observer {
+ class DEVICE_BLUETOOTH_EXPORT Observer {
public:
virtual ~Observer() {}
diff --git a/device/bluetooth/bluetooth_uuid.h b/device/bluetooth/bluetooth_uuid.h
index 5c2fc8a..390d98d 100644
--- a/device/bluetooth/bluetooth_uuid.h
+++ b/device/bluetooth/bluetooth_uuid.h
@@ -7,6 +7,8 @@
#include <string>
+#include "device/bluetooth/bluetooth_export.h"
+
namespace device {
// Opaque wrapper around a Bluetooth UUID. Instances of UUID represent the
@@ -14,7 +16,7 @@ namespace device {
// used in Bluetooth based communication, such as a peripheral's services,
// characteristics, and characteristic descriptors. An instance are
// constructed using a string representing 16, 32, or 128 bit UUID formats.
-class BluetoothUUID {
+class DEVICE_BLUETOOTH_EXPORT BluetoothUUID {
public:
// Possible representation formats used during construction.
enum Format {
@@ -90,7 +92,8 @@ class BluetoothUUID {
};
// This is required by gtest to print a readable output on test failures.
-void PrintTo(const BluetoothUUID& uuid, std::ostream* out);
+void DEVICE_BLUETOOTH_EXPORT
+PrintTo(const BluetoothUUID& uuid, std::ostream* out);
} // namespace device