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

Unified Diff: webrtc/modules/desktop_capture/win/desktop.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 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: webrtc/modules/desktop_capture/win/desktop.cc
diff --git a/webrtc/modules/desktop_capture/win/desktop.cc b/webrtc/modules/desktop_capture/win/desktop.cc
index 97bbfb717b106728694c45b4b3f57abb8debd48e..10fc636353dc84078a80a22062ea85776de33c47 100644
--- a/webrtc/modules/desktop_capture/win/desktop.cc
+++ b/webrtc/modules/desktop_capture/win/desktop.cc
@@ -20,7 +20,7 @@ Desktop::Desktop(HDESK desktop, bool own) : desktop_(desktop), own_(own) {
}
Desktop::~Desktop() {
- if (own_ && desktop_ != NULL) {
+ if (own_ && desktop_ != nullptr) {
if (!::CloseDesktop(desktop_)) {
LOG(LS_ERROR) << "Failed to close the owned desktop handle: "
<< GetLastError();
@@ -29,11 +29,11 @@ Desktop::~Desktop() {
}
bool Desktop::GetName(std::wstring* desktop_name_out) const {
- if (desktop_ == NULL)
+ if (desktop_ == nullptr)
return false;
DWORD length = 0;
- int rv = GetUserObjectInformationW(desktop_, UOI_NAME, NULL, 0, &length);
+ int rv = GetUserObjectInformationW(desktop_, UOI_NAME, nullptr, 0, &length);
if (rv || GetLastError() != ERROR_INSUFFICIENT_BUFFER)
abort();
@@ -77,10 +77,10 @@ Desktop* Desktop::GetDesktop(const WCHAR* desktop_name) {
DESKTOP_HOOKCONTROL | DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP | GENERIC_WRITE;
HDESK desktop = OpenDesktop(desktop_name, 0, FALSE, desired_access);
- if (desktop == NULL) {
+ if (desktop == nullptr) {
LOG(LS_ERROR) << "Failed to open the desktop '" << desktop_name << "': "
<< GetLastError();
- return NULL;
+ return nullptr;
}
return new Desktop(desktop, true);
@@ -89,19 +89,19 @@ Desktop* Desktop::GetDesktop(const WCHAR* desktop_name) {
Desktop* Desktop::GetInputDesktop() {
HDESK desktop = OpenInputDesktop(
0, FALSE, GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE);
- if (desktop == NULL)
- return NULL;
+ if (desktop == nullptr)
+ return nullptr;
return new Desktop(desktop, true);
}
Desktop* Desktop::GetThreadDesktop() {
HDESK desktop = ::GetThreadDesktop(GetCurrentThreadId());
- if (desktop == NULL) {
+ if (desktop == nullptr) {
LOG(LS_ERROR) << "Failed to retrieve the handle of the desktop assigned to "
"the current thread: "
<< GetLastError();
- return NULL;
+ return nullptr;
}
return new Desktop(desktop, false);

Powered by Google App Engine
This is Rietveld 408576698