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

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.cc

Issue 2075313002: Substituting legacy protocol with uWeave protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest memory leak Created 4 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 | « components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.cc
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.cc b/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.cc
index c8851c05c0cb0d67c19d5625436eea9d2b9e0762..ce5257205dc7d460add36bbdfa26ae6cfe593b3f 100644
--- a/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.cc
+++ b/components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.cc
@@ -21,22 +21,22 @@ const uint16_t kMaxPacketSizeLowerBound = 20;
} // namespace
-BluetoothLowEnergyWeavePacketReceiver::Factory*
+std::shared_ptr<BluetoothLowEnergyWeavePacketReceiver::Factory>
BluetoothLowEnergyWeavePacketReceiver::Factory::factory_instance_ = nullptr;
// static
std::unique_ptr<BluetoothLowEnergyWeavePacketReceiver>
BluetoothLowEnergyWeavePacketReceiver::Factory::NewInstance(
ReceiverType receiver_type) {
- if (factory_instance_ == nullptr) {
- factory_instance_ = new Factory();
+ if (!factory_instance_) {
+ factory_instance_.reset(new Factory());
}
return factory_instance_->BuildInstance(receiver_type);
}
// static
void BluetoothLowEnergyWeavePacketReceiver::Factory::SetInstanceForTesting(
- Factory* factory) {
+ std::shared_ptr<Factory> factory) {
factory_instance_ = factory;
}
« no previous file with comments | « components/proximity_auth/ble/bluetooth_low_energy_weave_packet_receiver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698