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

Side by Side Diff: components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h

Issue 2844773002: [ProximityAuth] Remote static initializers from uWeave classes. (Closed)
Patch Set: Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ 5 #ifndef COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_
6 #define COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_ 6 #define COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 class Factory { 56 class Factory {
57 public: 57 public:
58 static std::unique_ptr<Connection> NewInstance( 58 static std::unique_ptr<Connection> NewInstance(
59 const RemoteDevice& remote_device, 59 const RemoteDevice& remote_device,
60 const std::string& device_address, 60 const std::string& device_address,
61 scoped_refptr<device::BluetoothAdapter> adapter, 61 scoped_refptr<device::BluetoothAdapter> adapter,
62 const device::BluetoothUUID remote_service_uuid, 62 const device::BluetoothUUID remote_service_uuid,
63 BluetoothThrottler* bluetooth_throttler); 63 BluetoothThrottler* bluetooth_throttler);
64 64
65 // Exposed for testing. 65 // Exposed for testing.
66 static void SetInstanceForTesting(std::shared_ptr<Factory> factory); 66 static void SetInstanceForTesting(Factory* factory);
67 67
68 protected: 68 protected:
69 // Exposed for testing. 69 // Exposed for testing.
70 virtual std::unique_ptr<Connection> BuildInstance( 70 virtual std::unique_ptr<Connection> BuildInstance(
71 const RemoteDevice& remote_device, 71 const RemoteDevice& remote_device,
72 const std::string& device_address, 72 const std::string& device_address,
73 scoped_refptr<device::BluetoothAdapter> adapter, 73 scoped_refptr<device::BluetoothAdapter> adapter,
74 const device::BluetoothUUID remote_service_uuid, 74 const device::BluetoothUUID remote_service_uuid,
75 BluetoothThrottler* bluetooth_throttler); 75 BluetoothThrottler* bluetooth_throttler);
76 76
77 private: 77 private:
78 static std::shared_ptr<Factory> factory_instance_; 78 static Factory* factory_instance_;
79 }; 79 };
80 80
81 // The sub-state of a BluetoothLowEnergyWeaveClientConnection 81 // The sub-state of a BluetoothLowEnergyWeaveClientConnection
82 // extends the IN_PROGRESS state of Connection::Status. 82 // extends the IN_PROGRESS state of Connection::Status.
83 enum SubStatus { 83 enum SubStatus {
84 DISCONNECTED, 84 DISCONNECTED,
85 WAITING_GATT_CONNECTION, 85 WAITING_GATT_CONNECTION,
86 WAITING_CHARACTERISTICS, 86 WAITING_CHARACTERISTICS,
87 CHARACTERISTICS_FOUND, 87 CHARACTERISTICS_FOUND,
88 WAITING_NOTIFY_SESSION, 88 WAITING_NOTIFY_SESSION,
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 weak_ptr_factory_; 319 weak_ptr_factory_;
320 320
321 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyWeaveClientConnection); 321 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyWeaveClientConnection);
322 }; 322 };
323 323
324 } // namespace weave 324 } // namespace weave
325 325
326 } // namespace cryptauth 326 } // namespace cryptauth
327 327
328 #endif // COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION _H_ 328 #endif // COMPONENTS_CRYPTAUTH_BLE_BLUETOOTH_LOW_ENERGY_WEAVE_CLIENT_CONNECTION _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698