Index: components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h |
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection.h b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h |
similarity index 89% |
rename from components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection.h |
rename to components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h |
index 681fe3b14796ee5a4b4d1b5e81b8a0187f6e306e..7aa4360d7860a89acc69e3c6243cca04dbdc3db4 100644 |
--- a/components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection.h |
+++ b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
-#define COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
+#ifndef COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
+#define COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
#include <stddef.h> |
#include <stdint.h> |
@@ -17,11 +17,12 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
#include "base/time/time.h" |
-#include "components/proximity_auth/ble/bluetooth_low_energy_characteristics_finder.h" |
-#include "components/proximity_auth/ble/bluetooth_low_energy_weave_packet_generator.h" |
-#include "components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.h" |
-#include "components/proximity_auth/ble/fake_wire_message.h" |
-#include "components/proximity_auth/ble/remote_attribute.h" |
+#include "components/cryptauth/ble/bluetooth_low_energy_characteristics_finder.h" |
+#include "components/cryptauth/ble/bluetooth_low_energy_weave_packet_generator.h" |
+#include "components/cryptauth/ble/bluetooth_low_energy_weave_packet_receiver.h" |
+#include "components/cryptauth/ble/fake_wire_message.h" |
+#include "components/cryptauth/ble/remote_attribute.h" |
+#include "components/proximity_auth/bluetooth_throttler.h" |
#include "components/proximity_auth/connection.h" |
#include "device/bluetooth/bluetooth_adapter.h" |
#include "device/bluetooth/bluetooth_device.h" |
@@ -33,8 +34,7 @@ namespace base { |
class TaskRunner; |
} |
-namespace proximity_auth { |
-class BluetoothThrottler; |
+namespace cryptauth { |
namespace weave { |
// Creates GATT connection on top of the BLE connection and act as a Client. |
@@ -49,7 +49,7 @@ namespace weave { |
// receive data | receive data |
// opt: close connection | opt: close connection |
class BluetoothLowEnergyWeaveClientConnection |
- : public Connection, |
+ : public proximity_auth::Connection, |
Kyle Horimoto
2016/12/08 21:52:40
//components/cryptauth should not depend on //comp
Ryan Hansberry
2016/12/09 01:18:14
Done.
|
public device::BluetoothAdapter::Observer { |
public: |
class Factory { |
@@ -69,7 +69,7 @@ class BluetoothLowEnergyWeaveClientConnection |
static Factory* factory_instance_; |
}; |
- // The sub-state of a proximity_auth::BluetoothLowEnergyWeaveClientConnection |
+ // The sub-state of a cryptauth::BluetoothLowEnergyWeaveClientConnection |
// extends the IN_PROGRESS state of proximity_auth::Connection::Status. |
enum SubStatus { |
DISCONNECTED, |
@@ -91,12 +91,12 @@ class BluetoothLowEnergyWeaveClientConnection |
const cryptauth::RemoteDevice& remote_device, |
scoped_refptr<device::BluetoothAdapter> adapter, |
const device::BluetoothUUID remote_service_uuid, |
- BluetoothThrottler* bluetooth_throttler, |
+ proximity_auth::BluetoothThrottler* bluetooth_throttler, |
int max_number_of_write_attempts); |
~BluetoothLowEnergyWeaveClientConnection() override; |
- // proximity_auth::Connection: |
+ // namespace cryptauth::Connection: |
void Connect() override; |
void Disconnect() override; |
std::string GetDeviceAddress() override; |
@@ -118,8 +118,9 @@ class BluetoothLowEnergyWeaveClientConnection |
const BluetoothLowEnergyCharacteristicsFinder::ErrorCallback& |
error_callback); |
- // proximity_auth::Connection: |
- void SendMessageImpl(std::unique_ptr<WireMessage> message) override; |
+ // namespace cryptauth::Connection: |
+ void SendMessageImpl( |
+ std::unique_ptr<proximity_auth::WireMessage> message) override; |
// device::BluetoothAdapter::Observer: |
void DeviceChanged(device::BluetoothAdapter* adapter, |
@@ -145,14 +146,14 @@ class BluetoothLowEnergyWeaveClientConnection |
struct WriteRequest { |
WriteRequest(const Packet& val, |
WriteRequestType request_type, |
- std::shared_ptr<WireMessage> message); |
+ std::shared_ptr<proximity_auth::WireMessage> message); |
WriteRequest(const Packet& val, WriteRequestType request_type); |
WriteRequest(const WriteRequest& other); |
~WriteRequest(); |
Packet value; |
WriteRequestType request_type; |
- std::shared_ptr<WireMessage> message; |
+ std::shared_ptr<proximity_auth::WireMessage> message; |
int number_of_failed_attempts; |
}; |
@@ -270,7 +271,7 @@ class BluetoothLowEnergyWeaveClientConnection |
// Throttles repeated connection attempts to the same device. This is a |
// workaround for crbug.com/508919. Not owned, must outlive this instance. |
- BluetoothThrottler* bluetooth_throttler_; |
+ proximity_auth::BluetoothThrottler* bluetooth_throttler_; |
scoped_refptr<base::TaskRunner> task_runner_; |
@@ -311,6 +312,6 @@ class BluetoothLowEnergyWeaveClientConnection |
} // namespace weave |
-} // namespace proximity_auth |
+} // namespace cryptauth |
-#endif // COMPONENTS_PROXIMITY_AUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |
+#endif // COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ |