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

Unified Diff: extensions/browser/api/usb/usb_api.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/usb/usb_api.cc
diff --git a/extensions/browser/api/usb/usb_api.cc b/extensions/browser/api/usb/usb_api.cc
index c5e35aad892d681dd65709f5bf2f8ed6cb519723..3810ad352c06c4881970d644a1eff2ba96555744 100644
--- a/extensions/browser/api/usb/usb_api.cc
+++ b/extensions/browser/api/usb/usb_api.cc
@@ -188,7 +188,7 @@ scoped_refptr<net::IOBuffer> CreateBufferForTransfer(
UsbEndpointDirection direction,
size_t size) {
if (size >= kMaxTransferLength)
- return NULL;
+ return nullptr;
// Allocate a |size|-bytes buffer, or a one-byte buffer if |size| is 0. This
// is due to an impedance mismatch between IOBuffer and URBs. An IOBuffer
@@ -205,7 +205,7 @@ scoped_refptr<net::IOBuffer> CreateBufferForTransfer(
}
}
NOTREACHED();
- return NULL;
+ return nullptr;
}
const char* ConvertTransferStatusToApi(const UsbTransferStatus status) {
@@ -423,7 +423,7 @@ void ConvertConfigDescriptor(const UsbConfigDescriptor& input,
namespace extensions {
-UsbAsyncApiFunction::UsbAsyncApiFunction() : manager_(NULL) {
+UsbAsyncApiFunction::UsbAsyncApiFunction() : manager_(nullptr) {
}
UsbAsyncApiFunction::~UsbAsyncApiFunction() {
@@ -432,7 +432,7 @@ UsbAsyncApiFunction::~UsbAsyncApiFunction() {
bool UsbAsyncApiFunction::PrePrepare() {
manager_ = ApiResourceManager<UsbDeviceResource>::Get(browser_context());
set_work_thread_id(BrowserThread::FILE);
- return manager_ != NULL;
+ return manager_ != nullptr;
}
bool UsbAsyncApiFunction::Respond() {
@@ -473,20 +473,20 @@ scoped_refptr<UsbDevice> UsbAsyncApiFunction::GetDeviceOrCompleteWithError(
UsbService* service = device::DeviceClient::Get()->GetUsbService();
if (!service) {
CompleteWithError(kErrorInitService);
- return NULL;
+ return nullptr;
}
scoped_refptr<UsbDevice> device = service->GetDeviceById(input_device.device);
if (!device.get()) {
CompleteWithError(kErrorNoDevice);
- return NULL;
+ return nullptr;
}
if (!HasDevicePermission(device)) {
// Must act as if there is no such a device.
// Otherwise can be used to finger print unauthorized devices.
CompleteWithError(kErrorNoDevice);
- return NULL;
+ return nullptr;
}
return device;
@@ -499,13 +499,13 @@ UsbAsyncApiFunction::GetDeviceHandleOrCompleteWithError(
manager_->Get(extension_->id(), input_device_handle.handle);
if (!resource) {
CompleteWithError(kErrorNoDevice);
- return NULL;
+ return nullptr;
}
if (!resource->device().get() || !resource->device()->GetDevice().get()) {
CompleteWithError(kErrorDisconnect);
manager_->Remove(extension_->id(), input_device_handle.handle);
- return NULL;
+ return nullptr;
}
if (resource->device()->GetDevice()->vendor_id() !=
@@ -513,7 +513,7 @@ UsbAsyncApiFunction::GetDeviceHandleOrCompleteWithError(
resource->device()->GetDevice()->product_id() !=
input_device_handle.product_id) {
CompleteWithError(kErrorNoDevice);
- return NULL;
+ return nullptr;
}
return resource->device();

Powered by Google App Engine
This is Rietveld 408576698