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

Unified Diff: device/bluetooth/bluetooth_low_energy_win.h

Issue 376313002: Add unit tests for DeviceRegistryPropertyValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_low_energy_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_low_energy_win.h
diff --git a/device/bluetooth/bluetooth_low_energy_win.h b/device/bluetooth/bluetooth_low_energy_win.h
index 6c997e9317442c8539d137e3fd19ddef488c8f38..c08db21947dcd47f8917543aae55020785ef34e4 100644
--- a/device/bluetooth/bluetooth_low_energy_win.h
+++ b/device/bluetooth/bluetooth_low_energy_win.h
@@ -40,12 +40,44 @@ DEFINE_GUID(GUID_BLUETOOTHLE_DEVICE_INTERFACE,
#include <bluetoothapis.h>
#include "base/files/file_path.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/win/scoped_handle.h"
namespace device {
namespace win {
+// Represents a device registry property value
+class 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
+ // containing the propery value and |value_size| is the number of bytes in
+ // |value|. Note the returned instance takes ownership of |value| array.
+ static scoped_ptr<DeviceRegistryPropertyValue> Create(
+ DWORD property_type,
+ scoped_ptr<uint8_t[]> value,
+ size_t value_size);
+ ~DeviceRegistryPropertyValue();
+
+ // Returns the vaue type a REG_xxx value (e.g. REG_SZ, REG_DWORD, ...)
+ DWORD property_type() const { return property_type_; }
+
+ std::string AsString() const;
+ DWORD AsDWORD() const;
+
+ private:
+ DeviceRegistryPropertyValue(DWORD property_type,
+ scoped_ptr<uint8_t[]> value,
+ size_t value_size);
+
+ DWORD property_type_;
+ scoped_ptr<uint8_t[]> value_;
+ size_t value_size_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeviceRegistryPropertyValue);
+};
+
// Returns true only on Windows platforms supporting Bluetooth Low Energy.
bool IsBluetoothLowEnergySupported();
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_low_energy_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698