Index: components/proximity_auth/ble/bluetooth_low_energy_weave_packet_generator.cc |
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_generator.cc b/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_generator.cc |
index 800ca90500775be85e14ec49271820e0f494a02a..c2f55e9ab5ee2c0fbf95050dadc495de775c6d20 100644 |
--- a/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_generator.cc |
+++ b/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_generator.cc |
@@ -20,22 +20,22 @@ namespace proximity_auth { |
namespace weave { |
// static. |
-BluetoothLowEnergyWeavePacketGenerator::Factory* |
+std::shared_ptr<BluetoothLowEnergyWeavePacketGenerator::Factory> |
BluetoothLowEnergyWeavePacketGenerator::Factory::factory_instance_ = |
nullptr; |
// static. |
std::unique_ptr<BluetoothLowEnergyWeavePacketGenerator> |
BluetoothLowEnergyWeavePacketGenerator::Factory::NewInstance() { |
- if (factory_instance_ == nullptr) { |
- factory_instance_ = new Factory(); |
+ if (!factory_instance_) { |
+ factory_instance_.reset(new Factory()); |
} |
return factory_instance_->BuildInstance(); |
} |
// static. |
void BluetoothLowEnergyWeavePacketGenerator::Factory::SetInstanceForTesting( |
- Factory* factory) { |
+ std::shared_ptr<Factory> factory) { |
factory_instance_ = factory; |
} |