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

Unified Diff: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
diff --git a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
index f012ae46bad2c09a8fcda6dfa91d89db38c1b8cb..7571caa9b7e48c5f1f2f43e920311e0db27212ae 100644
--- a/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
+++ b/extensions/browser/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc
@@ -157,7 +157,7 @@ namespace extensions {
BluetoothLowEnergyEventRouter::BluetoothLowEnergyEventRouter(
content::BrowserContext* context)
- : adapter_(NULL), browser_context_(context), weak_ptr_factory_(this) {
+ : adapter_(nullptr), browser_context_(context), weak_ptr_factory_(this) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(browser_context_);
VLOG(1) << "Initializing BluetoothLowEnergyEventRouter.";
@@ -174,7 +174,7 @@ BluetoothLowEnergyEventRouter::~BluetoothLowEnergyEventRouter() {
return;
adapter_->RemoveObserver(this);
- adapter_ = NULL;
+ adapter_ = nullptr;
}
bool BluetoothLowEnergyEventRouter::IsBluetoothSupported() const {
@@ -201,7 +201,7 @@ bool BluetoothLowEnergyEventRouter::InitializeAdapterAndInvokeCallback(
}
bool BluetoothLowEnergyEventRouter::HasAdapter() const {
- return (adapter_.get() != NULL);
+ return (adapter_.get() != nullptr);
}
void BluetoothLowEnergyEventRouter::Connect(
@@ -1143,7 +1143,7 @@ BluetoothGattService* BluetoothLowEnergyEventRouter::FindServiceById(
service_id_to_device_address_.find(instance_id);
if (iter == service_id_to_device_address_.end()) {
VLOG(1) << "GATT service identifier unknown: " << instance_id;
- return NULL;
+ return nullptr;
}
const std::string& address = iter->second;
@@ -1151,14 +1151,14 @@ BluetoothGattService* BluetoothLowEnergyEventRouter::FindServiceById(
BluetoothDevice* device = adapter_->GetDevice(address);
if (!device) {
VLOG(1) << "Bluetooth device not found: " << address;
- return NULL;
+ return nullptr;
}
BluetoothGattService* service = device->GetGattService(instance_id);
if (!service) {
VLOG(1) << "GATT service with ID \"" << instance_id
<< "\" not found on device \"" << address << "\"";
- return NULL;
+ return nullptr;
}
return service;
@@ -1170,7 +1170,7 @@ BluetoothLowEnergyEventRouter::FindCharacteristicById(
InstanceIdMap::const_iterator iter = chrc_id_to_service_id_.find(instance_id);
if (iter == chrc_id_to_service_id_.end()) {
VLOG(1) << "GATT characteristic identifier unknown: " << instance_id;
- return NULL;
+ return nullptr;
}
const std::string& service_id = iter->second;
@@ -1178,7 +1178,7 @@ BluetoothLowEnergyEventRouter::FindCharacteristicById(
BluetoothGattService* service = FindServiceById(service_id);
if (!service) {
VLOG(1) << "Failed to obtain service for characteristic: " << instance_id;
- return NULL;
+ return nullptr;
}
BluetoothGattCharacteristic* characteristic =
@@ -1186,7 +1186,7 @@ BluetoothLowEnergyEventRouter::FindCharacteristicById(
if (!characteristic) {
VLOG(1) << "GATT characteristic with ID \"" << instance_id
<< "\" not found on service \"" << service_id << "\"";
- return NULL;
+ return nullptr;
}
return characteristic;
@@ -1197,7 +1197,7 @@ BluetoothGattDescriptor* BluetoothLowEnergyEventRouter::FindDescriptorById(
InstanceIdMap::const_iterator iter = desc_id_to_chrc_id_.find(instance_id);
if (iter == desc_id_to_chrc_id_.end()) {
VLOG(1) << "GATT descriptor identifier unknown: " << instance_id;
- return NULL;
+ return nullptr;
}
const std::string& chrc_id = iter->second;
@@ -1205,14 +1205,14 @@ BluetoothGattDescriptor* BluetoothLowEnergyEventRouter::FindDescriptorById(
if (!chrc) {
VLOG(1) << "Failed to obtain characteristic for descriptor: "
<< instance_id;
- return NULL;
+ return nullptr;
}
BluetoothGattDescriptor* descriptor = chrc->GetDescriptor(instance_id);
if (!descriptor) {
VLOG(1) << "GATT descriptor with ID \"" << instance_id
<< "\" not found on characteristic \"" << chrc_id << "\"";
- return NULL;
+ return nullptr;
}
return descriptor;
@@ -1351,7 +1351,7 @@ BluetoothLowEnergyConnection* BluetoothLowEnergyEventRouter::FindConnection(
base::hash_set<int>* connection_ids = manager->GetResourceIds(extension_id);
if (!connection_ids)
- return NULL;
+ return nullptr;
for (base::hash_set<int>::const_iterator iter = connection_ids->begin();
iter != connection_ids->end();
@@ -1365,7 +1365,7 @@ BluetoothLowEnergyConnection* BluetoothLowEnergyEventRouter::FindConnection(
return conn;
}
- return NULL;
+ return nullptr;
}
bool BluetoothLowEnergyEventRouter::RemoveConnection(
@@ -1402,7 +1402,7 @@ BluetoothLowEnergyEventRouter::FindNotifySession(
base::hash_set<int>* ids = manager->GetResourceIds(extension_id);
if (!ids)
- return NULL;
+ return nullptr;
for (base::hash_set<int>::const_iterator iter = ids->begin();
iter != ids->end();
@@ -1417,7 +1417,7 @@ BluetoothLowEnergyEventRouter::FindNotifySession(
return session;
}
- return NULL;
+ return nullptr;
}
bool BluetoothLowEnergyEventRouter::RemoveNotifySession(

Powered by Google App Engine
This is Rietveld 408576698