replace NULL->nullptr in src/remoting.
Review URL: https://codereview.chromium.org/810133003
Cr-Commit-Position: refs/heads/master@{#310816}
diff --git a/remoting/host/audio_capturer.h b/remoting/host/audio_capturer.h
index 570d585..d0ab26a2 100644
--- a/remoting/host/audio_capturer.h
+++ b/remoting/host/audio_capturer.h
@@ -20,7 +20,7 @@
virtual ~AudioCapturer() {}
// Returns true if audio capturing is supported on this platform. If this
- // returns true, then Create() must not return NULL.
+ // returns true, then Create() must not return nullptr.
static bool IsSupported();
static scoped_ptr<AudioCapturer> Create();
diff --git a/remoting/host/audio_capturer_linux.cc b/remoting/host/audio_capturer_linux.cc
index c253d8a..a34293a5 100644
--- a/remoting/host/audio_capturer_linux.cc
+++ b/remoting/host/audio_capturer_linux.cc
@@ -76,7 +76,7 @@
}
bool AudioCapturer::IsSupported() {
- return g_pulseaudio_pipe_sink_reader.Get().get() != NULL;
+ return g_pulseaudio_pipe_sink_reader.Get().get() != nullptr;
}
scoped_ptr<AudioCapturer> AudioCapturer::Create() {
diff --git a/remoting/host/audio_capturer_win.cc b/remoting/host/audio_capturer_win.cc
index 0279135e..b06c722 100644
--- a/remoting/host/audio_capturer_win.cc
+++ b/remoting/host/audio_capturer_win.cc
@@ -51,7 +51,7 @@
DCHECK(!audio_capture_client_.get());
DCHECK(!audio_client_.get());
DCHECK(!mm_device_.get());
- DCHECK(static_cast<PWAVEFORMATEX>(wave_format_ex_) == NULL);
+ DCHECK(static_cast<PWAVEFORMATEX>(wave_format_ex_) == nullptr);
DCHECK(thread_checker_.CalledOnValidThread());
callback_ = callback;
@@ -80,7 +80,7 @@
// Get an audio client.
hr = mm_device_->Activate(__uuidof(IAudioClient),
CLSCTX_ALL,
- NULL,
+ nullptr,
audio_client_.ReceiveVoid());
if (FAILED(hr)) {
LOG(ERROR) << "Failed to get an IAudioClient. Error " << hr;
@@ -88,7 +88,7 @@
}
REFERENCE_TIME device_period;
- hr = audio_client_->GetDevicePeriod(&device_period, NULL);
+ hr = audio_client_->GetDevicePeriod(&device_period, nullptr);
if (FAILED(hr)) {
LOG(ERROR) << "IAudioClient::GetDevicePeriod failed. Error " << hr;
return false;
@@ -169,7 +169,7 @@
k100nsPerMillisecond,
0,
wave_format_ex_,
- NULL);
+ nullptr);
if (FAILED(hr)) {
LOG(ERROR) << "Failed to initialize IAudioClient. Error " << hr;
return false;
@@ -208,14 +208,14 @@
mm_device_.Release();
audio_client_.Release();
audio_capture_client_.Release();
- wave_format_ex_.Reset(NULL);
+ wave_format_ex_.Reset(nullptr);
thread_checker_.DetachFromThread();
}
bool AudioCapturerWin::IsStarted() {
DCHECK(thread_checker_.CalledOnValidThread());
- return capture_timer_.get() != NULL;
+ return capture_timer_.get() != nullptr;
}
void AudioCapturerWin::DoCapture() {
@@ -238,7 +238,8 @@
BYTE* data;
UINT32 frames;
DWORD flags;
- hr = audio_capture_client_->GetBuffer(&data, &frames, &flags, NULL, NULL);
+ hr = audio_capture_client_->GetBuffer(&data, &frames, &flags, nullptr,
+ nullptr);
if (FAILED(hr))
break;
diff --git a/remoting/host/audio_scheduler.cc b/remoting/host/audio_scheduler.cc
index b8bf7ef..1b995b6 100644
--- a/remoting/host/audio_scheduler.cc
+++ b/remoting/host/audio_scheduler.cc
@@ -46,7 +46,7 @@
DCHECK(audio_stub_);
// Clear |audio_stub_| to prevent audio packets being delivered to the client.
- audio_stub_ = NULL;
+ audio_stub_ = nullptr;
audio_task_runner_->PostTask(
FROM_HERE,
@@ -89,7 +89,7 @@
scoped_ptr<AudioPacket> encoded_packet =
audio_encoder_->Encode(packet.Pass());
- // The audio encoder returns a NULL audio packet if there's no audio to send.
+ // The audio encoder returns a null audio packet if there's no audio to send.
if (encoded_packet.get()) {
network_task_runner_->PostTask(
FROM_HERE, base::Bind(&AudioScheduler::SendAudioPacket,
diff --git a/remoting/host/cast_extension_session.cc b/remoting/host/cast_extension_session.cc
index 140b41d..72d1e9e 100644
--- a/remoting/host/cast_extension_session.cc
+++ b/remoting/host/cast_extension_session.cc
@@ -96,7 +96,7 @@
session);
}
void OnSuccess(webrtc::SessionDescriptionInterface* desc) override {
- if (cast_extension_session_ == NULL) {
+ if (cast_extension_session_ == nullptr) {
LOG(ERROR)
<< "No CastExtensionSession. Creating session description succeeded.";
return;
@@ -104,7 +104,7 @@
cast_extension_session_->OnCreateSessionDescription(desc);
}
void OnFailure(const std::string& error) override {
- if (cast_extension_session_ == NULL) {
+ if (cast_extension_session_ == nullptr) {
LOG(ERROR)
<< "No CastExtensionSession. Creating session description failed.";
return;
@@ -162,7 +162,7 @@
// Explicitly clear |create_session_desc_observer_|'s pointer to |this|,
// since the CastExtensionSession is destructing. Otherwise,
// |create_session_desc_observer_| would be left with a dangling pointer.
- create_session_desc_observer_->SetCastExtensionSession(NULL);
+ create_session_desc_observer_->SetCastExtensionSession(nullptr);
CleanupPeerConnection();
}
@@ -239,7 +239,7 @@
if (received_offer_) {
has_grabbed_capturer_ = true;
if (SetupVideoStream(capturer->Pass())) {
- peer_connection_->CreateAnswer(create_session_desc_observer_, NULL);
+ peer_connection_->CreateAnswer(create_session_desc_observer_, nullptr);
} else {
has_grabbed_capturer_ = false;
// Ignore the received offer, since we failed to setup a video stream.
@@ -313,8 +313,8 @@
stats_observer_(CastStatsObserver::Create()),
received_offer_(false),
has_grabbed_capturer_(false),
- signaling_thread_wrapper_(NULL),
- worker_thread_wrapper_(NULL),
+ signaling_thread_wrapper_(nullptr),
+ worker_thread_wrapper_(nullptr),
worker_thread_(kWorkerThreadName) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
DCHECK(url_request_context_getter_.get());
@@ -331,7 +331,7 @@
bool CastExtensionSession::ParseAndSetRemoteDescription(
base::DictionaryValue* message) {
- DCHECK(peer_connection_.get() != NULL);
+ DCHECK(peer_connection_.get() != nullptr);
base::DictionaryValue* message_data;
if (!message->GetDictionary(kTopLevelData, &message_data)) {
@@ -369,7 +369,7 @@
bool CastExtensionSession::ParseAndAddICECandidate(
base::DictionaryValue* message) {
- DCHECK(peer_connection_.get() != NULL);
+ DCHECK(peer_connection_.get() != nullptr);
base::DictionaryValue* message_data;
if (!message->GetDictionary(kTopLevelData, &message_data)) {
@@ -409,7 +409,7 @@
const std::string& data) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- if (client_stub_ == NULL) {
+ if (client_stub_ == nullptr) {
LOG(ERROR) << "No Client Stub. Cannot send message to client.";
return false;
}
@@ -437,7 +437,7 @@
jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true);
*ptr = jingle_glue::JingleThreadWrapper::current();
- if (event != NULL) {
+ if (event != nullptr) {
event->Signal();
}
}
@@ -446,7 +446,7 @@
DCHECK(caller_task_runner_->BelongsToCurrentThread());
EnsureTaskAndSetSend(&signaling_thread_wrapper_);
- if (signaling_thread_wrapper_ == NULL)
+ if (signaling_thread_wrapper_ == nullptr)
return false;
base::WaitableEvent wrap_worker_thread_event(true, false);
@@ -458,18 +458,19 @@
&wrap_worker_thread_event));
wrap_worker_thread_event.Wait();
- return (worker_thread_wrapper_ != NULL);
+ return (worker_thread_wrapper_ != nullptr);
}
bool CastExtensionSession::InitializePeerConnection() {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
DCHECK(!peer_conn_factory_);
DCHECK(!peer_connection_);
- DCHECK(worker_thread_wrapper_ != NULL);
- DCHECK(signaling_thread_wrapper_ != NULL);
+ DCHECK(worker_thread_wrapper_ != nullptr);
+ DCHECK(signaling_thread_wrapper_ != nullptr);
peer_conn_factory_ = webrtc::CreatePeerConnectionFactory(
- worker_thread_wrapper_, signaling_thread_wrapper_, NULL, NULL, NULL);
+ worker_thread_wrapper_, signaling_thread_wrapper_, nullptr, nullptr,
+ nullptr);
if (!peer_conn_factory_.get()) {
CleanupPeerConnection();
@@ -499,7 +500,7 @@
network_settings_, url_request_context_getter_);
peer_connection_ = peer_conn_factory_->CreatePeerConnection(
- rtc_config, &constraints, port_allocator_factory, NULL, this);
+ rtc_config, &constraints, port_allocator_factory, nullptr, this);
if (!peer_connection_.get()) {
CleanupPeerConnection();
@@ -572,14 +573,14 @@
void CastExtensionSession::CleanupPeerConnection() {
peer_connection_->Close();
- peer_connection_ = NULL;
- stream_ = NULL;
- peer_conn_factory_ = NULL;
+ peer_connection_ = nullptr;
+ stream_ = nullptr;
+ peer_conn_factory_ = nullptr;
worker_thread_.Stop();
}
bool CastExtensionSession::connection_active() const {
- return peer_connection_.get() != NULL;
+ return peer_connection_.get() != nullptr;
}
// webrtc::PeerConnectionObserver implementation -------------------------------
diff --git a/remoting/host/cast_extension_session.h b/remoting/host/cast_extension_session.h
index 3b3ee721..48d97a43 100644
--- a/remoting/host/cast_extension_session.h
+++ b/remoting/host/cast_extension_session.h
@@ -155,9 +155,9 @@
// Creates the jingle wrapper for the current thread, sets send to allowed,
// and saves a pointer to the relevant thread pointer in ptr. If |event|
- // is not NULL, signals the event on completion.
+ // is not nullptr, signals the event on completion.
void EnsureTaskAndSetSend(rtc::Thread** ptr,
- base::WaitableEvent* event = NULL);
+ base::WaitableEvent* event = nullptr);
// Wraps each task runner in JingleThreadWrapper using EnsureTaskAndSetSend(),
// returning true if successful. Wrapping the task runners allows them to be
diff --git a/remoting/host/cast_video_capturer_adapter.cc b/remoting/host/cast_video_capturer_adapter.cc
index ddf0264..37d36fe4 100644
--- a/remoting/host/cast_video_capturer_adapter.cc
+++ b/remoting/host/cast_video_capturer_adapter.cc
@@ -28,7 +28,7 @@
webrtc::SharedMemory* CastVideoCapturerAdapter::CreateSharedMemory(
size_t size) {
- return NULL;
+ return nullptr;
}
void CastVideoCapturerAdapter::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
@@ -163,7 +163,7 @@
capture_timer_.reset();
- SetCaptureFormat(NULL);
+ SetCaptureFormat(nullptr);
SetCaptureState(cricket::CS_STOPPED);
VLOG(1) << "CastVideoCapturerAdapter stopped.";
diff --git a/remoting/host/chromeos/aura_desktop_capturer.cc b/remoting/host/chromeos/aura_desktop_capturer.cc
index 28b5e03..d37ae32 100644
--- a/remoting/host/chromeos/aura_desktop_capturer.cc
+++ b/remoting/host/chromeos/aura_desktop_capturer.cc
@@ -18,7 +18,7 @@
namespace remoting {
AuraDesktopCapturer::AuraDesktopCapturer()
- : callback_(NULL), desktop_window_(NULL), weak_factory_(this) {
+ : callback_(nullptr), desktop_window_(nullptr), weak_factory_(this) {
}
AuraDesktopCapturer::~AuraDesktopCapturer() {
diff --git a/remoting/host/chromeos/aura_desktop_capturer_unittest.cc b/remoting/host/chromeos/aura_desktop_capturer_unittest.cc
index fb41684..9095cba 100644
--- a/remoting/host/chromeos/aura_desktop_capturer_unittest.cc
+++ b/remoting/host/chromeos/aura_desktop_capturer_unittest.cc
@@ -64,7 +64,7 @@
}
TEST_F(AuraDesktopCapturerTest, ConvertSkBitmapToDesktopFrame) {
- webrtc::DesktopFrame* captured_frame = NULL;
+ webrtc::DesktopFrame* captured_frame = nullptr;
EXPECT_CALL(*this, OnCaptureCompleted(_)).Times(1).WillOnce(
SaveArg<0>(&captured_frame));
@@ -72,7 +72,7 @@
SimulateFrameCapture();
- ASSERT_TRUE(captured_frame != NULL);
+ ASSERT_TRUE(captured_frame != nullptr);
uint8_t* captured_data = captured_frame->data();
EXPECT_EQ(
0,
diff --git a/remoting/host/chromeos/skia_bitmap_desktop_frame.cc b/remoting/host/chromeos/skia_bitmap_desktop_frame.cc
index ed9b8ba..d32f387e 100644
--- a/remoting/host/chromeos/skia_bitmap_desktop_frame.cc
+++ b/remoting/host/chromeos/skia_bitmap_desktop_frame.cc
@@ -29,10 +29,10 @@
int stride,
uint8_t* data,
scoped_ptr<SkBitmap> bitmap)
- : DesktopFrame(size, stride, data, NULL), bitmap_(bitmap.Pass()) {
+ : DesktopFrame(size, stride, data, nullptr), bitmap_(bitmap.Pass()) {
}
SkiaBitmapDesktopFrame::~SkiaBitmapDesktopFrame() {
}
-} // namespace remoting
\ No newline at end of file
+} // namespace remoting
diff --git a/remoting/host/chromoting_host_context.h b/remoting/host/chromoting_host_context.h
index 2dbb34a8..58a0af5 100644
--- a/remoting/host/chromoting_host_context.h
+++ b/remoting/host/chromoting_host_context.h
@@ -24,7 +24,7 @@
// Create threads and URLRequestContextGetter for use by a host.
// During shutdown the caller should tear-down the ChromotingHostContext and
// then continue to run until |ui_task_runner| is no longer referenced.
- // NULL is returned if any threads fail to start.
+ // nullptr is returned if any threads fail to start.
static scoped_ptr<ChromotingHostContext> Create(
scoped_refptr<AutoThreadTaskRunner> ui_task_runner);
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 84b4f7de..19efc25 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -196,7 +196,7 @@
connection.Pass(),
desktop_environment_factory_.get(),
base::TimeDelta(),
- NULL,
+ nullptr,
std::vector<HostExtension*>()));
connection_ptr->set_host_stub(client.get());
@@ -227,7 +227,7 @@
void TearDown() override {
// Make sure that the host has been properly deleted.
- DCHECK(host_.get() == NULL);
+ DCHECK(host_.get() == nullptr);
}
// Change the session route for |client1_|.
@@ -322,7 +322,7 @@
void StopAndReleaseTaskRunner() {
host_.reset();
- task_runner_ = NULL;
+ task_runner_ = nullptr;
desktop_environment_factory_.reset();
}
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index d86c955a..1b580dc 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -136,7 +136,7 @@
void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {
DCHECK(CalledOnValidThread());
- // Note that |video_scheduler_| may be NULL, depending upon whether extensions
+ // Note that |video_scheduler_| may be null, depending upon whether extensions
// choose to wrap or "steal" the video capturer or encoder.
if (video_control.has_enable()) {
VLOG(1) << "Received VideoControl (enable="
@@ -366,11 +366,11 @@
// longer valid once ConnectionToClient calls OnConnectionClosed().
if (audio_scheduler_.get()) {
audio_scheduler_->Stop();
- audio_scheduler_ = NULL;
+ audio_scheduler_ = nullptr;
}
if (video_scheduler_.get()) {
video_scheduler_->Stop();
- video_scheduler_ = NULL;
+ video_scheduler_ = nullptr;
}
client_clipboard_factory_.InvalidateWeakPtrs();
@@ -436,7 +436,7 @@
if (video_scheduler_.get()) {
video_scheduler_->Stop();
- video_scheduler_ = NULL;
+ video_scheduler_ = nullptr;
}
// Create VideoEncoder and DesktopCapturer to match the session's video
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index d0e5d1d..58c5ec0 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -219,8 +219,8 @@
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
// Schedulers for audio and video capture.
- // |video_scheduler_| may be NULL if the video channel is not required - see
- // ResetVideoPipeline().
+ // |video_scheduler_| may be nullptr if the video channel is not required -
+ // see ResetVideoPipeline().
scoped_refptr<AudioScheduler> audio_scheduler_;
scoped_refptr<VideoScheduler> video_scheduler_;
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index 5bd4ca21..0f0898e 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -224,7 +224,7 @@
void ClientSessionTest::TearDown() {
// Clear out |task_runner_| reference so the loop can quit, and run it until
// it does.
- task_runner_ = NULL;
+ task_runner_ = nullptr;
run_loop_.Run();
}
@@ -236,9 +236,9 @@
EXPECT_CALL(*session, SetEventHandler(_));
// Mock protocol::ConnectionToClient APIs called directly by ClientSession.
- // HostStub is not touched by ClientSession, so we can safely pass NULL.
+ // HostStub is not touched by ClientSession, so we can safely pass nullptr.
scoped_ptr<MockConnectionToClient> connection(
- new MockConnectionToClient(session, NULL));
+ new MockConnectionToClient(session, nullptr));
EXPECT_CALL(*connection, session()).WillRepeatedly(Return(session));
EXPECT_CALL(*connection, client_stub())
.WillRepeatedly(Return(&client_stub_));
@@ -257,7 +257,7 @@
connection.Pass(),
desktop_environment_factory_.get(),
base::TimeDelta(),
- NULL,
+ nullptr,
extensions_));
}
diff --git a/remoting/host/clipboard_mac.mm b/remoting/host/clipboard_mac.mm
index 48ce852..f3f369ee 100644
--- a/remoting/host/clipboard_mac.mm
+++ b/remoting/host/clipboard_mac.mm
@@ -51,7 +51,7 @@
ClipboardMac::~ClipboardMac() {
// In it2me the destructor is not called in the same thread that the timer is
// created. Thus the timer must have already been destroyed by now.
- DCHECK(clipboard_polling_timer_.get() == NULL);
+ DCHECK(clipboard_polling_timer_.get() == nullptr);
}
void ClipboardMac::Start(scoped_ptr<protocol::ClipboardStub> client_clipboard) {
diff --git a/remoting/host/clipboard_win.cc b/remoting/host/clipboard_win.cc
index f78457fd..dd2cc283 100644
--- a/remoting/host/clipboard_win.cc
+++ b/remoting/host/clipboard_win.cc
@@ -88,7 +88,7 @@
HANDLE GetData(UINT format) {
if (!opened_) {
NOTREACHED();
- return NULL;
+ return nullptr;
}
return ::GetClipboardData(format);
}
@@ -134,8 +134,8 @@
};
ClipboardWin::ClipboardWin()
- : add_clipboard_format_listener_(NULL),
- remove_clipboard_format_listener_(NULL) {
+ : add_clipboard_format_listener_(nullptr),
+ remove_clipboard_format_listener_(nullptr) {
}
void ClipboardWin::Start(
diff --git a/remoting/host/clipboard_x11.cc b/remoting/host/clipboard_x11.cc
index fa04639..dc0bd98 100644
--- a/remoting/host/clipboard_x11.cc
+++ b/remoting/host/clipboard_x11.cc
@@ -52,7 +52,7 @@
};
ClipboardX11::ClipboardX11()
- : display_(NULL) {
+ : display_(nullptr) {
}
ClipboardX11::~ClipboardX11() {
@@ -62,7 +62,7 @@
void ClipboardX11::Start(
scoped_ptr<protocol::ClipboardStub> client_clipboard) {
// TODO(lambroslambrou): Share the X connection with InputInjector.
- display_ = XOpenDisplay(NULL);
+ display_ = XOpenDisplay(nullptr);
if (!display_) {
LOG(ERROR) << "Couldn't open X display";
return;
@@ -93,7 +93,7 @@
if (display_) {
XCloseDisplay(display_);
- display_ = NULL;
+ display_ = nullptr;
}
}
diff --git a/remoting/host/config_file_watcher.cc b/remoting/host/config_file_watcher.cc
index f07b1ae9..075608550 100644
--- a/remoting/host/config_file_watcher.cc
+++ b/remoting/host/config_file_watcher.cc
@@ -96,7 +96,7 @@
ConfigFileWatcher::~ConfigFileWatcher() {
impl_->StopWatching();
- impl_ = NULL;
+ impl_ = nullptr;
}
void ConfigFileWatcher::Watch(ConfigWatcher::Delegate* delegate) {
@@ -109,7 +109,7 @@
const base::FilePath& config_path)
: config_path_(config_path),
retries_(0),
- delegate_(NULL),
+ delegate_(nullptr),
main_task_runner_(main_task_runner),
io_task_runner_(io_task_runner),
weak_factory_(this) {
diff --git a/remoting/host/continue_window_linux.cc b/remoting/host/continue_window_linux.cc
index 668e392..9f31d90 100644
--- a/remoting/host/continue_window_linux.cc
+++ b/remoting/host/continue_window_linux.cc
@@ -35,13 +35,13 @@
};
ContinueWindowGtk::ContinueWindowGtk()
- : continue_window_(NULL) {
+ : continue_window_(nullptr) {
}
ContinueWindowGtk::~ContinueWindowGtk() {
if (continue_window_) {
gtk_widget_destroy(continue_window_);
- continue_window_ = NULL;
+ continue_window_ = nullptr;
}
}
@@ -59,7 +59,7 @@
if (continue_window_) {
gtk_widget_destroy(continue_window_);
- continue_window_ = NULL;
+ continue_window_ = nullptr;
}
}
@@ -69,13 +69,13 @@
continue_window_ = gtk_dialog_new_with_buttons(
l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str(),
- NULL,
+ nullptr,
static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR),
l10n_util::GetStringUTF8(IDS_STOP_SHARING_BUTTON).c_str(),
GTK_RESPONSE_CANCEL,
l10n_util::GetStringUTF8(IDS_CONTINUE_BUTTON).c_str(),
GTK_RESPONSE_OK,
- NULL);
+ nullptr);
gtk_dialog_set_default_response(GTK_DIALOG(continue_window_),
GTK_RESPONSE_OK);
diff --git a/remoting/host/continue_window_win.cc b/remoting/host/continue_window_win.cc
index 46814965..cb690e5 100644
--- a/remoting/host/continue_window_win.cc
+++ b/remoting/host/continue_window_win.cc
@@ -43,7 +43,7 @@
};
ContinueWindowWin::ContinueWindowWin()
- : hwnd_(NULL) {
+ : hwnd_(nullptr) {
}
ContinueWindowWin::~ContinueWindowWin() {
@@ -55,7 +55,7 @@
DCHECK(!hwnd_);
HMODULE instance = base::GetModuleFromAddress(&DialogProc);
- hwnd_ = CreateDialogParam(instance, MAKEINTRESOURCE(IDD_CONTINUE), NULL,
+ hwnd_ = CreateDialogParam(instance, MAKEINTRESOURCE(IDD_CONTINUE), nullptr,
(DLGPROC)DialogProc, (LPARAM)this);
if (!hwnd_) {
LOG(ERROR) << "Unable to create Disconnect dialog for remoting.";
@@ -73,7 +73,7 @@
BOOL CALLBACK ContinueWindowWin::DialogProc(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
- ContinueWindowWin* win = NULL;
+ ContinueWindowWin* win = nullptr;
if (msg == WM_INITDIALOG) {
win = reinterpret_cast<ContinueWindowWin*>(lParam);
CHECK(win);
@@ -82,7 +82,7 @@
LONG_PTR lp = GetWindowLongPtr(hwnd, DWLP_USER);
win = reinterpret_cast<ContinueWindowWin*>(lp);
}
- if (win == NULL)
+ if (win == nullptr)
return FALSE;
return win->OnDialogMessage(hwnd, msg, wParam, lParam);
}
@@ -97,19 +97,19 @@
return TRUE;
case WM_DESTROY:
// Ensure we don't try to use the HWND anymore.
- hwnd_ = NULL;
+ hwnd_ = nullptr;
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_CONTINUE_DEFAULT:
ContinueSession();
::EndDialog(hwnd, LOWORD(wParam));
- hwnd_ = NULL;
+ hwnd_ = nullptr;
return TRUE;
case IDC_CONTINUE_CANCEL:
DisconnectSession();
::EndDialog(hwnd, LOWORD(wParam));
- hwnd_ = NULL;
+ hwnd_ = nullptr;
return TRUE;
}
}
@@ -121,7 +121,7 @@
if (hwnd_) {
::DestroyWindow(hwnd_);
- hwnd_ = NULL;
+ hwnd_ = nullptr;
}
}
diff --git a/remoting/host/curtain_mode_linux.cc b/remoting/host/curtain_mode_linux.cc
index 696af4e..3e917b0 100644
--- a/remoting/host/curtain_mode_linux.cc
+++ b/remoting/host/curtain_mode_linux.cc
@@ -47,7 +47,7 @@
// Try to identify an Xvfb session. There's no way to query what X server we
// are running under, so we check for the Xvfb input devices.
// TODO(rmsousa): Find a similar way to determine that the *output* is secure.
- Display* display = XOpenDisplay(NULL);
+ Display* display = XOpenDisplay(nullptr);
int opcode, event, error;
if (!XQueryExtension(display, "XInputExtension", &opcode, &event, &error)) {
// If XInput is not available, assume it is not an Xvfb session.
diff --git a/remoting/host/curtain_mode_mac.cc b/remoting/host/curtain_mode_mac.cc
index b0718e8..cae8e704 100644
--- a/remoting/host/curtain_mode_mac.cc
+++ b/remoting/host/curtain_mode_mac.cc
@@ -84,7 +84,7 @@
: caller_task_runner_(caller_task_runner),
ui_task_runner_(ui_task_runner),
client_session_control_(client_session_control),
- event_handler_(NULL) {
+ event_handler_(nullptr) {
}
void SessionWatcher::Start() {
@@ -137,14 +137,14 @@
base::ScopedCFTypeRef<CFDictionaryRef> session(
CGSessionCopyCurrentDictionary());
- // CGSessionCopyCurrentDictionary has been observed to return NULL in some
+ // CGSessionCopyCurrentDictionary has been observed to return nullptr in some
// cases. Once the system is in this state, curtain mode will fail as the
// CGSession command thinks the session is not attached to the console. The
// only known remedy is logout or reboot. Since we're not sure what causes
// this, or how common it is, a crash report is useful in this case (note
// that the connection would have to be refused in any case, so this is no
// loss of functionality).
- CHECK(session != NULL);
+ CHECK(session != nullptr);
const void* on_console = CFDictionaryGetValue(session,
kCGSessionOnConsoleKey);
@@ -152,7 +152,7 @@
if (logged_in == kCFBooleanTrue && on_console == kCFBooleanTrue) {
pid_t child = fork();
if (child == 0) {
- execl(kCGSessionPath, kCGSessionPath, "-suspend", NULL);
+ execl(kCGSessionPath, kCGSessionPath, "-suspend", nullptr);
_exit(1);
} else if (child > 0) {
int status = 0;
@@ -181,7 +181,7 @@
NewEventHandlerUPP(SessionActivateHandler), 1, &event, this,
&event_handler_);
if (result != noErr) {
- event_handler_ = NULL;
+ event_handler_ = nullptr;
DisconnectSession();
return false;
}
@@ -194,7 +194,7 @@
if (event_handler_) {
::RemoveEventHandler(event_handler_);
- event_handler_ = NULL;
+ event_handler_ = nullptr;
}
}
diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc
index b360d88d..85706d5 100644
--- a/remoting/host/daemon_process_win.cc
+++ b/remoting/host/daemon_process_win.cc
@@ -237,7 +237,7 @@
void DaemonProcessWin::DisableAutoStart() {
ScopedScHandle scmanager(
- OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE,
+ OpenSCManager(nullptr, SERVICES_ACTIVE_DATABASE,
SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE));
if (!scmanager.IsValid()) {
PLOG(INFO) << "Failed to connect to the service control manager";
@@ -253,19 +253,19 @@
return;
}
- // Change the service start type to 'manual'. All |NULL| parameters below mean
- // that there is no change to the corresponding service parameter.
+ // Change the service start type to 'manual'. All |nullptr| parameters below
+ // mean that there is no change to the corresponding service parameter.
if (!ChangeServiceConfig(service.Get(),
SERVICE_NO_CHANGE,
SERVICE_DEMAND_START,
SERVICE_NO_CHANGE,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL)) {
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr)) {
PLOG(INFO) << "Failed to change the '" << kWindowsServiceName
<< "'service start type to 'manual'";
}
@@ -358,7 +358,7 @@
security_attributes.lpSecurityDescriptor = sd.get();
security_attributes.bInheritHandle = FALSE;
- HKEY key = NULL;
+ HKEY key = nullptr;
result = ::RegCreateKeyEx(
root.Handle(), kPairingRegistrySecretsKeyName, 0, nullptr, 0,
KEY_READ | KEY_WRITE, &security_attributes, &key, &disposition);
diff --git a/remoting/host/desktop_environment.h b/remoting/host/desktop_environment.h
index dbeebb88..50aa11d 100644
--- a/remoting/host/desktop_environment.h
+++ b/remoting/host/desktop_environment.h
@@ -66,7 +66,7 @@
public:
virtual ~DesktopEnvironmentFactory() {}
- // Creates an instance of |DesktopEnvironment|. Returns a NULL pointer if
+ // Creates an instance of |DesktopEnvironment|. Returns a nullptr pointer if
// the desktop environment could not be created for any reason (if the curtain
// failed to active for instance). |client_session_control| must outlive
// the created desktop environment.
diff --git a/remoting/host/desktop_process.cc b/remoting/host/desktop_process.cc
index 5f0303e..4d282d1 100644
--- a/remoting/host/desktop_process.cc
+++ b/remoting/host/desktop_process.cc
@@ -81,11 +81,11 @@
daemon_channel_.reset();
if (desktop_agent_.get()) {
desktop_agent_->Stop();
- desktop_agent_ = NULL;
+ desktop_agent_ = nullptr;
}
- caller_task_runner_ = NULL;
- input_task_runner_ = NULL;
+ caller_task_runner_ = nullptr;
+ input_task_runner_ = nullptr;
desktop_environment_factory_.reset();
}
@@ -131,9 +131,9 @@
// Start the agent and create an IPC channel to talk to it.
IPC::PlatformFileForTransit desktop_pipe;
if (!desktop_agent_->Start(AsWeakPtr(), &desktop_pipe)) {
- desktop_agent_ = NULL;
- caller_task_runner_ = NULL;
- input_task_runner_ = NULL;
+ desktop_agent_ = nullptr;
+ caller_task_runner_ = nullptr;
+ input_task_runner_ = nullptr;
desktop_environment_factory_.reset();
return false;
}
diff --git a/remoting/host/desktop_process_main.cc b/remoting/host/desktop_process_main.cc
index 454e6eb..2941660 100644
--- a/remoting/host/desktop_process_main.cc
+++ b/remoting/host/desktop_process_main.cc
@@ -67,7 +67,7 @@
return kInitializationFailed;
// Run the UI message loop.
- ui_task_runner = NULL;
+ ui_task_runner = nullptr;
run_loop.Run();
return kSuccessExitCode;
diff --git a/remoting/host/desktop_process_unittest.cc b/remoting/host/desktop_process_unittest.cc
index 47f76df..609473a0 100644
--- a/remoting/host/desktop_process_unittest.cc
+++ b/remoting/host/desktop_process_unittest.cc
@@ -225,7 +225,7 @@
void DesktopProcessTest::DisconnectChannels() {
daemon_channel_.reset();
network_channel_.reset();
- io_task_runner_ = NULL;
+ io_task_runner_ = nullptr;
}
void DesktopProcessTest::PostDisconnectChannels() {
@@ -264,7 +264,7 @@
DesktopProcess desktop_process(ui_task_runner, io_task_runner_, channel_name);
EXPECT_TRUE(desktop_process.Start(desktop_environment_factory.Pass()));
- ui_task_runner = NULL;
+ ui_task_runner = nullptr;
run_loop.Run();
}
diff --git a/remoting/host/desktop_resizer_linux.cc b/remoting/host/desktop_resizer_linux.cc
index 13ce6a7..0afb32a 100644
--- a/remoting/host/desktop_resizer_linux.cc
+++ b/remoting/host/desktop_resizer_linux.cc
@@ -66,7 +66,7 @@
// Wrapper class for the XRRScreenResources struct.
class ScreenResources {
public:
- ScreenResources() : resources_(NULL) {
+ ScreenResources() : resources_(nullptr) {
}
~ScreenResources() {
@@ -76,13 +76,13 @@
bool Refresh(Display* display, Window window) {
Release();
resources_ = XRRGetScreenResources(display, window);
- return resources_ != NULL;
+ return resources_ != nullptr;
}
void Release() {
if (resources_) {
XRRFreeScreenResources(resources_);
- resources_ = NULL;
+ resources_ = nullptr;
}
}
@@ -142,7 +142,7 @@
// mode is in use, it is not deleted.
void DeleteMode(const char* name);
- // Switch the primary output to the specified mode. If name is NULL, the
+ // Switch the primary output to the specified mode. If name is nullptr, the
// primary output is disabled instead, which is required before changing
// its resolution.
void SwitchToMode(const char* name);
@@ -157,7 +157,7 @@
};
DesktopResizerLinux::DesktopResizerLinux()
- : display_(XOpenDisplay(NULL)),
+ : display_(XOpenDisplay(nullptr)),
screen_(DefaultScreen(display_)),
root_(RootWindow(display_, screen_)),
exact_resize_(base::CommandLine::ForCurrentProcess()->
@@ -263,7 +263,7 @@
kDefaultDPI);
CreateMode(kTempModeName, resolution.dimensions().width(),
resolution.dimensions().height());
- SwitchToMode(NULL);
+ SwitchToMode(nullptr);
XRRSetScreenSize(display_, root_, resolution.dimensions().width(),
resolution.dimensions().height(), width_mm, height_mm);
SwitchToMode(kTempModeName);
@@ -311,7 +311,7 @@
void DesktopResizerLinux::SwitchToMode(const char* name) {
RRMode mode_id = None;
- RROutput* outputs = NULL;
+ RROutput* outputs = nullptr;
int number_of_outputs = 0;
if (name) {
mode_id = resources_.GetIdForMode(name);
diff --git a/remoting/host/desktop_resizer_mac.cc b/remoting/host/desktop_resizer_mac.cc
index 4bc03cc07..7d3d3298 100644
--- a/remoting/host/desktop_resizer_mac.cc
+++ b/remoting/host/desktop_resizer_mac.cc
@@ -75,7 +75,7 @@
// There may be many modes with the requested resolution. Pick the one with
// the highest color depth.
int index = 0, best_depth = 0;
- CGDisplayModeRef best_mode = NULL;
+ CGDisplayModeRef best_mode = nullptr;
for (std::list<ScreenResolution>::const_iterator i = resolutions.begin();
i != resolutions.end(); ++i, ++index) {
if (i->Equals(resolution)) {
@@ -109,7 +109,7 @@
<< "x" << resolution.dimensions().height() << "x"
<< best_depth << " @ "
<< resolution.dpi().x() << "x" << resolution.dpi().y() << " dpi)";
- CGDisplaySetDisplayMode(display, best_mode, NULL);
+ CGDisplaySetDisplayMode(display, best_mode, nullptr);
}
}
@@ -126,12 +126,12 @@
}
base::ScopedCFTypeRef<CFArrayRef> all_modes(
- CGDisplayCopyAllDisplayModes(display, NULL));
+ CGDisplayCopyAllDisplayModes(display, nullptr));
if (!all_modes) {
return;
}
- modes->reset(CFArrayCreateMutableCopy(NULL, 0, all_modes));
+ modes->reset(CFArrayCreateMutableCopy(nullptr, 0, all_modes));
CFIndex count = CFArrayGetCount(*modes);
for (CFIndex i = 0; i < count; ++i) {
CGDisplayModeRef mode = const_cast<CGDisplayModeRef>(
diff --git a/remoting/host/desktop_resizer_win.cc b/remoting/host/desktop_resizer_win.cc
index f22f023..f35b39f 100644
--- a/remoting/host/desktop_resizer_win.cc
+++ b/remoting/host/desktop_resizer_win.cc
@@ -147,7 +147,7 @@
void DesktopResizerWin::RestoreResolution(const ScreenResolution& original) {
// Restore the display mode based on the registry configuration.
- DWORD result = ChangeDisplaySettings(NULL, 0);
+ DWORD result = ChangeDisplaySettings(nullptr, 0);
if (result != DISP_CHANGE_SUCCESSFUL)
LOG(ERROR) << "RestoreResolution failed: " << result;
}
@@ -163,7 +163,7 @@
DWORD mode_number, DWORD flags, DEVMODE* mode) {
memset(mode, 0, sizeof(DEVMODE));
mode->dmSize = sizeof(DEVMODE);
- if (!EnumDisplaySettingsEx(NULL, mode_number, mode, flags))
+ if (!EnumDisplaySettingsEx(nullptr, mode_number, mode, flags))
return false;
return true;
}
diff --git a/remoting/host/desktop_session_agent.cc b/remoting/host/desktop_session_agent.cc
index 6ba38e38..4536753 100644
--- a/remoting/host/desktop_session_agent.cc
+++ b/remoting/host/desktop_session_agent.cc
@@ -371,7 +371,7 @@
bool DesktopSessionAgent::Start(const base::WeakPtr<Delegate>& delegate,
IPC::PlatformFileForTransit* desktop_pipe_out) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
- DCHECK(delegate_.get() == NULL);
+ DCHECK(delegate_.get() == nullptr);
delegate_ = delegate;
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index ec163ca..cb928dd4 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -448,7 +448,7 @@
return i->second;
} else {
LOG(ERROR) << "Failed to find the shared buffer " << id;
- return NULL;
+ return nullptr;
}
}
@@ -478,7 +478,7 @@
scoped_refptr<IpcSharedBufferCore> shared_buffer =
new IpcSharedBufferCore(id, handle, desktop_process_, size);
- if (shared_buffer->memory() != NULL &&
+ if (shared_buffer->memory() != nullptr &&
!shared_buffers_.insert(std::make_pair(id, shared_buffer)).second) {
LOG(ERROR) << "Duplicate shared buffer id " << id << " encountered";
}
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc
index 35fb4f46..c98f229 100644
--- a/remoting/host/desktop_session_win.cc
+++ b/remoting/host/desktop_session_win.cc
@@ -334,7 +334,7 @@
return S_OK;
}
- *ppv = NULL;
+ *ppv = nullptr;
return E_NOINTERFACE;
}
diff --git a/remoting/host/desktop_shape_tracker_win.cc b/remoting/host/desktop_shape_tracker_win.cc
index bec7354..7072d94 100644
--- a/remoting/host/desktop_shape_tracker_win.cc
+++ b/remoting/host/desktop_shape_tracker_win.cc
@@ -67,7 +67,7 @@
old_desktop_region_.Set(shape_data->desktop_region.release());
// Determine the size of output buffer required to receive the region.
- DWORD bytes_size = GetRegionData(old_desktop_region_, 0, NULL);
+ DWORD bytes_size = GetRegionData(old_desktop_region_, 0, nullptr);
CHECK(bytes_size != 0);
// Fetch the Windows RECTs that comprise the region.
diff --git a/remoting/host/disconnect_window_linux.cc b/remoting/host/disconnect_window_linux.cc
index 5680e1d..b913ea55 100644
--- a/remoting/host/disconnect_window_linux.cc
+++ b/remoting/host/disconnect_window_linux.cc
@@ -66,7 +66,7 @@
}
DisconnectWindowGtk::DisconnectWindowGtk()
- : disconnect_window_(NULL),
+ : disconnect_window_(nullptr),
current_width_(0),
current_height_(0) {
}
@@ -76,7 +76,7 @@
if (disconnect_window_) {
gtk_widget_destroy(disconnect_window_);
- disconnect_window_ = NULL;
+ disconnect_window_ = nullptr;
}
}
@@ -145,7 +145,7 @@
g_signal_connect(button_, "clicked", G_CALLBACK(OnClickedThunk), this);
- message_ = gtk_label_new(NULL);
+ message_ = gtk_label_new(nullptr);
gtk_box_pack_end(GTK_BOX(button_row), message_, FALSE, FALSE, 0);
// Override any theme setting for the text color, so that the text is
@@ -196,8 +196,8 @@
current_height_ = event->height;
// Create the depth 1 pixmap for the window shape.
- GdkPixmap* shape_mask = gdk_pixmap_new(NULL, current_width_, current_height_,
- 1);
+ GdkPixmap* shape_mask =
+ gdk_pixmap_new(nullptr, current_width_, current_height_, 1);
cairo_t* cairo_context = gdk_cairo_create(shape_mask);
// Set the arc radius for the corners.
@@ -221,8 +221,8 @@
g_object_unref(shape_mask);
// Create a full-color pixmap for the window background image.
- GdkPixmap* background = gdk_pixmap_new(NULL, current_width_, current_height_,
- 24);
+ GdkPixmap* background =
+ gdk_pixmap_new(nullptr, current_width_, current_height_, 24);
cairo_context = gdk_cairo_create(background);
// Paint the whole bitmap one color.
@@ -267,7 +267,7 @@
gdk_window_set_back_pixmap(widget->window, background, FALSE);
g_object_unref(background);
- gdk_window_invalidate_rect(widget->window, NULL, TRUE);
+ gdk_window_invalidate_rect(widget->window, nullptr, TRUE);
return FALSE;
}
diff --git a/remoting/host/disconnect_window_win.cc b/remoting/host/disconnect_window_win.cc
index b9736efb..fd789d4 100644
--- a/remoting/host/disconnect_window_win.cc
+++ b/remoting/host/disconnect_window_win.cc
@@ -106,7 +106,7 @@
}
DisconnectWindowWin::DisconnectWindowWin()
- : hwnd_(NULL),
+ : hwnd_(nullptr),
has_hotkey_(false),
border_pen_(CreatePen(PS_SOLID, 5,
RGB(0.13 * 255, 0.69 * 255, 0.11 * 255))) {
@@ -134,7 +134,7 @@
UINT message,
WPARAM wparam,
LPARAM lparam) {
- LONG_PTR self = NULL;
+ LONG_PTR self = 0;
if (message == WM_INITDIALOG) {
self = lparam;
@@ -176,7 +176,7 @@
// Ensure we don't try to use the HWND anymore.
case WM_DESTROY:
- hwnd_ = NULL;
+ hwnd_ = nullptr;
// Ensure that the disconnect callback is invoked even if somehow our
// window gets destroyed.
@@ -229,7 +229,7 @@
DCHECK(!hwnd_);
HMODULE module = base::GetModuleFromAddress(&DialogProc);
- hwnd_ = CreateDialogParam(module, MAKEINTRESOURCE(IDD_DISCONNECT), NULL,
+ hwnd_ = CreateDialogParam(module, MAKEINTRESOURCE(IDD_DISCONNECT), nullptr,
DialogProc, reinterpret_cast<LPARAM>(this));
if (!hwnd_)
return false;
@@ -258,7 +258,7 @@
if (hwnd_) {
DestroyWindow(hwnd_);
- hwnd_ = NULL;
+ hwnd_ = nullptr;
}
if (client_session_control_)
@@ -283,7 +283,7 @@
// Try to center the window above the task-bar. If that fails, use the
// primary monitor. If that fails (very unlikely), use the default position.
- HWND taskbar = FindWindow(kShellTrayWindowName, NULL);
+ HWND taskbar = FindWindow(kShellTrayWindowName, nullptr);
HMONITOR monitor = MonitorFromWindow(taskbar, MONITOR_DEFAULTTOPRIMARY);
MONITORINFO monitor_info = {sizeof(monitor_info)};
RECT window_rect;
@@ -294,7 +294,7 @@
int top = monitor_info.rcWork.bottom - window_height;
int left = (monitor_info.rcWork.right + monitor_info.rcWork.left -
window_width) / 2;
- SetWindowPos(hwnd_, NULL, left, top, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
+ SetWindowPos(hwnd_, nullptr, left, top, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}
}
@@ -318,7 +318,7 @@
// Format and truncate "Your desktop is shared with ..." message.
message_text = ReplaceStringPlaceholders(message_text,
base::UTF8ToUTF16(username_),
- NULL);
+ nullptr);
if (message_text.length() > kMaxSharingWithTextLength)
message_text.erase(kMaxSharingWithTextLength);
@@ -342,7 +342,7 @@
return false;
message_rect.right = message_rect.left + control_width + margin;
- if (!SetWindowPos(hwnd_message, NULL,
+ if (!SetWindowPos(hwnd_message, nullptr,
message_rect.left, message_rect.top,
message_rect.right - message_rect.left,
message_rect.bottom - message_rect.top,
@@ -360,7 +360,7 @@
button_rect.left = message_rect.right;
button_rect.right = button_rect.left + control_width + margin * 2;
- if (!SetWindowPos(hwnd_button, NULL,
+ if (!SetWindowPos(hwnd_button, nullptr,
button_rect.left, button_rect.top,
button_rect.right - button_rect.left,
button_rect.bottom - button_rect.top,
@@ -374,7 +374,7 @@
return false;
int width = button_rect.right + margin;
int height = window_rect.bottom - window_rect.top;
- if (!SetWindowPos(hwnd_, NULL, 0, 0, width, height,
+ if (!SetWindowPos(hwnd_, nullptr, 0, 0, width, height,
SWP_NOMOVE | SWP_NOZORDER)) {
return false;
}
diff --git a/remoting/host/dns_blackhole_checker.cc b/remoting/host/dns_blackhole_checker.cc
index 37ed0ae..9e30556 100644
--- a/remoting/host/dns_blackhole_checker.cc
+++ b/remoting/host/dns_blackhole_checker.cc
@@ -39,7 +39,7 @@
} else {
HOST_LOG << "Unable to connect to host talkgadget (" << response << ")";
}
- url_fetcher_.reset(NULL);
+ url_fetcher_.reset(nullptr);
callback_.Run(allow);
callback_.Reset();
}
diff --git a/remoting/host/fake_desktop_capturer.cc b/remoting/host/fake_desktop_capturer.cc
index b684720..56a39cf 100644
--- a/remoting/host/fake_desktop_capturer.cc
+++ b/remoting/host/fake_desktop_capturer.cc
@@ -121,7 +121,7 @@
} // namespace
FakeDesktopCapturer::FakeDesktopCapturer()
- : callback_(NULL) {
+ : callback_(nullptr) {
frame_generator_ = base::Bind(&DefaultFrameGenerator::GenerateFrame,
new DefaultFrameGenerator());
}
diff --git a/remoting/host/fake_mouse_cursor_monitor.cc b/remoting/host/fake_mouse_cursor_monitor.cc
index 5635a48..10facb5 100644
--- a/remoting/host/fake_mouse_cursor_monitor.cc
+++ b/remoting/host/fake_mouse_cursor_monitor.cc
@@ -12,7 +12,7 @@
namespace remoting {
-FakeMouseCursorMonitor::FakeMouseCursorMonitor() : callback_(NULL) {}
+FakeMouseCursorMonitor::FakeMouseCursorMonitor() : callback_(nullptr) {}
FakeMouseCursorMonitor::~FakeMouseCursorMonitor() {}
diff --git a/remoting/host/gnubby_auth_handler_posix_unittest.cc b/remoting/host/gnubby_auth_handler_posix_unittest.cc
index d3e522a..6544c056 100644
--- a/remoting/host/gnubby_auth_handler_posix_unittest.cc
+++ b/remoting/host/gnubby_auth_handler_posix_unittest.cc
@@ -103,7 +103,7 @@
TEST_F(GnubbyAuthHandlerPosixTest, DidClose) {
net::StreamListenSocket* socket = new MockStreamListenSocket(delegate_);
- delegate_->DidAccept(NULL, make_scoped_ptr(socket));
+ delegate_->DidAccept(nullptr, make_scoped_ptr(socket));
ASSERT_TRUE(auth_handler_posix_->HasActiveSocketForTesting(socket));
delegate_->DidClose(socket);
@@ -115,7 +115,7 @@
net::StreamListenSocket* socket = new MockStreamListenSocket(delegate_);
- delegate_->DidAccept(NULL, make_scoped_ptr(socket));
+ delegate_->DidAccept(nullptr, make_scoped_ptr(socket));
delegate_->DidRead(socket,
reinterpret_cast<const char*>(request_data),
sizeof(request_data));
@@ -126,7 +126,7 @@
net::StreamListenSocket* socket = new MockStreamListenSocket(delegate_);
- delegate_->DidAccept(NULL, make_scoped_ptr(socket));
+ delegate_->DidAccept(nullptr, make_scoped_ptr(socket));
for (unsigned int i = 0; i < sizeof(request_data); ++i) {
delegate_->DidRead(
socket, reinterpret_cast<const char*>(request_data + i), 1);
@@ -136,7 +136,7 @@
TEST_F(GnubbyAuthHandlerPosixTest, DidReadTimeout) {
net::StreamListenSocket* socket = new MockStreamListenSocket(delegate_);
- delegate_->DidAccept(NULL, make_scoped_ptr(socket));
+ delegate_->DidAccept(nullptr, make_scoped_ptr(socket));
ASSERT_TRUE(auth_handler_posix_->HasActiveSocketForTesting(socket));
base::MockTimer* mock_timer = new base::MockTimer(false, false);
@@ -151,7 +151,7 @@
TEST_F(GnubbyAuthHandlerPosixTest, ClientErrorMessageDelivered) {
net::StreamListenSocket* socket = new MockStreamListenSocket(delegate_);
- delegate_->DidAccept(NULL, make_scoped_ptr(socket));
+ delegate_->DidAccept(nullptr, make_scoped_ptr(socket));
std::string error_json = base::StringPrintf(
"{\"type\":\"error\",\"connectionId\":%d}",
diff --git a/remoting/host/heartbeat_sender_unittest.cc b/remoting/host/heartbeat_sender_unittest.cc
index 4a6888c..cd9fb558 100644
--- a/remoting/host/heartbeat_sender_unittest.cc
+++ b/remoting/host/heartbeat_sender_unittest.cc
@@ -101,7 +101,7 @@
// Call Start() followed by Stop(), and make sure a valid heartbeat is sent.
TEST_F(HeartbeatSenderTest, DoSendStanza) {
- XmlElement* sent_iq = NULL;
+ XmlElement* sent_iq = nullptr;
EXPECT_CALL(signal_strategy_, GetLocalJid())
.WillRepeatedly(Return(kTestJid));
EXPECT_CALL(signal_strategy_, GetNextId())
@@ -115,7 +115,7 @@
base::RunLoop().RunUntilIdle();
scoped_ptr<XmlElement> stanza(sent_iq);
- ASSERT_TRUE(stanza != NULL);
+ ASSERT_TRUE(stanza != nullptr);
ValidateHeartbeatStanza(stanza.get(), "0", nullptr);
heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED);
@@ -125,7 +125,7 @@
// Call Start() followed by Stop(), twice, and make sure two valid heartbeats
// are sent, with the correct sequence IDs.
TEST_F(HeartbeatSenderTest, DoSendStanzaTwice) {
- XmlElement* sent_iq = NULL;
+ XmlElement* sent_iq = nullptr;
EXPECT_CALL(signal_strategy_, GetLocalJid())
.WillRepeatedly(Return(kTestJid));
EXPECT_CALL(signal_strategy_, GetNextId())
@@ -139,7 +139,7 @@
base::RunLoop().RunUntilIdle();
scoped_ptr<XmlElement> stanza(sent_iq);
- ASSERT_TRUE(stanza != NULL);
+ ASSERT_TRUE(stanza != nullptr);
ValidateHeartbeatStanza(stanza.get(), "0", nullptr);
heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED);
@@ -166,7 +166,7 @@
// reply with an expected sequence ID, and make sure two valid heartbeats
// are sent, with the correct sequence IDs.
TEST_F(HeartbeatSenderTest, DoSendStanzaWithExpectedSequenceId) {
- XmlElement* sent_iq = NULL;
+ XmlElement* sent_iq = nullptr;
EXPECT_CALL(signal_strategy_, GetLocalJid())
.WillRepeatedly(Return(kTestJid));
EXPECT_CALL(signal_strategy_, GetNextId())
@@ -180,10 +180,10 @@
base::RunLoop().RunUntilIdle();
scoped_ptr<XmlElement> stanza(sent_iq);
- ASSERT_TRUE(stanza != NULL);
+ ASSERT_TRUE(stanza != nullptr);
ValidateHeartbeatStanza(stanza.get(), "0", nullptr);
- XmlElement* sent_iq2 = NULL;
+ XmlElement* sent_iq2 = nullptr;
EXPECT_CALL(signal_strategy_, GetLocalJid())
.WillRepeatedly(Return(kTestJid));
EXPECT_CALL(signal_strategy_, GetNextId())
@@ -201,11 +201,11 @@
result->AddElement(expected_sequence_id);
const int kExpectedSequenceId = 456;
expected_sequence_id->AddText(base::IntToString(kExpectedSequenceId));
- heartbeat_sender_->ProcessResponse(false, NULL, response.get());
+ heartbeat_sender_->ProcessResponse(false, nullptr, response.get());
base::RunLoop().RunUntilIdle();
scoped_ptr<XmlElement> stanza2(sent_iq2);
- ASSERT_TRUE(stanza2 != NULL);
+ ASSERT_TRUE(stanza2 != nullptr);
ValidateHeartbeatStanza(stanza2.get(),
base::IntToString(kExpectedSequenceId).c_str(),
nullptr);
@@ -231,7 +231,7 @@
set_interval->AddText(base::IntToString(interval));
heartbeat_sender_->ProcessResponse(
- is_offline_heartbeat_response, NULL, response.get());
+ is_offline_heartbeat_response, nullptr, response.get());
}
// Verify that ProcessResponse parses set-interval result.
@@ -245,7 +245,7 @@
// Make sure SetHostOfflineReason sends a correct stanza.
TEST_F(HeartbeatSenderTest, DoSetHostOfflineReason) {
- XmlElement* sent_iq = NULL;
+ XmlElement* sent_iq = nullptr;
EXPECT_CALL(signal_strategy_, GetLocalJid())
.WillRepeatedly(Return(kTestJid));
EXPECT_CALL(signal_strategy_, GetNextId())
@@ -263,7 +263,7 @@
base::RunLoop().RunUntilIdle();
scoped_ptr<XmlElement> stanza(sent_iq);
- ASSERT_TRUE(stanza != NULL);
+ ASSERT_TRUE(stanza != nullptr);
ValidateHeartbeatStanza(stanza.get(), "0", "test_error");
heartbeat_sender_->OnSignalStrategyStateChange(SignalStrategy::DISCONNECTED);
@@ -327,7 +327,7 @@
EXPECT_EQ(stanza->Attr(buzz::QName(std::string(), "type")), "set");
XmlElement* heartbeat_stanza =
stanza->FirstNamed(QName(kChromotingXmlNamespace, "heartbeat"));
- ASSERT_TRUE(heartbeat_stanza != NULL);
+ ASSERT_TRUE(heartbeat_stanza != nullptr);
EXPECT_EQ(expected_sequence_id, heartbeat_stanza->Attr(
buzz::QName(kChromotingXmlNamespace, "sequence-id")));
if (expected_host_offline_reason == nullptr) {
@@ -342,8 +342,8 @@
QName signature_tag(kChromotingXmlNamespace, "signature");
XmlElement* signature = heartbeat_stanza->FirstNamed(signature_tag);
- ASSERT_TRUE(signature != NULL);
- EXPECT_TRUE(heartbeat_stanza->NextNamed(signature_tag) == NULL);
+ ASSERT_TRUE(signature != nullptr);
+ EXPECT_TRUE(heartbeat_stanza->NextNamed(signature_tag) == nullptr);
scoped_refptr<RsaKeyPair> key_pair = RsaKeyPair::FromString(kTestRsaKeyPair);
ASSERT_TRUE(key_pair.get());
diff --git a/remoting/host/host_event_logger_win.cc b/remoting/host/host_event_logger_win.cc
index 374cddb..050d725 100644
--- a/remoting/host/host_event_logger_win.cc
+++ b/remoting/host/host_event_logger_win.cc
@@ -59,10 +59,10 @@
HostEventLoggerWin::HostEventLoggerWin(base::WeakPtr<HostStatusMonitor> monitor,
const std::string& application_name)
: monitor_(monitor),
- event_log_(NULL) {
+ event_log_(nullptr) {
event_log_ = RegisterEventSourceW(
- NULL, base::UTF8ToUTF16(application_name).c_str());
- if (event_log_ != NULL) {
+ nullptr, base::UTF8ToUTF16(application_name).c_str());
+ if (event_log_ != nullptr) {
monitor_->AddStatusObserver(this);
} else {
PLOG(ERROR) << "Failed to register the event source: " << application_name;
@@ -70,7 +70,7 @@
}
HostEventLoggerWin::~HostEventLoggerWin() {
- if (event_log_ != NULL) {
+ if (event_log_ != nullptr) {
if (monitor_)
monitor_->RemoveStatusObserver(this);
DeregisterEventSource(event_log_);
@@ -113,7 +113,7 @@
void HostEventLoggerWin::Log(WORD type,
DWORD event_id,
const std::vector<std::string>& strings) {
- if (event_log_ == NULL)
+ if (event_log_ == nullptr)
return;
// ReportEventW() takes an array of raw string pointers. They should stay
@@ -129,11 +129,11 @@
type,
HOST_CATEGORY,
event_id,
- NULL,
+ nullptr,
static_cast<WORD>(raw_strings.size()),
0,
&raw_strings[0],
- NULL)) {
+ nullptr)) {
PLOG(ERROR) << "Failed to write an event to the event log";
}
}
diff --git a/remoting/host/host_extension_session_manager.cc b/remoting/host/host_extension_session_manager.cc
index 9fd27170..b6ce83e 100644
--- a/remoting/host/host_extension_session_manager.cc
+++ b/remoting/host/host_extension_session_manager.cc
@@ -16,7 +16,7 @@
const std::vector<HostExtension*>& extensions,
ClientSessionControl* client_session_control)
: client_session_control_(client_session_control),
- client_stub_(NULL),
+ client_stub_(nullptr),
extensions_(extensions) {
}
diff --git a/remoting/host/host_main.cc b/remoting/host/host_main.cc
index 403ff64..b71af2f 100644
--- a/remoting/host/host_main.cc
+++ b/remoting/host/host_main.cc
@@ -135,7 +135,7 @@
// Select the entry point corresponding to the process type.
MainRoutineFn SelectMainRoutine(const std::string& process_type) {
- MainRoutineFn main_routine = NULL;
+ MainRoutineFn main_routine = nullptr;
if (process_type == kProcessTypeHost) {
main_routine = &HostProcessMain;
diff --git a/remoting/host/input_injector_mac.cc b/remoting/host/input_injector_mac.cc
index b51b6152..d3b96d8c5 100644
--- a/remoting/host/input_injector_mac.cc
+++ b/remoting/host/input_injector_mac.cc
@@ -36,7 +36,7 @@
int flags,
const base::string16& unicode) {
base::ScopedCFTypeRef<CGEventRef> eventRef(
- CGEventCreateKeyboardEvent(NULL, keycode, pressed));
+ CGEventCreateKeyboardEvent(nullptr, keycode, pressed));
if (eventRef) {
CGEventSetFlags(eventRef, flags);
if (!unicode.empty())
@@ -303,7 +303,7 @@
int delta_x = static_cast<int>(event.wheel_delta_x());
int delta_y = static_cast<int>(event.wheel_delta_y());
base::ScopedCFTypeRef<CGEventRef> event(CGEventCreateScrollWheelEvent(
- NULL, kCGScrollEventUnitPixel, 2, delta_y, delta_x));
+ nullptr, kCGScrollEventUnitPixel, 2, delta_y, delta_x));
if (event)
CGEventPost(kCGSessionEventTap, event);
}
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc
index 55690da3..53e1604 100644
--- a/remoting/host/input_injector_x11.cc
+++ b/remoting/host/input_injector_x11.cc
@@ -56,8 +56,8 @@
// TODO(sergeyu): Is there a better way to find modifiers state?
for (size_t i = 0; i < arraysize(kModifiersToTry); ++i) {
unsigned long key_sym_with_mods;
- if (XkbLookupKeySym(
- display, *keycode, kModifiersToTry[i], NULL, &key_sym_with_mods) &&
+ if (XkbLookupKeySym(display, *keycode, kModifiersToTry[i], nullptr,
+ &key_sym_with_mods) &&
key_sym_with_mods == key_sym) {
*modifiers = kModifiersToTry[i];
return true;
@@ -230,7 +230,7 @@
latest_mouse_position_(-1, -1),
wheel_ticks_x_(0.0f),
wheel_ticks_y_(0.0f),
- display_(XOpenDisplay(NULL)),
+ display_(XOpenDisplay(nullptr)),
root_window_(BadValue),
saved_auto_repeat_enabled_(false) {
}
@@ -500,7 +500,7 @@
// Instead, try to work around it by reversing the mapping.
// Note that if a user has a global mapping that completely disables a button
// (by assigning 0 to it), we won't be able to inject it.
- int num_buttons = XGetPointerMapping(display_, NULL, 0);
+ int num_buttons = XGetPointerMapping(display_, nullptr, 0);
scoped_ptr<unsigned char[]> pointer_mapping(new unsigned char[num_buttons]);
num_buttons = XGetPointerMapping(display_, pointer_mapping.get(),
num_buttons);
@@ -556,7 +556,8 @@
return;
}
- int num_device_buttons = XGetDeviceButtonMapping(display_, device, NULL, 0);
+ int num_device_buttons =
+ XGetDeviceButtonMapping(display_, device, nullptr, 0);
scoped_ptr<unsigned char[]> button_mapping(new unsigned char[num_buttons]);
for (int i = 0; i < num_device_buttons; i++) {
button_mapping[i] = i + 1;
diff --git a/remoting/host/installer/mac/uninstaller/remoting_uninstaller.mm b/remoting/host/installer/mac/uninstaller/remoting_uninstaller.mm
index eec5e58..4cf1d2d 100644
--- a/remoting/host/installer/mac/uninstaller/remoting_uninstaller.mm
+++ b/remoting/host/installer/mac/uninstaller/remoting_uninstaller.mm
@@ -25,7 +25,7 @@
NSMutableArray* ns_array = [[[NSMutableArray alloc] init] autorelease];
int i = 0;
const char* element = array[i++];
- while (element != NULL) {
+ while (element != nullptr) {
[ns_array addObject:[NSString stringWithUTF8String:element]];
element = array[i++];
}
@@ -85,7 +85,7 @@
NSArray* arg_array = convertToNSArray(args);
NSLog(@"Executing (as Admin): %s %@", cmd,
[arg_array componentsJoinedByString:@" "]);
- FILE* pipe = NULL;
+ FILE* pipe = nullptr;
OSStatus status;
status = AuthorizationExecuteWithPrivileges(authRef, cmd,
kAuthorizationFlagDefaults,
@@ -101,31 +101,31 @@
logOutput(pipe);
}
- if (pipe != NULL)
+ if (pipe != nullptr)
fclose(pipe);
}
- (void)sudoDelete:(const char*)filename
usingAuth:(AuthorizationRef)authRef {
- const char* args[] = { "-rf", filename, NULL };
+ const char* args[] = { "-rf", filename, nullptr };
[self sudoCommand:"/bin/rm" withArguments:args usingAuth:authRef];
}
- (void)shutdownService {
const char* launchCtl = "/bin/launchctl";
- const char* argsStop[] = { "stop", remoting::kServiceName, NULL };
+ const char* argsStop[] = { "stop", remoting::kServiceName, nullptr };
[self runCommand:launchCtl withArguments:argsStop];
if ([[NSFileManager defaultManager] fileExistsAtPath:
[NSString stringWithUTF8String:remoting::kServicePlistPath]]) {
const char* argsUnload[] = { "unload", "-w", "-S", "Aqua",
- remoting::kServicePlistPath, NULL };
+ remoting::kServicePlistPath, nullptr };
[self runCommand:launchCtl withArguments:argsUnload];
}
}
- (void)keystoneUnregisterUsingAuth:(AuthorizationRef)authRef {
- const char* args[] = { "--delete", "--productid", kKeystonePID, "-S", NULL };
+ const char* args[] = {"--delete", "--productid", kKeystonePID, "-S", nullptr};
[self sudoCommand:kKeystoneAdmin withArguments:args usingAuth:authRef];
}
@@ -152,7 +152,7 @@
- (OSStatus)remotingUninstall {
base::mac::ScopedAuthorizationRef authRef;
- OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
+ OSStatus status = AuthorizationCreate(nullptr, kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults, &authRef);
if (status != errAuthorizationSuccess) {
[NSException raise:@"AuthorizationCreate Failure"
@@ -160,13 +160,13 @@
static_cast<int>(status)];
}
- AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0};
+ AuthorizationItem right = {kAuthorizationRightExecute, 0, nullptr, 0};
AuthorizationRights rights = {1, &right};
AuthorizationFlags flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
- status = AuthorizationCopyRights(authRef, &rights, NULL, flags, NULL);
+ status = AuthorizationCopyRights(authRef, &rights, nullptr, flags, nullptr);
if (status == errAuthorizationSuccess) {
RemotingUninstaller* uninstaller =
[[[RemotingUninstaller alloc] init] autorelease];
diff --git a/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm b/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm
index 00878cf2..cf22a9b0e 100644
--- a/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm
+++ b/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm
@@ -40,7 +40,7 @@
NSLog(@"Chrome Remote Desktop Host uninstall complete.");
bool success = false;
- NSString* message = NULL;
+ NSString* message = nullptr;
if (status == errAuthorizationSuccess) {
success = true;
message = @"Chrome Remote Desktop Host successfully uninstalled.";
@@ -53,7 +53,7 @@
format:@"Error during AuthorizationCopyRights status=%d",
static_cast<int>(status)];
}
- if (message != NULL) {
+ if (message != nullptr) {
NSLog(@"Uninstall %s: %@", success ? "succeeded" : "failed", message);
[self showSuccess:success withMessage:message];
}
diff --git a/remoting/host/ipc_desktop_environment_unittest.cc b/remoting/host/ipc_desktop_environment_unittest.cc
index 403b109..9174f67e 100644
--- a/remoting/host/ipc_desktop_environment_unittest.cc
+++ b/remoting/host/ipc_desktop_environment_unittest.cc
@@ -221,8 +221,8 @@
IpcDesktopEnvironmentTest::IpcDesktopEnvironmentTest()
: client_jid_("user@domain/rest-of-jid"),
- clipboard_stub_(NULL),
- remote_input_injector_(NULL),
+ clipboard_stub_(nullptr),
+ remote_input_injector_(nullptr),
terminal_id_(-1),
client_session_control_factory_(&client_session_control_) {
}
@@ -345,7 +345,7 @@
}
InputInjector* IpcDesktopEnvironmentTest::CreateInputInjector() {
- EXPECT_TRUE(remote_input_injector_ == NULL);
+ EXPECT_TRUE(remote_input_injector_ == nullptr);
remote_input_injector_ = new testing::StrictMock<MockInputInjector>();
EXPECT_CALL(*remote_input_injector_, StartPtr(_));
@@ -411,7 +411,7 @@
desktop_process_->OnChannelError();
desktop_process_.reset();
}
- remote_input_injector_ = NULL;
+ remote_input_injector_ = nullptr;
}
void IpcDesktopEnvironmentTest::OnDisconnectCallback() {
@@ -442,8 +442,8 @@
// Stop the test.
DeleteDesktopEnvironment();
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -471,8 +471,8 @@
// Capture a single frame.
video_capturer_->Capture(webrtc::DesktopRegion());
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -499,8 +499,8 @@
// Stop the test.
DeleteDesktopEnvironment();
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -535,8 +535,8 @@
event.set_data("a");
input_injector_->InjectClipboardEvent(event);
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -566,8 +566,8 @@
event.set_pressed(true);
input_injector_->InjectKeyEvent(event);
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -596,8 +596,8 @@
event.set_text("hello");
input_injector_->InjectTextEvent(event);
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -627,8 +627,8 @@
event.set_y(0);
input_injector_->InjectMouseEvent(event);
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
@@ -656,8 +656,8 @@
webrtc::DesktopSize(100, 100),
webrtc::DesktopVector(96, 96)));
- task_runner_ = NULL;
- io_task_runner_ = NULL;
+ task_runner_ = nullptr;
+ io_task_runner_ = nullptr;
main_run_loop_.Run();
}
diff --git a/remoting/host/ipc_mouse_cursor_monitor.cc b/remoting/host/ipc_mouse_cursor_monitor.cc
index 8db099e..7df56db 100644
--- a/remoting/host/ipc_mouse_cursor_monitor.cc
+++ b/remoting/host/ipc_mouse_cursor_monitor.cc
@@ -11,7 +11,7 @@
IpcMouseCursorMonitor::IpcMouseCursorMonitor(
scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
- : callback_(NULL),
+ : callback_(nullptr),
desktop_session_proxy_(desktop_session_proxy),
weak_factory_(this) {
}
diff --git a/remoting/host/ipc_util_win.cc b/remoting/host/ipc_util_win.cc
index 3eeb4d0..dbc5c54 100644
--- a/remoting/host/ipc_util_win.cc
+++ b/remoting/host/ipc_util_win.cc
@@ -64,7 +64,7 @@
SECURITY_ATTRIBUTES security_attributes = {0};
security_attributes.nLength = sizeof(security_attributes);
- security_attributes.lpSecurityDescriptor = NULL;
+ security_attributes.lpSecurityDescriptor = nullptr;
security_attributes.bInheritHandle = TRUE;
// Create the client end of the channel. This code should match the code in
@@ -76,7 +76,7 @@
OPEN_EXISTING,
SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION |
FILE_FLAG_OVERLAPPED,
- NULL));
+ nullptr));
if (!client.IsValid()) {
PLOG(ERROR) << "Failed to connect to '" << pipe_name << "'";
return false;
diff --git a/remoting/host/ipc_video_frame_capturer.cc b/remoting/host/ipc_video_frame_capturer.cc
index 00f3fff..f022d86 100644
--- a/remoting/host/ipc_video_frame_capturer.cc
+++ b/remoting/host/ipc_video_frame_capturer.cc
@@ -11,7 +11,7 @@
IpcVideoFrameCapturer::IpcVideoFrameCapturer(
scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
- : callback_(NULL),
+ : callback_(nullptr),
desktop_session_proxy_(desktop_session_proxy),
capture_pending_(false),
weak_factory_(this) {
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index 93286b3..148dc01 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host.cc
@@ -44,7 +44,7 @@
It2MeNativeMessagingHost::It2MeNativeMessagingHost(
scoped_ptr<ChromotingHostContext> context,
scoped_ptr<It2MeHostFactory> factory)
- : client_(NULL),
+ : client_(nullptr),
host_context_(context.Pass()),
factory_(factory.Pass()),
weak_factory_(this) {
@@ -69,7 +69,7 @@
if (it2me_host_.get()) {
it2me_host_->Disconnect();
- it2me_host_ = NULL;
+ it2me_host_ = nullptr;
}
}
@@ -219,7 +219,7 @@
if (it2me_host_.get()) {
it2me_host_->Disconnect();
- it2me_host_ = NULL;
+ it2me_host_ = nullptr;
}
SendMessageToClient(response.Pass());
}
diff --git a/remoting/host/it2me/it2me_native_messaging_host_main.cc b/remoting/host/it2me/it2me_native_messaging_host_main.cc
index cf30a87f..a89ee529 100644
--- a/remoting/host/it2me/it2me_native_messaging_host_main.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host_main.cc
@@ -71,9 +71,9 @@
XInitThreads();
// Required for any calls into GTK functions, such as the Disconnect and
- // Continue windows. Calling with NULL arguments because we don't have
+ // Continue windows. Calling with nullptr arguments because we don't have
// any command line arguments for gtk to consume.
- gtk_init(NULL, NULL);
+ gtk_init(nullptr, nullptr);
#endif // OS_LINUX
// Enable support for SSL server sockets, which must be done while still
@@ -96,8 +96,8 @@
// the STD* handles at startup. So any LoadLibrary request can potentially
// be blocked. To prevent that from happening we close STDIN and STDOUT
// handles as soon as we retrieve the corresponding file handles.
- SetStdHandle(STD_INPUT_HANDLE, NULL);
- SetStdHandle(STD_OUTPUT_HANDLE, NULL);
+ SetStdHandle(STD_INPUT_HANDLE, nullptr);
+ SetStdHandle(STD_OUTPUT_HANDLE, nullptr);
#elif defined(OS_POSIX)
// The files are automatically closed.
base::File read_file(STDIN_FILENO);
diff --git a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
index c8a387a..d65583c 100644
--- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
@@ -462,7 +462,7 @@
base::RunLoop().RunUntilIdle();
// Trigger a test shutdown via ExitTest().
- host_task_runner_ = NULL;
+ host_task_runner_ = nullptr;
}
void It2MeNativeMessagingHostTest::ExitTest() {
diff --git a/remoting/host/linux/x11_util.cc b/remoting/host/linux/x11_util.cc
index 88935e2..8857a6a 100644
--- a/remoting/host/linux/x11_util.cc
+++ b/remoting/host/linux/x11_util.cc
@@ -8,7 +8,7 @@
namespace remoting {
-static ScopedXErrorHandler* g_handler = NULL;
+static ScopedXErrorHandler* g_handler = nullptr;
ScopedXErrorHandler::ScopedXErrorHandler(const Handler& handler):
handler_(handler),
@@ -17,13 +17,13 @@
// where a mix of ScopedXErrorHandler and raw XSetErrorHandler calls are used,
// and it disallows nested ScopedXErrorHandlers on the same thread, despite
// these being perfectly safe.
- DCHECK(g_handler == NULL);
+ DCHECK(g_handler == nullptr);
g_handler = this;
previous_handler_ = XSetErrorHandler(HandleXErrors);
}
ScopedXErrorHandler::~ScopedXErrorHandler() {
- g_handler = NULL;
+ g_handler = nullptr;
XSetErrorHandler(previous_handler_);
}
@@ -37,7 +37,7 @@
}
int ScopedXErrorHandler::HandleXErrors(Display* display, XErrorEvent* error) {
- DCHECK(g_handler != NULL);
+ DCHECK(g_handler != nullptr);
g_handler->ok_ = false;
g_handler->handler_.Run(display, error);
return 0;
diff --git a/remoting/host/linux/x_server_clipboard.cc b/remoting/host/linux/x_server_clipboard.cc
index 9e636ac..b587e9a 100644
--- a/remoting/host/linux/x_server_clipboard.cc
+++ b/remoting/host/linux/x_server_clipboard.cc
@@ -15,7 +15,7 @@
namespace remoting {
XServerClipboard::XServerClipboard()
- : display_(NULL),
+ : display_(nullptr),
clipboard_window_(BadValue),
xfixes_event_base_(-1),
clipboard_atom_(None),
diff --git a/remoting/host/linux/x_server_clipboard_unittest.cc b/remoting/host/linux/x_server_clipboard_unittest.cc
index ea8ae5a..f7c090b 100644
--- a/remoting/host/linux/x_server_clipboard_unittest.cc
+++ b/remoting/host/linux/x_server_clipboard_unittest.cc
@@ -20,7 +20,7 @@
class ClipboardTestClient {
public:
- ClipboardTestClient() : display_(NULL) {}
+ ClipboardTestClient() : display_(nullptr) {}
~ClipboardTestClient() {}
void Init(Display* display) {
@@ -71,10 +71,10 @@
void SetUp() override {
// XSynchronize() ensures that PumpXEvents() fully processes all X server
// requests and responses before returning to the caller.
- Display* display1 = XOpenDisplay(NULL);
+ Display* display1 = XOpenDisplay(nullptr);
XSynchronize(display1, True);
client1_.Init(display1);
- Display* display2 = XOpenDisplay(NULL);
+ Display* display2 = XOpenDisplay(nullptr);
XSynchronize(display2, True);
client2_.Init(display2);
}
diff --git a/remoting/host/local_input_monitor_mac.mm b/remoting/host/local_input_monitor_mac.mm
index d425658..e3bd3d5 100644
--- a/remoting/host/local_input_monitor_mac.mm
+++ b/remoting/host/local_input_monitor_mac.mm
@@ -86,7 +86,7 @@
webrtc::DesktopVector mousePos(cgMousePos.x, cgMousePos.y);
[static_cast<LocalInputMonitorManager*>(context) localMouseMoved:mousePos];
}
- return NULL;
+ return nullptr;
}
@implementation LocalInputMonitorManager
@@ -111,7 +111,7 @@
1 << kCGEventMouseMoved, LocalMouseMoved, self));
if (mouseMachPort_) {
mouseRunLoopSource_ = CFMachPortCreateRunLoopSource(
- NULL, mouseMachPort_, 0);
+ nullptr, mouseMachPort_, 0);
CFRunLoopAddSource(
CFRunLoopGetMain(), mouseRunLoopSource_, kCFRunLoopCommonModes);
} else {
@@ -138,7 +138,7 @@
GTMCarbonEventDispatcherHandler* handler =
[GTMCarbonEventDispatcherHandler sharedEventDispatcherHandler];
[handler unregisterHotKey:hotKey_];
- hotKey_ = NULL;
+ hotKey_ = nullptr;
}
if (mouseRunLoopSource_) {
CFMachPortInvalidate(mouseMachPort_);
@@ -146,7 +146,7 @@
CFRunLoopGetMain(), mouseRunLoopSource_, kCFRunLoopCommonModes);
CFRelease(mouseRunLoopSource_);
mouseMachPort_.reset(0);
- mouseRunLoopSource_ = NULL;
+ mouseRunLoopSource_ = nullptr;
}
}
diff --git a/remoting/host/local_input_monitor_unittest.cc b/remoting/host/local_input_monitor_unittest.cc
index 335e2201..e0dd938 100644
--- a/remoting/host/local_input_monitor_unittest.cc
+++ b/remoting/host/local_input_monitor_unittest.cc
@@ -80,7 +80,7 @@
task_runner_,
task_runner_,
client_session_control_factory_.GetWeakPtr());
- task_runner_ = NULL;
+ task_runner_ = nullptr;
}
run_loop_.Run();
diff --git a/remoting/host/local_input_monitor_win.cc b/remoting/host/local_input_monitor_win.cc
index a387b80..969c5a97 100644
--- a/remoting/host/local_input_monitor_win.cc
+++ b/remoting/host/local_input_monitor_win.cc
@@ -148,7 +148,7 @@
device.dwFlags = RIDEV_REMOVE;
device.usUsagePage = kGenericDesktopPage;
device.usUsage = kMouseUsage;
- device.hwndTarget = NULL;
+ device.hwndTarget = nullptr;
// The error is harmless, ignore it.
RegisterRawInputDevices(&device, 1, sizeof(device));
@@ -164,7 +164,7 @@
UINT size = 0;
UINT result = GetRawInputData(input_handle,
RID_INPUT,
- NULL,
+ nullptr,
&size,
sizeof(RAWINPUTHEADER));
if (result == -1) {
@@ -188,7 +188,7 @@
// Notify the observer about mouse events generated locally. Remote (injected)
// mouse events do not specify a device handle (based on observed behavior).
if (input->header.dwType == RIM_TYPEMOUSE &&
- input->header.hDevice != NULL) {
+ input->header.hDevice != nullptr) {
POINT position;
if (!GetCursorPos(&position)) {
position.x = 0;
diff --git a/remoting/host/local_input_monitor_x11.cc b/remoting/host/local_input_monitor_x11.cc
index 1da192f..9e410f8f 100644
--- a/remoting/host/local_input_monitor_x11.cc
+++ b/remoting/host/local_input_monitor_x11.cc
@@ -125,14 +125,14 @@
client_session_control_(client_session_control),
alt_pressed_(false),
ctrl_pressed_(false),
- display_(NULL),
- x_record_display_(NULL),
+ display_(nullptr),
+ x_record_display_(nullptr),
x_record_context_(0) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
DCHECK(client_session_control_.get());
- x_record_range_[0] = NULL;
- x_record_range_[1] = NULL;
+ x_record_range_[0] = nullptr;
+ x_record_range_[1] = nullptr;
}
void LocalInputMonitorX11::Core::Start() {
@@ -170,8 +170,8 @@
// and both channels are used from a separate thread, we'll need to duplicate
// them with something like the following:
// XOpenDisplay(DisplayString(display));
- display_ = XOpenDisplay(NULL);
- x_record_display_ = XOpenDisplay(NULL);
+ display_ = XOpenDisplay(nullptr);
+ x_record_display_ = XOpenDisplay(nullptr);
if (!display_ || !x_record_display_) {
LOG(ERROR) << "Couldn't open X display";
return;
@@ -245,11 +245,11 @@
if (x_record_range_[0]) {
XFree(x_record_range_[0]);
- x_record_range_[0] = NULL;
+ x_record_range_[0] = nullptr;
}
if (x_record_range_[1]) {
XFree(x_record_range_[1]);
- x_record_range_[1] = NULL;
+ x_record_range_[1] = nullptr;
}
if (x_record_context_) {
XRecordFreeContext(x_record_display_, x_record_context_);
@@ -257,11 +257,11 @@
}
if (x_record_display_) {
XCloseDisplay(x_record_display_);
- x_record_display_ = NULL;
+ x_record_display_ = nullptr;
}
if (display_) {
XCloseDisplay(display_);
- display_ = NULL;
+ display_ = nullptr;
}
}
diff --git a/remoting/host/mac/me2me_preference_pane.mm b/remoting/host/mac/me2me_preference_pane.mm
index d07fdb4..9bcae54 100644
--- a/remoting/host/mac/me2me_preference_pane.mm
+++ b/remoting/host/mac/me2me_preference_pane.mm
@@ -102,7 +102,7 @@
// MessageForJob sends a single message to launchd with a simple dictionary
// mapping |operation| to |job_label|, and returns the result of calling
-// launch_msg to send that message. On failure, returns NULL. The caller
+// launch_msg to send that message. On failure, returns nullptr. The caller
// assumes ownership of the returned launch_data_t object.
launch_data_t MessageForJob(const std::string& job_label,
const char* operation) {
@@ -110,7 +110,7 @@
ScopedLaunchData message(launch_data_alloc(LAUNCH_DATA_DICTIONARY));
if (!message) {
NSLog(@"launch_data_alloc");
- return NULL;
+ return nullptr;
}
// launch_data_new_string returns something that needs to be freed, but
@@ -120,13 +120,13 @@
ScopedLaunchData job_label_launchd(launch_data_new_string(job_label.c_str()));
if (!job_label_launchd) {
NSLog(@"launch_data_new_string");
- return NULL;
+ return nullptr;
}
if (!launch_data_dict_insert(message,
job_label_launchd.release(),
operation)) {
- return NULL;
+ return nullptr;
}
return launch_msg(message);
@@ -167,8 +167,8 @@
const char** arguments,
FILE** pipe,
pid_t* pid) {
- // pipe may be NULL, but this function needs one. In that case, use a local
- // pipe.
+ // pipe may be nullptr, but this function needs one. In that case, use a
+ // local pipe.
FILE* local_pipe;
FILE** pipe_pointer;
if (pipe) {
@@ -202,7 +202,7 @@
std::string line(line_c, line_length);
// The version in base/mac used base::StringToInt() here.
- line_pid = strtol(line.c_str(), NULL, 10);
+ line_pid = strtol(line.c_str(), nullptr, 10);
if (line_pid == 0) {
NSLog(@"ExecuteWithPrivilegesAndGetPid: funny line: %s", line.c_str());
line_pid = -1;
@@ -553,8 +553,8 @@
// TODO(lambroslambrou): Replace the deprecated ExecuteWithPrivileges
// call with a launchd-based helper tool, which is more secure.
// http://crbug.com/120903
- const char* arguments[] = { command, NULL };
- FILE* pipe = NULL;
+ const char* arguments[] = { command, nullptr };
+ FILE* pipe = nullptr;
pid_t pid;
OSStatus status = base::mac::ExecuteWithPrivilegesAndGetPID(
authorization,
@@ -576,7 +576,7 @@
return NO;
}
if (!pipe) {
- NSLog(@"Unexpected NULL pipe");
+ NSLog(@"Unexpected nullptr pipe");
return NO;
}
diff --git a/remoting/host/mouse_clamping_filter.cc b/remoting/host/mouse_clamping_filter.cc
index 91462fa3..d9c545a 100644
--- a/remoting/host/mouse_clamping_filter.cc
+++ b/remoting/host/mouse_clamping_filter.cc
@@ -12,7 +12,7 @@
MouseClampingFilter::MouseClampingFilter(
protocol::InputStub* input_stub)
: input_filter_(input_stub),
- video_stub_(NULL) {
+ video_stub_(nullptr) {
}
MouseClampingFilter::~MouseClampingFilter() {
diff --git a/remoting/host/native_messaging/native_messaging_writer_unittest.cc b/remoting/host/native_messaging/native_messaging_writer_unittest.cc
index 38817fd6..fddd7e7a 100644
--- a/remoting/host/native_messaging/native_messaging_writer_unittest.cc
+++ b/remoting/host/native_messaging/native_messaging_writer_unittest.cc
@@ -55,7 +55,7 @@
// Nothing more should have been written. Close the write-end of the pipe,
// and verify the read end immediately hits EOF.
- writer_.reset(NULL);
+ writer_.reset(nullptr);
char unused;
read = read_file_.ReadAtCurrentPos(&unused, 1);
EXPECT_LE(read, 0);
@@ -67,7 +67,7 @@
message2.SetInteger("foo", 42);
EXPECT_TRUE(writer_->WriteMessage(message1));
EXPECT_TRUE(writer_->WriteMessage(message2));
- writer_.reset(NULL);
+ writer_.reset(nullptr);
// Read two messages.
uint32 length;
diff --git a/remoting/host/native_messaging/pipe_messaging_channel.cc b/remoting/host/native_messaging/pipe_messaging_channel.cc
index 399bfa8a..becd7101 100644
--- a/remoting/host/native_messaging/pipe_messaging_channel.cc
+++ b/remoting/host/native_messaging/pipe_messaging_channel.cc
@@ -49,7 +49,7 @@
: native_messaging_reader_(DuplicatePlatformFile(input.Pass())),
native_messaging_writer_(new NativeMessagingWriter(
DuplicatePlatformFile(output.Pass()))),
- event_handler_(NULL),
+ event_handler_(nullptr),
weak_factory_(this) {
weak_ptr_ = weak_factory_.GetWeakPtr();
}
@@ -95,12 +95,13 @@
DCHECK(CalledOnValidThread());
if (event_handler_) {
- // Set event_handler_ to NULL to indicate the object is in a shutdown cycle.
- // Since event_handler->OnDisconnect() will destroy the current object,
- // |event_handler_| will become a dangling pointer after OnDisconnect()
- // returns. Therefore, we set |event_handler_| to NULL beforehand.
+ // Set |event_handler_| to nullptr to indicate the object is in a shutdown
+ // cycle. Since event_handler->OnDisconnect() will destroy the current
+ // object, |event_handler_| will become a dangling pointer after
+ // OnDisconnect() returns. Therefore, we set |event_handler_| to nullptr
+ // beforehand.
EventHandler* handler = event_handler_;
- event_handler_ = NULL;
+ event_handler_ = nullptr;
handler->OnDisconnect();
}
}
diff --git a/remoting/host/pairing_registry_delegate.h b/remoting/host/pairing_registry_delegate.h
index b25836e..a5e96b9 100644
--- a/remoting/host/pairing_registry_delegate.h
+++ b/remoting/host/pairing_registry_delegate.h
@@ -15,7 +15,7 @@
namespace remoting {
// Returns a platform-specific pairing registry delegate that will save to
-// permanent storage. Returns NULL on platforms that don't support pairing.
+// permanent storage. Returns nullptr on platforms that don't support pairing.
scoped_ptr<protocol::PairingRegistry::Delegate>
CreatePairingRegistryDelegate();
diff --git a/remoting/host/pairing_registry_delegate_win.h b/remoting/host/pairing_registry_delegate_win.h
index 844f6af3..9f9d4dc 100644
--- a/remoting/host/pairing_registry_delegate_win.h
+++ b/remoting/host/pairing_registry_delegate_win.h
@@ -38,7 +38,7 @@
// - |unprivileged| - contains the rest of pairing state.
//
// Creator of this object is responsible for passing the registry key handles
-// with appropriate access. |privileged| may be NULL if read-only access is
+// with appropriate access. |privileged| may be nullptr if read-only access is
// sufficient. Shared secrets will not be returned in such a case.
class PairingRegistryDelegateWin
: public protocol::PairingRegistry::Delegate {
@@ -47,8 +47,8 @@
virtual ~PairingRegistryDelegateWin();
// Passes the root keys to be used to access the pairing registry store.
- // |privileged| is optional and may be NULL. The caller retains ownership of
- // the passed handles.
+ // |privileged| is optional and may be nullptr. The caller retains ownership
+ // of the passed handles.
bool SetRootKeys(HKEY privileged, HKEY unprivileged);
// PairingRegistry::Delegate interface
diff --git a/remoting/host/pairing_registry_delegate_win_unittest.cc b/remoting/host/pairing_registry_delegate_win_unittest.cc
index 2577946..7801926 100644
--- a/remoting/host/pairing_registry_delegate_win_unittest.cc
+++ b/remoting/host/pairing_registry_delegate_win_unittest.cc
@@ -112,7 +112,7 @@
// Strip the delegate from write access and validate that it still can be used
// to read the pairings.
delegate.reset(new PairingRegistryDelegateWin());
- delegate->SetRootKeys(NULL, unprivileged_.Handle());
+ delegate->SetRootKeys(nullptr, unprivileged_.Handle());
PairingRegistry::Pairing unprivileged_pairing =
delegate->Load(pairing.client_id());
diff --git a/remoting/host/pam_authorization_factory_posix.cc b/remoting/host/pam_authorization_factory_posix.cc
index 72f89d5..6e964e68 100644
--- a/remoting/host/pam_authorization_factory_posix.cc
+++ b/remoting/host/pam_authorization_factory_posix.cc
@@ -111,8 +111,8 @@
if (username.empty()) {
return false;
}
- struct pam_conv conv = { PamConversation, NULL };
- pam_handle_t* handle = NULL;
+ struct pam_conv conv = { PamConversation, nullptr };
+ pam_handle_t* handle = nullptr;
int result = pam_start("chrome-remote-desktop", username.c_str(),
&conv, &handle);
if (result == PAM_SUCCESS) {
diff --git a/remoting/host/policy_hack/policy_watcher.cc b/remoting/host/policy_hack/policy_watcher.cc
index d0f5957..a4afb74 100644
--- a/remoting/host/policy_hack/policy_watcher.cc
+++ b/remoting/host/policy_hack/policy_watcher.cc
@@ -40,7 +40,7 @@
for (base::DictionaryValue::Iterator i(*default_values);
!i.IsAtEnd(); i.Advance()) {
- const base::Value* value = NULL;
+ const base::Value* value = nullptr;
// If the policy isn't in |from|, use the default.
if (!from->Get(i.key(), &value)) {
diff --git a/remoting/host/policy_hack/policy_watcher_linux.cc b/remoting/host/policy_hack/policy_watcher_linux.cc
index 20724b81..8eea9796 100644
--- a/remoting/host/policy_hack/policy_watcher_linux.cc
+++ b/remoting/host/policy_hack/policy_watcher_linux.cc
@@ -125,7 +125,7 @@
return last_modification;
}
- // Returns NULL if the policy dictionary couldn't be read.
+ // Returns nullptr if the policy dictionary couldn't be read.
scoped_ptr<base::DictionaryValue> Load() {
DCHECK(OnPolicyWatcherThread());
// Enumerate the files and sort them lexicographically.
diff --git a/remoting/host/policy_hack/policy_watcher_mac.mm b/remoting/host/policy_hack/policy_watcher_mac.mm
index 23e223b..63d33077 100644
--- a/remoting/host/policy_hack/policy_watcher_mac.mm
+++ b/remoting/host/policy_hack/policy_watcher_mac.mm
@@ -60,10 +60,10 @@
if (i.value().GetType() == base::DictionaryValue::TYPE_STRING) {
base::ScopedCFTypeRef<CFPropertyListRef> property_list(
CFPreferencesCopyAppValue(policy_key, policy_bundle_id));
- if (property_list.get() != NULL) {
+ if (property_list.get() != nullptr) {
CFStringRef policy_value = base::mac::CFCast<CFStringRef>(
property_list.get());
- if (policy_value != NULL) {
+ if (policy_value != nullptr) {
policy.SetString(policy_name,
base::SysCFStringRefToUTF8(policy_value));
}
diff --git a/remoting/host/posix/signal_handler.cc b/remoting/host/posix/signal_handler.cc
index 30abf59..9ad733e 100644
--- a/remoting/host/posix/signal_handler.cc
+++ b/remoting/host/posix/signal_handler.cc
@@ -62,7 +62,7 @@
}
}
-SignalListener* g_signal_listener = NULL;
+SignalListener* g_signal_listener = nullptr;
int g_write_fd = 0;
void GlobalSignalHandler(int signal) {
diff --git a/remoting/host/register_support_host_request.cc b/remoting/host/register_support_host_request.cc
index 89e56059..c0a80d1 100644
--- a/remoting/host/register_support_host_request.cc
+++ b/remoting/host/register_support_host_request.cc
@@ -176,7 +176,7 @@
request_.reset();
iq_sender_.reset();
signal_strategy_->RemoveListener(this);
- signal_strategy_ = NULL;
+ signal_strategy_ = nullptr;
RegisterCallback callback = callback_;
callback_.Reset();
diff --git a/remoting/host/register_support_host_request_unittest.cc b/remoting/host/register_support_host_request_unittest.cc
index 3278345..0f94b44 100644
--- a/remoting/host/register_support_host_request_unittest.cc
+++ b/remoting/host/register_support_host_request_unittest.cc
@@ -85,7 +85,7 @@
base::Bind(&MockCallback::OnResponse,
base::Unretained(&callback_))));
- XmlElement* sent_iq = NULL;
+ XmlElement* sent_iq = nullptr;
EXPECT_CALL(signal_strategy_, GetNextId())
.WillOnce(Return(kStanzaId));
EXPECT_CALL(signal_strategy_, SendStanzaPtr(NotNull()))
@@ -96,7 +96,7 @@
// Verify format of the query.
scoped_ptr<XmlElement> stanza(sent_iq);
- ASSERT_TRUE(stanza != NULL);
+ ASSERT_TRUE(stanza != nullptr);
EXPECT_EQ(stanza->Attr(buzz::QName(std::string(), "to")),
std::string(kTestBotJid));
@@ -107,8 +107,8 @@
QName signature_tag(kChromotingXmlNamespace, "signature");
XmlElement* signature = stanza->FirstElement()->FirstNamed(signature_tag);
- ASSERT_TRUE(signature != NULL);
- EXPECT_TRUE(stanza->NextNamed(signature_tag) == NULL);
+ ASSERT_TRUE(signature != nullptr);
+ EXPECT_TRUE(stanza->NextNamed(signature_tag) == nullptr);
std::string time_str =
signature->Attr(QName(kChromotingXmlNamespace, "time"));
@@ -152,7 +152,7 @@
ObserverListBase<SignalStrategy::Listener>::Iterator it(
signal_strategy_listeners_);
SignalStrategy::Listener* listener;
- while ((listener = it.GetNext()) != NULL) {
+ while ((listener = it.GetNext()) != nullptr) {
if (listener->OnSignalStrategyIncomingStanza(response.get()))
consumed++;
}
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 2b80763..74ce044c 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -205,8 +205,8 @@
// STOPPING->STOPPED
// STOPPED->STARTED
//
- // |host_| must be NULL in INITIALIZING and STOPPED states and not-NULL in
- // all other states.
+ // |host_| must be nullptr in INITIALIZING and STOPPED states and not
+ // nullptr in all other states.
};
friend class base::RefCountedThreadSafe<HostProcess>;
@@ -385,7 +385,7 @@
enable_window_capture_(false),
window_id_(0),
#if defined(REMOTING_MULTI_PROCESS)
- desktop_session_connector_(NULL),
+ desktop_session_connector_(nullptr),
#endif // defined(REMOTING_MULTI_PROCESS)
self_(this),
exit_code_out_(exit_code_out),
@@ -782,14 +782,14 @@
desktop_environment_factory_.reset();
// It is now safe for the HostProcess to be deleted.
- self_ = NULL;
+ self_ = nullptr;
#if defined(OS_LINUX)
// Cause the global AudioPipeReader to be freed, otherwise the audio
// thread will remain in-use and prevent the process from exiting.
// TODO(wez): DesktopEnvironmentFactory should own the pipe reader.
// See crbug.com/161373 and crbug.com/104544.
- AudioCapturerLinux::InitializePipeReader(NULL, base::FilePath());
+ AudioCapturerLinux::InitializePipeReader(nullptr, base::FilePath());
#endif
}
@@ -833,7 +833,7 @@
IPC::PlatformFileForTransit privileged_key,
IPC::PlatformFileForTransit unprivileged_key) {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- // |privileged_key| can be NULL but not |unprivileged_key|.
+ // |privileged_key| can be nullptr but not |unprivileged_key|.
DCHECK(unprivileged_key);
// |pairing_registry_| should only be initialized once.
DCHECK(!pairing_registry_);
@@ -1510,7 +1510,7 @@
// Required for any calls into GTK functions, such as the Disconnect and
// Continue windows, though these should not be used for the Me2Me case
// (crbug.com/104377).
- gtk_init(NULL, NULL);
+ gtk_init(nullptr, nullptr);
#endif
// Enable support for SSL server sockets, which must be done while still
diff --git a/remoting/host/resizing_host_observer_unittest.cc b/remoting/host/resizing_host_observer_unittest.cc
index 9941a1b3..f25465a 100644
--- a/remoting/host/resizing_host_observer_unittest.cc
+++ b/remoting/host/resizing_host_observer_unittest.cc
@@ -92,7 +92,7 @@
class ResizingHostObserverTest : public testing::Test {
public:
ResizingHostObserverTest()
- : desktop_resizer_(NULL),
+ : desktop_resizer_(nullptr),
now_(base::Time::Now()) {
}
@@ -145,10 +145,10 @@
int restore_resolution_call_count = 0;
ScreenResolution initial = MakeResolution(640, 480);
scoped_ptr<FakeDesktopResizer> desktop_resizer(
- new FakeDesktopResizer(initial, false, NULL, 0,
+ new FakeDesktopResizer(initial, false, nullptr, 0,
&restore_resolution_call_count));
SetDesktopResizer(desktop_resizer.Pass());
- VerifySizes(NULL, NULL, 0);
+ VerifySizes(nullptr, nullptr, 0);
resizing_host_observer_.reset();
EXPECT_EQ(0, restore_resolution_call_count);
}
@@ -159,7 +159,7 @@
int restore_resolution_call_count = 0;
ScreenResolution initial = MakeResolution(640, 480);
scoped_ptr<FakeDesktopResizer> desktop_resizer(
- new FakeDesktopResizer(initial, false, NULL, 0,
+ new FakeDesktopResizer(initial, false, nullptr, 0,
&restore_resolution_call_count));
SetDesktopResizer(desktop_resizer.Pass());
@@ -176,7 +176,7 @@
TEST_F(ResizingHostObserverTest, SelectExactSize) {
int restore_resolution_call_count = 0;
scoped_ptr<FakeDesktopResizer> desktop_resizer(
- new FakeDesktopResizer(MakeResolution(640, 480), true, NULL, 0,
+ new FakeDesktopResizer(MakeResolution(640, 480), true, nullptr, 0,
&restore_resolution_call_count));
SetDesktopResizer(desktop_resizer.Pass());
@@ -198,7 +198,7 @@
scoped_ptr<FakeDesktopResizer> desktop_resizer(
new FakeDesktopResizer(MakeResolution(640, 480), false,
supported_sizes, arraysize(supported_sizes),
- NULL));
+ nullptr));
SetDesktopResizer(desktop_resizer.Pass());
ScreenResolution client_sizes[] = { MakeResolution(639, 479),
@@ -218,7 +218,7 @@
scoped_ptr<FakeDesktopResizer> desktop_resizer(
new FakeDesktopResizer(MakeResolution(200, 100), false,
supported_sizes, arraysize(supported_sizes),
- NULL));
+ nullptr));
SetDesktopResizer(desktop_resizer.Pass());
ScreenResolution client_sizes[] = { MakeResolution(1, 1),
@@ -237,7 +237,7 @@
scoped_ptr<FakeDesktopResizer> desktop_resizer(
new FakeDesktopResizer(MakeResolution(480, 640), false,
supported_sizes, arraysize(supported_sizes),
- NULL));
+ nullptr));
SetDesktopResizer(desktop_resizer.Pass());
ScreenResolution client_sizes[] = { MakeResolution(100, 100),
@@ -258,7 +258,7 @@
MakeResolution(480, 640) };
SetDesktopResizer(make_scoped_ptr(new FakeDesktopResizer(
MakeResolution(480, 640), false,
- supported_sizes, arraysize(supported_sizes), NULL)));
+ supported_sizes, arraysize(supported_sizes), nullptr)));
ScreenResolution client_sizes[] = { MakeResolution(640, 640),
MakeResolution(1024, 768),
@@ -273,8 +273,8 @@
// Check that desktop resizes are rate-limited, and that if multiple resize
// requests are received in the time-out period, the most recent is respected.
TEST_F(ResizingHostObserverTest, RateLimited) {
- SetDesktopResizer(make_scoped_ptr(
- new FakeDesktopResizer(MakeResolution(640, 480), true, NULL, 0, NULL)));
+ SetDesktopResizer(make_scoped_ptr(new FakeDesktopResizer(
+ MakeResolution(640, 480), true, nullptr, 0, nullptr)));
resizing_host_observer_->SetNowFunctionForTesting(
base::Bind(&ResizingHostObserverTest::GetTime, base::Unretained(this)));
diff --git a/remoting/host/sas_injector.h b/remoting/host/sas_injector.h
index d5a30a4..a77485a 100644
--- a/remoting/host/sas_injector.h
+++ b/remoting/host/sas_injector.h
@@ -19,7 +19,7 @@
virtual bool InjectSas() = 0;
// Creates an instance of SasInjector if supported by the OS, otherwise
- // returns NULL.
+ // returns nullptr.
static scoped_ptr<SasInjector> Create();
};
diff --git a/remoting/host/sas_injector_win.cc b/remoting/host/sas_injector_win.cc
index eb48ed2..53e98b1 100644
--- a/remoting/host/sas_injector_win.cc
+++ b/remoting/host/sas_injector_win.cc
@@ -131,7 +131,7 @@
virtual bool InjectSas() override;
};
-SasInjectorWin::SasInjectorWin() : send_sas_(NULL) {
+SasInjectorWin::SasInjectorWin() : send_sas_(nullptr) {
}
SasInjectorWin::~SasInjectorWin() {
@@ -148,7 +148,7 @@
}
sas_dll_.Reset(base::LoadNativeLibrary(dir_path.Append(kSasDllFileName),
- NULL));
+ nullptr));
}
if (!sas_dll_.is_valid()) {
LOG(ERROR) << "Failed to load '" << kSasDllFileName << "'";
@@ -156,11 +156,11 @@
}
// Get the pointer to sas!SendSAS().
- if (send_sas_ == NULL) {
+ if (send_sas_ == nullptr) {
send_sas_ = reinterpret_cast<SendSasFunc>(
sas_dll_.GetFunctionPointer(kSendSasName));
}
- if (send_sas_ == NULL) {
+ if (send_sas_ == nullptr) {
LOG(ERROR) << "Failed to retrieve the address of '" << kSendSasName
<< "()'";
return false;
diff --git a/remoting/host/setup/daemon_controller.cc b/remoting/host/setup/daemon_controller.cc
index dd0b1d9..41221fe 100644
--- a/remoting/host/setup/daemon_controller.cc
+++ b/remoting/host/setup/daemon_controller.cc
@@ -128,7 +128,7 @@
delegate_task_runner_->DeleteSoon(FROM_HERE, delegate_.release());
// Stop the thread.
- delegate_task_runner_ = NULL;
+ delegate_task_runner_ = nullptr;
caller_task_runner_->DeleteSoon(FROM_HERE, delegate_thread_.release());
}
diff --git a/remoting/host/setup/daemon_controller.h b/remoting/host/setup/daemon_controller.h
index f757f78..522a8402 100644
--- a/remoting/host/setup/daemon_controller.h
+++ b/remoting/host/setup/daemon_controller.h
@@ -74,7 +74,7 @@
// Callback type for GetConfig(). If the host is configured then a dictionary
// is returned containing host_id and xmpp_login, with security-sensitive
// fields filtered out. An empty dictionary is returned if the host is not
- // configured, and NULL if the configuration is corrupt or cannot be read.
+ // configured, and nullptr if the configuration is corrupt or cannot be read.
typedef base::Callback<void (scoped_ptr<base::DictionaryValue> config)>
GetConfigCallback;
diff --git a/remoting/host/setup/daemon_controller_delegate_mac.mm b/remoting/host/setup/daemon_controller_delegate_mac.mm
index 788475e..76499c6 100644
--- a/remoting/host/setup/daemon_controller_delegate_mac.mm
+++ b/remoting/host/setup/daemon_controller_delegate_mac.mm
@@ -171,14 +171,14 @@
this,
&DaemonControllerDelegateMac::PreferencePaneCallback,
CFSTR(UPDATE_SUCCEEDED_NOTIFICATION_NAME),
- NULL,
+ nullptr,
CFNotificationSuspensionBehaviorDeliverImmediately);
CFNotificationCenterAddObserver(
CFNotificationCenterGetDistributedCenter(),
this,
&DaemonControllerDelegateMac::PreferencePaneCallback,
CFSTR(UPDATE_FAILED_NOTIFICATION_NAME),
- NULL,
+ nullptr,
CFNotificationSuspensionBehaviorDeliverImmediately);
}
@@ -187,12 +187,12 @@
CFNotificationCenterGetDistributedCenter(),
this,
CFSTR(UPDATE_SUCCEEDED_NOTIFICATION_NAME),
- NULL);
+ nullptr);
CFNotificationCenterRemoveObserver(
CFNotificationCenterGetDistributedCenter(),
this,
CFSTR(UPDATE_FAILED_NOTIFICATION_NAME),
- NULL);
+ nullptr);
}
void DaemonControllerDelegateMac::PreferencePaneCallbackDelegate(
@@ -251,7 +251,7 @@
LOG(ERROR) << "Failed to create FSRef";
return false;
}
- OSStatus status = LSOpenFSRef(&pane_path_ref, NULL);
+ OSStatus status = LSOpenFSRef(&pane_path_ref, nullptr);
if (status != noErr) {
OSSTATUS_LOG(ERROR, status) << "LSOpenFSRef failed for path: "
<< pane_path.value();
@@ -262,7 +262,7 @@
CFNotificationCenterGetDistributedCenter();
base::ScopedCFTypeRef<CFStringRef> service_name(CFStringCreateWithCString(
kCFAllocatorDefault, remoting::kServiceName, kCFStringEncodingUTF8));
- CFNotificationCenterPostNotification(center, service_name, NULL, NULL,
+ CFNotificationCenterPostNotification(center, service_name, nullptr, nullptr,
TRUE);
return true;
}
@@ -277,7 +277,7 @@
DaemonControllerDelegateMac* self =
reinterpret_cast<DaemonControllerDelegateMac*>(observer);
if (!self) {
- LOG(WARNING) << "Ignoring notification with NULL observer: " << name;
+ LOG(WARNING) << "Ignoring notification with nullptr observer: " << name;
return;
}
diff --git a/remoting/host/setup/daemon_controller_delegate_win.cc b/remoting/host/setup/daemon_controller_delegate_win.cc
index 02e6698..628dfac 100644
--- a/remoting/host/setup/daemon_controller_delegate_win.cc
+++ b/remoting/host/setup/daemon_controller_delegate_win.cc
@@ -90,7 +90,7 @@
DWORD OpenService(ScopedScHandle* service_out) {
// Open the service and query its current state.
ScopedScHandle scmanager(
- ::OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASE,
+ ::OpenSCManagerW(nullptr, SERVICES_ACTIVE_DATABASE,
SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE));
if (!scmanager.IsValid()) {
DWORD error = GetLastError();
@@ -135,7 +135,7 @@
DaemonControllerDelegateWin::DaemonControllerDelegateWin()
: control_is_elevated_(false),
- window_handle_(NULL) {
+ window_handle_(nullptr) {
}
DaemonControllerDelegateWin::~DaemonControllerDelegateWin() {
@@ -242,9 +242,9 @@
}
// Update the configuration.
- ScopedBstr config_str(NULL);
+ ScopedBstr config_str(nullptr);
ConfigToString(*config, &config_str);
- if (config_str == NULL) {
+ if (config_str == nullptr) {
InvokeCompletionCallback(done, E_OUTOFMEMORY);
return;
}
@@ -305,7 +305,7 @@
return consent;
}
- if (control2_.get() == NULL) {
+ if (control2_.get() == nullptr) {
// The host is installed and does not support crash dump reporting.
return consent;
}
@@ -333,7 +333,7 @@
return hr;
}
- hr = CoCreateInstance(class_id, NULL, CLSCTX_LOCAL_SERVER,
+ hr = CoCreateInstance(class_id, nullptr, CLSCTX_LOCAL_SERVER,
IID_IDaemonControl, control_.ReceiveVoid());
if (FAILED(hr)) {
return hr;
@@ -432,9 +432,9 @@
}
// Set the configuration.
- ScopedBstr config_str(NULL);
+ ScopedBstr config_str(nullptr);
ConfigToString(*config, &config_str);
- if (config_str == NULL) {
+ if (config_str == nullptr) {
InvokeCompletionCallback(done, E_OUTOFMEMORY);
return;
}
diff --git a/remoting/host/setup/daemon_installer_win.cc b/remoting/host/setup/daemon_installer_win.cc
index 2968ce1..a125dfe 100644
--- a/remoting/host/setup/daemon_installer_win.cc
+++ b/remoting/host/setup/daemon_installer_win.cc
@@ -135,7 +135,7 @@
}
hr = dispatch::Invoke(V_DISPATCH(&bundle_), L"initialize", DISPATCH_METHOD,
- NULL);
+ nullptr);
if (FAILED(hr)) {
Done(hr);
return;
@@ -146,14 +146,14 @@
ScopedVariant empty(kOmahaEmpty);
ScopedVariant language(kOmahaLanguage);
hr = dispatch::Invoke(V_DISPATCH(&bundle_), L"createApp", DISPATCH_METHOD,
- appid, empty, language, empty, NULL);
+ appid, empty, language, empty, nullptr);
if (FAILED(hr)) {
Done(hr);
return;
}
hr = dispatch::Invoke(V_DISPATCH(&bundle_), L"checkForUpdate",
- DISPATCH_METHOD, NULL);
+ DISPATCH_METHOD, nullptr);
if (FAILED(hr)) {
Done(hr);
return;
@@ -214,7 +214,7 @@
case STATE_UPDATE_AVAILABLE:
hr = dispatch::Invoke(V_DISPATCH(&bundle_), L"download",
- DISPATCH_METHOD, NULL);
+ DISPATCH_METHOD, nullptr);
if (FAILED(hr)) {
Done(hr);
return;
@@ -226,7 +226,7 @@
case STATE_APPLYING_DIFFERENTIAL_PATCH:
case STATE_READY_TO_INSTALL:
hr = dispatch::Invoke(V_DISPATCH(&bundle_), L"install",
- DISPATCH_METHOD, NULL);
+ DISPATCH_METHOD, nullptr);
if (FAILED(hr)) {
Done(hr);
return;
@@ -352,7 +352,7 @@
result = CLSIDFromProgID(kGoogleUpdate, &class_id);
if (SUCCEEDED(result)) {
result = CoCreateInstance(class_id,
- NULL,
+ nullptr,
CLSCTX_LOCAL_SERVER,
IID_IDispatch,
update3.ReceiveVoid());
@@ -389,8 +389,8 @@
}
HWND GetTopLevelWindow(HWND window) {
- if (window == NULL) {
- return NULL;
+ if (window == nullptr) {
+ return nullptr;
}
for (;;) {
@@ -401,7 +401,7 @@
}
HWND parent = GetAncestor(window, GA_PARENT);
- if (parent == NULL) {
+ if (parent == nullptr) {
return window;
}
diff --git a/remoting/host/setup/daemon_installer_win.h b/remoting/host/setup/daemon_installer_win.h
index 3709982..7aaa2eb 100644
--- a/remoting/host/setup/daemon_installer_win.h
+++ b/remoting/host/setup/daemon_installer_win.h
@@ -24,7 +24,7 @@
// Creates an instance of the Chromoting Host installer passing the completion
// callback to be called when the installation finishes. In case of an error
- // returns NULL and passed the error code to |done|.
+ // returns nullptr and passed the error code to |done|.
static scoped_ptr<DaemonInstallerWin> Create(HWND window_handle,
CompletionCallback done);
@@ -44,7 +44,7 @@
// Returns the first top-level (i.e. WS_OVERLAPPED or WS_POPUP) window in
// the chain of parents of |window|. Returns |window| if it represents
-// a top-level window. Returns NULL when |window| is NULL.
+// a top-level window. Returns nullptr when |window| is nullptr.
HWND GetTopLevelWindow(HWND window);
} // namespace remoting
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc
index 018f28c6..89cd207 100644
--- a/remoting/host/setup/me2me_native_messaging_host.cc
+++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -53,7 +53,7 @@
};
// Helper to extract the "config" part of a message as a DictionaryValue.
-// Returns NULL on failure, and logs an error message.
+// Returns nullptr on failure, and logs an error message.
scoped_ptr<base::DictionaryValue> ConfigDictionaryFromMessage(
scoped_ptr<base::DictionaryValue> message) {
scoped_ptr<base::DictionaryValue> result;
@@ -505,7 +505,7 @@
}
void Me2MeNativeMessagingHost::OnError() {
- // Trigger a host shutdown by sending a NULL message.
+ // Trigger a host shutdown by sending a nullptr message.
channel_->SendMessage(nullptr);
}
@@ -544,7 +544,7 @@
if (elevated_channel_)
elevated_channel_->SendMessage(message.Pass());
- return elevated_channel_ != NULL;
+ return elevated_channel_ != nullptr;
}
void Me2MeNativeMessagingHost::EnsureElevatedHostCreated() {
@@ -667,7 +667,7 @@
return;
}
- if (!::ConnectNamedPipe(delegate_write_handle.Get(), NULL)) {
+ if (!::ConnectNamedPipe(delegate_write_handle.Get(), nullptr)) {
DWORD error = ::GetLastError();
if (error != ERROR_PIPE_CONNECTED) {
PLOG(ERROR) << "Unable to connect '" << input_pipe_name << "'";
@@ -676,7 +676,7 @@
}
}
- if (!::ConnectNamedPipe(delegate_read_handle.Get(), NULL)) {
+ if (!::ConnectNamedPipe(delegate_read_handle.Get(), nullptr)) {
DWORD error = ::GetLastError();
if (error != ERROR_PIPE_CONNECTED) {
PLOG(ERROR) << "Unable to connect '" << output_pipe_name << "'";
diff --git a/remoting/host/setup/me2me_native_messaging_host_main.cc b/remoting/host/setup/me2me_native_messaging_host_main.cc
index 106cbd0..37e32bc 100644
--- a/remoting/host/setup/me2me_native_messaging_host_main.cc
+++ b/remoting/host/setup/me2me_native_messaging_host_main.cc
@@ -151,18 +151,18 @@
std::wstring output_pipe_name =
command_line->GetSwitchValueNative(kOutputSwitchName);
- // A NULL SECURITY_ATTRIBUTES signifies that the handle can't be inherited
- read_file = base::File(CreateFile(
- input_pipe_name.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL, NULL));
+ // A NULL SECURITY_ATTRIBUTES signifies that the handle can't be inherited.
+ read_file =
+ base::File(CreateFile(input_pipe_name.c_str(), GENERIC_READ, 0, nullptr,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr));
if (!read_file.IsValid()) {
PLOG(ERROR) << "CreateFile failed on '" << input_pipe_name << "'";
return kInitializationFailed;
}
write_file = base::File(CreateFile(
- output_pipe_name.c_str(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL, NULL));
+ output_pipe_name.c_str(), GENERIC_WRITE, 0, nullptr, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, nullptr));
if (!write_file.IsValid()) {
PLOG(ERROR) << "CreateFile failed on '" << output_pipe_name << "'";
return kInitializationFailed;
@@ -183,8 +183,8 @@
// the STD* handles at startup. So any LoadLibrary request can potentially
// be blocked. To prevent that from happening we close STDIN and STDOUT
// handles as soon as we retrieve the corresponding file handles.
- SetStdHandle(STD_INPUT_HANDLE, NULL);
- SetStdHandle(STD_OUTPUT_HANDLE, NULL);
+ SetStdHandle(STD_INPUT_HANDLE, nullptr);
+ SetStdHandle(STD_OUTPUT_HANDLE, nullptr);
}
#elif defined(OS_POSIX)
// The files will be automatically closed.
diff --git a/remoting/host/setup/me2me_native_messaging_host_unittest.cc b/remoting/host/setup/me2me_native_messaging_host_unittest.cc
index 88f0bdb..7d2ad685 100644
--- a/remoting/host/setup/me2me_native_messaging_host_unittest.cc
+++ b/remoting/host/setup/me2me_native_messaging_host_unittest.cc
@@ -71,7 +71,7 @@
std::string value;
EXPECT_TRUE(response->GetString("type", &value));
EXPECT_EQ("getDaemonConfigResponse", value);
- const base::DictionaryValue* config = NULL;
+ const base::DictionaryValue* config = nullptr;
EXPECT_TRUE(response->GetDictionary("config", &config));
EXPECT_TRUE(base::DictionaryValue().Equals(config));
}
@@ -343,7 +343,7 @@
base::RunLoop().RunUntilIdle();
// Trigger a test shutdown via ExitTest().
- host_task_runner_ = NULL;
+ host_task_runner_ = nullptr;
}
void Me2MeNativeMessagingHostTest::ExitTest() {
@@ -513,7 +513,7 @@
verify_routines[id](response.Pass());
// Clear the pointer so that the routine cannot be called the second time.
- verify_routines[id] = NULL;
+ verify_routines[id] = nullptr;
}
}
diff --git a/remoting/host/setup/service_client.cc b/remoting/host/setup/service_client.cc
index 32ff37f..9ea1d52 100644
--- a/remoting/host/setup/service_client.cc
+++ b/remoting/host/setup/service_client.cc
@@ -23,7 +23,7 @@
Core(const std::string& chromoting_hosts_url,
net::URLRequestContextGetter* request_context_getter)
: request_context_getter_(request_context_getter),
- delegate_(NULL),
+ delegate_(nullptr),
pending_request_type_(PENDING_REQUEST_NONE),
chromoting_hosts_url_(chromoting_hosts_url) {
}
diff --git a/remoting/host/setup/start_host.cc b/remoting/host/setup/start_host.cc
index a207f35..57359b3 100644
--- a/remoting/host/setup/start_host.cc
+++ b/remoting/host/setup/start_host.cc
@@ -29,7 +29,7 @@
bool g_started = false;
// The main message loop.
-base::MessageLoop* g_message_loop = NULL;
+base::MessageLoop* g_message_loop = nullptr;
// Lets us hide the PIN that a user types.
void SetEcho(bool echo) {
@@ -185,12 +185,12 @@
base::RunLoop run_loop;
run_loop.Run();
- g_message_loop = NULL;
+ g_message_loop = nullptr;
// Destroy the HostStarter and URLRequestContextGetter before stopping the
// IO thread.
host_starter.reset();
- url_request_context_getter = NULL;
+ url_request_context_getter = nullptr;
io_thread.Stop();
diff --git a/remoting/host/setup/test_util.cc b/remoting/host/setup/test_util.cc
index 51c610b..efac1239 100644
--- a/remoting/host/setup/test_util.cc
+++ b/remoting/host/setup/test_util.cc
@@ -17,7 +17,7 @@
#if defined(OS_WIN)
base::PlatformFile read_handle;
base::PlatformFile write_handle;
- if (!CreatePipe(&read_handle, &write_handle, NULL, 0))
+ if (!CreatePipe(&read_handle, &write_handle, nullptr, 0))
return false;
*read_file = base::File(read_handle);
*write_file = base::File(write_handle);
diff --git a/remoting/host/setup/win/auth_code_getter.cc b/remoting/host/setup/win/auth_code_getter.cc
index 04f3f90..7316c51 100644
--- a/remoting/host/setup/win/auth_code_getter.cc
+++ b/remoting/host/setup/win/auth_code_getter.cc
@@ -17,7 +17,7 @@
namespace remoting {
AuthCodeGetter::AuthCodeGetter() :
- browser_(NULL),
+ browser_(nullptr),
timer_interval_(base::TimeDelta::FromMilliseconds(kUrlPollIntervalMs)) {
}
@@ -32,7 +32,7 @@
return;
}
on_auth_code_ = on_auth_code;
- HRESULT hr = browser_.CreateInstance(CLSID_InternetExplorer, NULL,
+ HRESULT hr = browser_.CreateInstance(CLSID_InternetExplorer, nullptr,
CLSCTX_LOCAL_SERVER);
if (FAILED(hr)) {
on_auth_code_.Run("");
diff --git a/remoting/host/shaped_desktop_capturer.cc b/remoting/host/shaped_desktop_capturer.cc
index 14b3e99..8cfbcbc 100644
--- a/remoting/host/shaped_desktop_capturer.cc
+++ b/remoting/host/shaped_desktop_capturer.cc
@@ -15,7 +15,7 @@
scoped_ptr<DesktopShapeTracker> shape_tracker)
: desktop_capturer_(desktop_capturer.Pass()),
shape_tracker_(shape_tracker.Pass()),
- callback_(NULL) {
+ callback_(nullptr) {
}
ShapedDesktopCapturer::~ShapedDesktopCapturer() {}
diff --git a/remoting/host/shaped_desktop_capturer_unittest.cc b/remoting/host/shaped_desktop_capturer_unittest.cc
index dbe353e..371c473 100644
--- a/remoting/host/shaped_desktop_capturer_unittest.cc
+++ b/remoting/host/shaped_desktop_capturer_unittest.cc
@@ -42,7 +42,7 @@
public:
// webrtc::DesktopCapturer::Callback interface
webrtc::SharedMemory* CreateSharedMemory(size_t size) override {
- return NULL;
+ return nullptr;
}
void OnCaptureCompleted(webrtc::DesktopFrame* frame) override {
diff --git a/remoting/host/single_window_input_injector_mac.cc b/remoting/host/single_window_input_injector_mac.cc
index ecc6f53..3fac4ff 100644
--- a/remoting/host/single_window_input_injector_mac.cc
+++ b/remoting/host/single_window_input_injector_mac.cc
@@ -120,12 +120,12 @@
CGRect rect;
CGWindowID ids[1] = {window_id_};
base::ScopedCFTypeRef<CFArrayRef> window_id_array(
- CFArrayCreate(NULL, reinterpret_cast<const void **>(&ids), 1, NULL));
+ CFArrayCreate(nullptr, reinterpret_cast<const void**>(&ids), 1, nullptr));
base::ScopedCFTypeRef<CFArrayRef> window_array(
CGWindowListCreateDescriptionFromArray(window_id_array));
- if (window_array == NULL || CFArrayGetCount(window_array) == 0) {
+ if (window_array == nullptr || CFArrayGetCount(window_array) == 0) {
// Could not find the window. It might have been closed.
LOG(ERROR) << "Specified window to stream not found for id: "
<< window_id_;
diff --git a/remoting/host/token_validator_base.cc b/remoting/host/token_validator_base.cc
index 15f22bc..5e3d75d 100644
--- a/remoting/host/token_validator_base.cc
+++ b/remoting/host/token_validator_base.cc
@@ -122,7 +122,7 @@
client_cert_store = new net::ClientCertStoreMac();
#elif defined(USE_OPENSSL)
// OpenSSL does not use the ClientCertStore infrastructure.
- client_cert_store = NULL;
+ client_cert_store = nullptr;
#else
#error Unknown platform.
#endif
@@ -150,7 +150,7 @@
return;
}
}
- request_->ContinueWithCertificate(NULL);
+ request_->ContinueWithCertificate(nullptr);
}
}
diff --git a/remoting/host/token_validator_factory_impl.cc b/remoting/host/token_validator_factory_impl.cc
index 3357558..2fa1cd4 100644
--- a/remoting/host/token_validator_factory_impl.cc
+++ b/remoting/host/token_validator_factory_impl.cc
@@ -82,7 +82,7 @@
request_ = request_context_getter_->GetURLRequestContext()->CreateRequest(
third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY,
- this, NULL);
+ this, nullptr);
request_->SetExtraRequestHeaderByName(
net::HttpRequestHeaders::kContentType,
"application/x-www-form-urlencoded", true);
diff --git a/remoting/host/username.cc b/remoting/host/username.cc
index e737425c..cf274193 100644
--- a/remoting/host/username.cc
+++ b/remoting/host/username.cc
@@ -24,7 +24,7 @@
std::vector<char> buf(buf_size);
struct passwd passwd;
- struct passwd* passwd_result = NULL;
+ struct passwd* passwd_result = nullptr;
getpwuid_r(getuid(), &passwd, &(buf[0]), buf_size, &passwd_result);
return passwd_result ? passwd_result->pw_name : std::string();
#else // !defined(OS_POSIX)
diff --git a/remoting/host/verify_config_window_win.cc b/remoting/host/verify_config_window_win.cc
index d6793cc0..ff00a95a 100644
--- a/remoting/host/verify_config_window_win.cc
+++ b/remoting/host/verify_config_window_win.cc
@@ -36,7 +36,7 @@
LRESULT VerifyConfigWindowWin::OnInitDialog(HWND wparam, LPARAM lparam) {
// Set the small window icon.
if (icon_.LoadIcon(IDD, ::GetSystemMetrics(SM_CXSMICON),
- ::GetSystemMetrics(SM_CYSMICON)) != NULL) {
+ ::GetSystemMetrics(SM_CYSMICON)) != nullptr) {
SetIcon(icon_, FALSE);
}
@@ -64,24 +64,24 @@
// Center against the owner window unless it is minimized or invisible.
HWND owner = ::GetWindow(m_hWnd, GW_OWNER);
- if (owner != NULL) {
+ if (owner != nullptr) {
DWORD style = ::GetWindowLong(owner, GWL_STYLE);
if ((style & WS_MINIMIZE) != 0 || (style & WS_VISIBLE) == 0) {
- owner = NULL;
+ owner = nullptr;
}
}
// Make sure that the window will not end up split by a monitor's boundary.
RECT area_rect;
- if (!::SystemParametersInfo(SPI_GETWORKAREA, NULL, &area_rect, NULL)) {
+ if (!::SystemParametersInfo(SPI_GETWORKAREA, 0, &area_rect, 0)) {
return;
}
// On a multi-monitor system use the monitor where the owner window is shown.
RECT owner_rect = area_rect;
- if (owner != NULL && ::GetWindowRect(owner, &owner_rect)) {
+ if (owner != nullptr && ::GetWindowRect(owner, &owner_rect)) {
HMONITOR monitor = ::MonitorFromRect(&owner_rect, MONITOR_DEFAULTTONEAREST);
- if (monitor != NULL) {
+ if (monitor != nullptr) {
MONITORINFO monitor_info = {0};
monitor_info.cbSize = sizeof(monitor_info);
if (::GetMonitorInfo(monitor, &monitor_info)) {
@@ -100,7 +100,8 @@
y = std::max(y, area_rect.top);
y = std::min(y, area_rect.bottom - width);
- SetWindowPos(NULL, x, y, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(nullptr, x, y, -1, -1,
+ SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
}
bool VerifyConfigWindowWin::VerifyHostSecretHash() {
@@ -110,7 +111,7 @@
int pin_length = pin_edit.GetWindowTextLength();
scoped_ptr<base::char16[]> pin(new base::char16[pin_length + 1]);
- // Get the PIN making sure it is NULL terminated even if an error occurs.
+ // Get the PIN making sure it is nullptr terminated even if an error occurs.
int result = pin_edit.GetWindowText(pin.get(), pin_length + 1);
pin[std::min(result, pin_length)] = 0;
diff --git a/remoting/host/video_frame_recorder.cc b/remoting/host/video_frame_recorder.cc
index 5abce9c..c286e39 100644
--- a/remoting/host/video_frame_recorder.cc
+++ b/remoting/host/video_frame_recorder.cc
@@ -160,8 +160,8 @@
}
// Detach this recorder from the calling and encode threads.
- caller_task_runner_ = NULL;
- encoder_task_runner_ = NULL;
+ caller_task_runner_ = nullptr;
+ encoder_task_runner_ = nullptr;
}
void VideoFrameRecorder::SetEnableRecording(bool enable_recording) {
diff --git a/remoting/host/video_scheduler.cc b/remoting/host/video_scheduler.cc
index f2ded20..e2a3f94 100644
--- a/remoting/host/video_scheduler.cc
+++ b/remoting/host/video_scheduler.cc
@@ -76,7 +76,7 @@
// Public methods --------------------------------------------------------------
webrtc::SharedMemory* VideoScheduler::CreateSharedMemory(size_t size) {
- return NULL;
+ return nullptr;
}
void VideoScheduler::OnCaptureCompleted(webrtc::DesktopFrame* frame) {
@@ -91,7 +91,7 @@
base::TimeDelta::FromMilliseconds(owned_frame->capture_time_ms()));
}
- // Even when |frame| is NULL we still need to post it to the encode thread
+ // Even when |frame| is nullptr we still need to post it to the encode thread
// to make sure frames are freed in the same order they are received and
// that we don't start capturing frame n+2 before frame n is freed.
encode_task_runner_->PostTask(
@@ -155,8 +155,8 @@
DCHECK(network_task_runner_->BelongsToCurrentThread());
// Clear stubs to prevent further updates reaching the client.
- cursor_stub_ = NULL;
- video_stub_ = NULL;
+ cursor_stub_ = nullptr;
+ video_stub_ = nullptr;
keep_alive_timer_.reset();
@@ -270,7 +270,7 @@
void VideoScheduler::CaptureNextFrame() {
DCHECK(capture_task_runner_->BelongsToCurrentThread());
- // If we are stopping (|capturer_| is NULL), or paused, then don't capture.
+ // If we are stopping (|capturer_| is nullptr), or paused, then don't capture.
if (!capturer_ || is_paused_)
return;
diff --git a/remoting/host/video_scheduler_unittest.cc b/remoting/host/video_scheduler_unittest.cc
index 2e447c1..5adfafa0 100644
--- a/remoting/host/video_scheduler_unittest.cc
+++ b/remoting/host/video_scheduler_unittest.cc
@@ -169,8 +169,8 @@
};
VideoSchedulerTest::VideoSchedulerTest()
- : capturer_callback_(NULL),
- mouse_monitor_callback_(NULL) {
+ : capturer_callback_(nullptr),
+ mouse_monitor_callback_(nullptr) {
}
void VideoSchedulerTest::SetUp() {
@@ -182,9 +182,9 @@
void VideoSchedulerTest::TearDown() {
// Release the task runners, so that the test can quit.
- capture_task_runner_ = NULL;
- encode_task_runner_ = NULL;
- main_task_runner_ = NULL;
+ capture_task_runner_ = nullptr;
+ encode_task_runner_ = nullptr;
+ main_task_runner_ = nullptr;
// Run the MessageLoop until everything has torn down.
run_loop_.Run();
@@ -208,7 +208,7 @@
void VideoSchedulerTest::StopVideoScheduler() {
scheduler_->Stop();
- scheduler_ = NULL;
+ scheduler_ = nullptr;
}
void VideoSchedulerTest::OnCapturerStart(
diff --git a/remoting/host/win/chromoting_module.cc b/remoting/host/win/chromoting_module.cc
index d12ab29..f7a89d5 100644
--- a/remoting/host/win/chromoting_module.cc
+++ b/remoting/host/win/chromoting_module.cc
@@ -168,7 +168,7 @@
CHECK(SUCCEEDED(hr));
// Release the message loop reference, causing the message loop to exit.
- g_module_task_runner.Get() = NULL;
+ g_module_task_runner.Get() = nullptr;
}
return count;
diff --git a/remoting/host/win/chromoting_module.h b/remoting/host/win/chromoting_module.h
index d1245168..b20184a8 100644
--- a/remoting/host/win/chromoting_module.h
+++ b/remoting/host/win/chromoting_module.h
@@ -38,8 +38,8 @@
ATL::_ATL_OBJMAP_ENTRY* classes_end);
virtual ~ChromotingModule();
- // Returns the task runner used by the module. Returns NULL if the task runner
- // hasn't been registered yet or if the server is shutting down.
+ // Returns the task runner used by the module. Returns nullptr if the task
+ // runner hasn't been registered yet or if the server is shutting down.
static scoped_refptr<AutoThreadTaskRunner> task_runner();
// Registers COM classes and runs the main message loop until there are
diff --git a/remoting/host/win/com_security.cc b/remoting/host/win/com_security.cc
index 9cefaad2..97e644b 100644
--- a/remoting/host/win/com_security.cc
+++ b/remoting/host/win/com_security.cc
@@ -48,13 +48,13 @@
HRESULT result = CoInitializeSecurity(
absolute_sd.get(),
-1, // Let COM choose which authentication services to register.
- NULL, // See above.
- NULL, // Reserved, must be NULL.
+ nullptr, // See above.
+ nullptr, // Reserved, must be nullptr.
RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
RPC_C_IMP_LEVEL_IDENTIFY,
- NULL, // Default authentication information is not provided.
+ nullptr, // Default authentication information is not provided.
capabilities,
- NULL); /// Reserved, must be NULL
+ nullptr); /// Reserved, must be nullptr
if (FAILED(result)) {
LOG(ERROR) << "CoInitializeSecurity() failed, result=0x"
<< std::hex << result << std::dec << ".";
diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc
index cf84d0b..8cbfcf8 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -70,7 +70,7 @@
}
SID_IDENTIFIER_AUTHORITY nt_authority = SECURITY_NT_AUTHORITY;
- PSID administrators_group = NULL;
+ PSID administrators_group = nullptr;
BOOL result = AllocateAndInitializeSid(&nt_authority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
@@ -78,7 +78,7 @@
0, 0, 0, 0, 0, 0,
&administrators_group);
if (result) {
- if (!CheckTokenMembership(NULL, administrators_group, &result)) {
+ if (!CheckTokenMembership(nullptr, administrators_group, &result)) {
result = false;
}
FreeSid(administrators_group);
@@ -100,10 +100,10 @@
CreateFileW(filename.value().c_str(),
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
+ nullptr,
OPEN_EXISTING,
FILE_FLAG_SEQUENTIAL_SCAN,
- NULL));
+ nullptr));
if (!file.IsValid()) {
DWORD error = GetLastError();
@@ -113,7 +113,7 @@
scoped_ptr<char[]> buffer(new char[kMaxConfigFileSize]);
DWORD size = kMaxConfigFileSize;
- if (!::ReadFile(file.Get(), &buffer[0], size, &size, NULL)) {
+ if (!::ReadFile(file.Get(), &buffer[0], size, &size, nullptr)) {
DWORD error = GetLastError();
PLOG(ERROR) << "Failed to read '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
@@ -125,7 +125,7 @@
base::JSONReader::Read(file_content, base::JSON_ALLOW_TRAILING_COMMAS));
base::DictionaryValue* dictionary;
- if (value.get() == NULL || !value->GetAsDictionary(&dictionary)) {
+ if (value.get() == nullptr || !value->GetAsDictionary(&dictionary)) {
LOG(ERROR) << "Failed to read '" << filename.value() << "'.";
return E_FAIL;
}
@@ -167,7 +167,7 @@
&security_attributes,
CREATE_ALWAYS,
FILE_FLAG_SEQUENTIAL_SCAN,
- NULL));
+ nullptr));
if (!file.IsValid()) {
DWORD error = GetLastError();
@@ -177,7 +177,7 @@
DWORD written;
if (!WriteFile(file.Get(), content, static_cast<DWORD>(length), &written,
- NULL)) {
+ nullptr)) {
DWORD error = GetLastError();
PLOG(ERROR) << "Failed to write to '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
@@ -214,7 +214,7 @@
if (!config_value.get()) {
return E_FAIL;
}
- base::DictionaryValue* config_dict = NULL;
+ base::DictionaryValue* config_dict = nullptr;
if (!config_value->GetAsDictionary(&config_dict)) {
return E_FAIL;
}
@@ -294,7 +294,7 @@
} // namespace
-ElevatedController::ElevatedController() : owner_window_(NULL) {
+ElevatedController::ElevatedController() : owner_window_(nullptr) {
}
HRESULT ElevatedController::FinalConstruct() {
@@ -320,7 +320,7 @@
base::JSONWriter::Write(config.get(), &file_content);
*config_out = ::SysAllocString(base::UTF8ToUTF16(file_content).c_str());
- if (config_out == NULL) {
+ if (config_out == nullptr) {
return E_OUTOFMEMORY;
}
@@ -341,7 +341,7 @@
}
*version_out = ::SysAllocString(version.c_str());
- if (version_out == NULL) {
+ if (version_out == nullptr) {
return E_OUTOFMEMORY;
}
@@ -378,13 +378,13 @@
SERVICE_NO_CHANGE,
SERVICE_AUTO_START,
SERVICE_NO_CHANGE,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL)) {
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr)) {
DWORD error = GetLastError();
PLOG(ERROR) << "Failed to change the '" << kWindowsServiceName
<< "'service start type to 'auto'";
@@ -392,7 +392,7 @@
}
// Start the service.
- if (!StartService(service.Get(), 0, NULL)) {
+ if (!StartService(service.Get(), 0, nullptr)) {
DWORD error = GetLastError();
if (error != ERROR_SERVICE_ALREADY_RUNNING) {
PLOG(ERROR) << "Failed to start the '" << kWindowsServiceName
@@ -417,13 +417,13 @@
SERVICE_NO_CHANGE,
SERVICE_DEMAND_START,
SERVICE_NO_CHANGE,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL)) {
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr)) {
DWORD error = GetLastError();
PLOG(ERROR) << "Failed to change the '" << kWindowsServiceName
<< "'service start type to 'manual'";
@@ -452,7 +452,7 @@
if (!config_value.get()) {
return E_FAIL;
}
- base::DictionaryValue* config_dict = NULL;
+ base::DictionaryValue* config_dict = nullptr;
if (!config_value->GetAsDictionary(&config_dict)) {
return E_FAIL;
}
@@ -503,7 +503,7 @@
DWORD error;
ScopedScHandle scmanager(
- ::OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASE,
+ ::OpenSCManagerW(nullptr, SERVICES_ACTIVE_DATABASE,
SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE));
if (!scmanager.IsValid()) {
error = GetLastError();
diff --git a/remoting/host/win/entry_point.cc b/remoting/host/win/entry_point.cc
index 3b54069..0d711f2 100644
--- a/remoting/host/win/entry_point.cc
+++ b/remoting/host/win/entry_point.cc
@@ -10,7 +10,7 @@
// order to be really small the app doesn't link against the CRT.
void HostEntryPoint() {
// CommandLine::Init() ignores the passed parameters on Windows, so it is safe
- // to pass NULL here.
- int exit_code = remoting::HostMain(0, NULL);
+ // to pass nullptr here.
+ int exit_code = remoting::HostMain(0, nullptr);
ExitProcess(exit_code);
}
diff --git a/remoting/host/win/host_service.cc b/remoting/host/win/host_service.cc
index 4d25ab7..06bca39 100644
--- a/remoting/host/win/host_service.cc
+++ b/remoting/host/win/host_service.cc
@@ -220,7 +220,7 @@
int HostService::RunAsService() {
SERVICE_TABLE_ENTRYW dispatch_table[] = {
{ const_cast<LPWSTR>(kWindowsServiceName), &HostService::ServiceMain },
- { NULL, NULL }
+ { nullptr, nullptr }
};
if (!StartServiceCtrlDispatcherW(dispatch_table)) {
diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc
index f37abc7..c0ee4b8 100644
--- a/remoting/host/win/launch_process_with_token.cc
+++ b/remoting/host/win/launch_process_with_token.cc
@@ -41,13 +41,13 @@
void CloseHandlesAndTerminateProcess(PROCESS_INFORMATION* process_information) {
if (process_information->hThread) {
CloseHandle(process_information->hThread);
- process_information->hThread = NULL;
+ process_information->hThread = nullptr;
}
if (process_information->hProcess) {
TerminateProcess(process_information->hProcess, CONTROL_C_EXIT);
CloseHandle(process_information->hProcess);
- process_information->hProcess = NULL;
+ process_information->hProcess = nullptr;
}
}
@@ -91,10 +91,10 @@
pipe.Set(CreateFile(pipe_name.c_str(),
GENERIC_READ | GENERIC_WRITE,
0,
- NULL,
+ nullptr,
OPEN_EXISTING,
0,
- NULL));
+ nullptr));
if (pipe.IsValid()) {
break;
}
@@ -134,7 +134,7 @@
if (!DuplicateTokenEx(process_token.Get(),
desired_access,
- NULL,
+ nullptr,
SecurityImpersonation,
TokenPrimary,
&temp_handle)) {
@@ -159,13 +159,13 @@
TOKEN_PRIVILEGES state;
state.PrivilegeCount = 1;
state.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
- if (!LookupPrivilegeValue(NULL, SE_TCB_NAME, &state.Privileges[0].Luid)) {
+ if (!LookupPrivilegeValue(nullptr, SE_TCB_NAME, &state.Privileges[0].Luid)) {
PLOG(ERROR) << "Failed to lookup the LUID for the SE_TCB_NAME privilege";
return false;
}
// Enable the SE_TCB_NAME privilege.
- if (!AdjustTokenPrivileges(privileged_token.Get(), FALSE, &state, 0, NULL,
+ if (!AdjustTokenPrivileges(privileged_token.Get(), FALSE, &state, 0, nullptr,
0)) {
PLOG(ERROR) << "Failed to enable SE_TCB_NAME privilege in a token";
return false;
@@ -263,7 +263,7 @@
DWORD bytes;
CreateProcessResponse response;
- if (!ReadFile(pipe, &response, sizeof(response), &bytes, NULL)) {
+ if (!ReadFile(pipe, &response, sizeof(response), &bytes, nullptr)) {
PLOG(ERROR) << "Failed to receive CreateProcessAsUser response";
return false;
}
@@ -318,7 +318,7 @@
desktop = desktop_name;
// Allocate a large enough buffer to hold the CreateProcessRequest structure
- // and three NULL-terminated string parameters.
+ // and three nullptr-terminated string parameters.
size_t size = sizeof(CreateProcessRequest) + sizeof(wchar_t) *
(application_name.size() + command_line.size() + desktop.size() + 3);
scoped_ptr<char[]> buffer(new char[size]);
@@ -357,7 +357,7 @@
// Pass the request to create a process in the target session.
DWORD bytes;
- if (!WriteFile(pipe, buffer.get(), size, &bytes, NULL)) {
+ if (!WriteFile(pipe, buffer.get(), size, &bytes, nullptr)) {
PLOG(ERROR) << "Failed to send CreateProcessAsUser request";
return false;
}
@@ -473,8 +473,8 @@
thread_attributes,
inherit_handles,
creation_flags,
- NULL,
- NULL,
+ nullptr,
+ nullptr,
&startup_info,
&temp_process_info);
diff --git a/remoting/host/win/rdp_client.cc b/remoting/host/win/rdp_client.cc
index 763cfa2..f41db10 100644
--- a/remoting/host/win/rdp_client.cc
+++ b/remoting/host/win/rdp_client.cc
@@ -166,7 +166,7 @@
// The caller does not expect any notifications to be delivered after this
// point.
- event_handler_ = NULL;
+ event_handler_ = nullptr;
// Gracefully shutdown the RDP connection.
if (rdp_client_window_) {
@@ -200,7 +200,7 @@
// Delay window destruction until no ActiveX control's code is on the stack.
ui_task_runner_->DeleteSoon(FROM_HERE, rdp_client_window_.release());
- self_ = NULL;
+ self_ = nullptr;
}
RdpClient::Core::~Core() {
@@ -228,7 +228,7 @@
if (event_handler_) {
RdpClient::EventHandler* event_handler = event_handler_;
- event_handler_ = NULL;
+ event_handler_ = nullptr;
event_handler->OnRdpClosed();
}
}
diff --git a/remoting/host/win/rdp_client_unittest.cc b/remoting/host/win/rdp_client_unittest.cc
index 4ef67b6..1b37d5c 100644
--- a/remoting/host/win/rdp_client_unittest.cc
+++ b/remoting/host/win/rdp_client_unittest.cc
@@ -71,7 +71,7 @@
RdpClientModule::~RdpClientModule() {
AtlAxWinTerm();
- ATL::_pAtlModule = NULL;
+ ATL::_pAtlModule = nullptr;
}
} // namespace
@@ -165,7 +165,7 @@
task_runner_, task_runner_,
webrtc::DesktopSize(kDefaultWidth, kDefaultHeight),
terminal_id_, &event_handler_));
- task_runner_ = NULL;
+ task_runner_ = nullptr;
run_loop_.Run();
}
diff --git a/remoting/host/win/rdp_client_window.cc b/remoting/host/win/rdp_client_window.cc
index b3dfcab3..6ccee3d2e 100644
--- a/remoting/host/win/rdp_client_window.cc
+++ b/remoting/host/win/rdp_client_window.cc
@@ -26,7 +26,7 @@
const long kDisconnectReasonRemoteByUser = 2;
const long kDisconnectReasonByServer = 3;
-// Maximum length of a window class name including the terminating NULL.
+// Maximum length of a window class name including the terminating nullptr.
const int kMaxWindowClassLength = 256;
// Each member of the array returned by GetKeyboardState() contains status data
@@ -57,15 +57,15 @@
// Finds a child window with the class name matching |class_name|. Unlike
// FindWindowEx() this function walks the tree of windows recursively. The walk
-// is done in breadth-first order. The function returns NULL if the child window
-// could not be found.
+// is done in breadth-first order. The function returns nullptr if the child
+// window could not be found.
HWND FindWindowRecursively(HWND parent, const base::string16& class_name) {
std::list<HWND> windows;
windows.push_back(parent);
while (!windows.empty()) {
- HWND child = FindWindowEx(windows.front(), NULL, NULL, NULL);
- while (child != NULL) {
+ HWND child = FindWindowEx(windows.front(), nullptr, nullptr, nullptr);
+ while (child != nullptr) {
// See if the window class name matches |class_name|.
WCHAR name[kMaxWindowClassLength];
int length = GetClassName(child, name, arraysize(name));
@@ -76,13 +76,13 @@
windows.push_back(child);
// Go to the next child.
- child = FindWindowEx(windows.front(), child, NULL, NULL);
+ child = FindWindowEx(windows.front(), child, nullptr, nullptr);
}
windows.pop_front();
}
- return NULL;
+ return nullptr;
}
} // namespace
@@ -131,7 +131,7 @@
screen_size_ = screen_size;
RECT rect = { 0, 0, screen_size_.width(), screen_size_.height() };
- bool result = Create(NULL, rect, NULL) != NULL;
+ bool result = Create(nullptr, rect, nullptr) != nullptr;
// Hide the window since this class is about establishing a connection, not
// about showing a UI to the user.
@@ -245,8 +245,9 @@
// Create the child window that actually hosts the ActiveX control.
RECT rect = { 0, 0, screen_size_.width(), screen_size_.height() };
- activex_window.Create(m_hWnd, rect, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER);
- if (activex_window.m_hWnd == NULL) {
+ activex_window.Create(m_hWnd, rect, nullptr,
+ WS_CHILD | WS_VISIBLE | WS_BORDER);
+ if (activex_window.m_hWnd == nullptr) {
result = HRESULT_FROM_WIN32(GetLastError());
goto done;
}
@@ -254,8 +255,8 @@
// Instantiate the RDP ActiveX control.
result = activex_window.CreateControlEx(
OLESTR("MsTscAx.MsTscAx"),
- NULL,
- NULL,
+ nullptr,
+ nullptr,
control.Receive(),
__uuidof(mstsc::IMsTscAxEvents),
reinterpret_cast<IUnknown*>(static_cast<RdpEventsSink*>(this)));
@@ -399,7 +400,7 @@
HRESULT RdpClientWindow::OnAuthenticationWarningDismissed() {
LOG(WARNING) << "RDP: authentication warning has been dismissed.";
- window_activate_hook_ = NULL;
+ window_activate_hook_ = nullptr;
return S_OK;
}
@@ -469,7 +470,7 @@
void RdpClientWindow::NotifyDisconnected() {
if (event_handler_) {
EventHandler* event_handler = event_handler_;
- event_handler_ = NULL;
+ event_handler_ = nullptr;
event_handler->OnDisconnected();
}
}
@@ -484,13 +485,13 @@
return window_hook;
}
-RdpClientWindow::WindowHook::WindowHook() : hook_(NULL) {
+RdpClientWindow::WindowHook::WindowHook() : hook_(nullptr) {
DCHECK(!g_window_hook.Pointer()->Get());
// Install a window hook to be called on window activation.
hook_ = SetWindowsHookEx(WH_CBT,
&WindowHook::CloseWindowOnActivation,
- NULL,
+ nullptr,
GetCurrentThreadId());
// Without the hook installed, RdpClientWindow will not be able to cancel
// modal UI windows. This will block the UI message loop so it is better to
@@ -504,7 +505,7 @@
RdpClientWindow::WindowHook::~WindowHook() {
DCHECK(g_window_hook.Pointer()->Get() == this);
- g_window_hook.Pointer()->Set(NULL);
+ g_window_hook.Pointer()->Set(nullptr);
BOOL result = UnhookWindowsHookEx(hook_);
DCHECK(result);
diff --git a/remoting/host/win/rdp_desktop_session.cc b/remoting/host/win/rdp_desktop_session.cc
index 6f6d3972..e7c3c2b 100644
--- a/remoting/host/win/rdp_desktop_session.cc
+++ b/remoting/host/win/rdp_desktop_session.cc
@@ -33,7 +33,7 @@
STDMETHODIMP RdpDesktopSession::Disconnect() {
client_.reset();
- event_handler_ = NULL;
+ event_handler_ = nullptr;
return S_OK;
}
diff --git a/remoting/host/win/security_descriptor.cc b/remoting/host/win/security_descriptor.cc
index 1085dd11..886fae92 100644
--- a/remoting/host/win/security_descriptor.cc
+++ b/remoting/host/win/security_descriptor.cc
@@ -12,7 +12,7 @@
namespace remoting {
ScopedSd ConvertSddlToSd(const std::string& sddl) {
- PSECURITY_DESCRIPTOR raw_sd = NULL;
+ PSECURITY_DESCRIPTOR raw_sd = nullptr;
ULONG length = 0;
if (!ConvertStringSecurityDescriptorToSecurityDescriptor(
base::UTF8ToUTF16(sddl).c_str(), SDDL_REVISION_1, &raw_sd, &length)) {
@@ -28,7 +28,7 @@
// Converts a SID into a text string.
std::string ConvertSidToString(SID* sid) {
- base::char16* c_sid_string = NULL;
+ base::char16* c_sid_string = nullptr;
if (!ConvertSidToStringSid(sid, &c_sid_string))
return std::string();
@@ -37,11 +37,11 @@
return base::UTF16ToUTF8(sid_string);
}
-// Returns the logon SID of a token. Returns NULL if the token does not specify
-// a logon SID or in case of an error.
+// Returns the logon SID of a token. Returns nullptr if the token does not
+// specify a logon SID or in case of an error.
ScopedSid GetLogonSid(HANDLE token) {
DWORD length = 0;
- if (GetTokenInformation(token, TokenGroups, NULL, 0, &length) ||
+ if (GetTokenInformation(token, TokenGroups, nullptr, 0, &length) ||
GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
return ScopedSid();
}
@@ -78,15 +78,15 @@
DWORD owner_size = 0;
DWORD sacl_size = 0;
if (MakeAbsoluteSD(relative_sd.get(),
- NULL,
+ nullptr,
&absolute_sd_size,
- NULL,
+ nullptr,
&dacl_size,
- NULL,
+ nullptr,
&sacl_size,
- NULL,
+ nullptr,
&owner_size,
- NULL,
+ nullptr,
&group_size) ||
GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
return false;
diff --git a/remoting/host/win/security_descriptor.h b/remoting/host/win/security_descriptor.h
index e83948e..acdef53 100644
--- a/remoting/host/win/security_descriptor.h
+++ b/remoting/host/win/security_descriptor.h
@@ -23,8 +23,8 @@
// Converts a SID into a text string.
std::string ConvertSidToString(SID* sid);
-// Returns the logon SID of a token. Returns NULL if the token does not specify
-// a logon SID or in case of an error.
+// Returns the logon SID of a token. Returns nullptr if the token does not
+// specify a logon SID or in case of an error.
ScopedSid GetLogonSid(HANDLE token);
// Converts a security descriptor in self-relative format to a security
diff --git a/remoting/host/win/session_input_injector.cc b/remoting/host/win/session_input_injector.cc
index 784d0ff..04cf7da6 100644
--- a/remoting/host/win/session_input_injector.cc
+++ b/remoting/host/win/session_input_injector.cc
@@ -197,7 +197,7 @@
// one.
scoped_ptr<webrtc::Desktop> input_desktop(
webrtc::Desktop::GetInputDesktop());
- if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) {
+ if (input_desktop.get() != nullptr && !desktop_.IsSame(*input_desktop)) {
// If SetThreadDesktop() fails, the thread is still assigned a desktop.
// So we can continue capture screen bits, just from a diffected desktop.
desktop_.SetThreadDesktop(input_desktop.release());
diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc
index 2f0bb62..b7997912 100644
--- a/remoting/host/win/unprivileged_process_delegate.cc
+++ b/remoting/host/win/unprivileged_process_delegate.cc
@@ -76,8 +76,9 @@
bool CreateRestrictedToken(ScopedHandle* token_out) {
// Create a token representing LocalService account.
HANDLE temp_handle;
- if (!LogonUser(L"LocalService", L"NT AUTHORITY", NULL, LOGON32_LOGON_SERVICE,
- LOGON32_PROVIDER_DEFAULT, &temp_handle)) {
+ if (!LogonUser(L"LocalService", L"NT AUTHORITY", nullptr,
+ LOGON32_LOGON_SERVICE, LOGON32_PROVIDER_DEFAULT,
+ &temp_handle)) {
return false;
}
ScopedHandle token(temp_handle);
@@ -87,7 +88,7 @@
return false;
// Remove all privileges in the token.
- if (restricted_token.DeleteAllPrivileges(NULL) != ERROR_SUCCESS)
+ if (restricted_token.DeleteAllPrivileges(nullptr) != ERROR_SUCCESS)
return false;
// Set low integrity level if supported by the OS.
@@ -192,8 +193,8 @@
// The default desktop of the interactive window station is called "Default".
// Name the created desktop the same way in case any code relies on that.
// The desktop name should not make any difference though.
- handles.SetDesktop(CreateDesktop(L"Default", NULL, NULL, 0, desired_access,
- &security_attributes));
+ handles.SetDesktop(CreateDesktop(L"Default", nullptr, nullptr, 0,
+ desired_access, &security_attributes));
// Switch back to the original window station.
if (!SetProcessWindowStation(current_window_station)) {
@@ -216,7 +217,7 @@
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_ptr<base::CommandLine> target_command)
: io_task_runner_(io_task_runner),
- event_handler_(NULL),
+ event_handler_(nullptr),
target_command_(target_command.Pass()) {
}
@@ -311,7 +312,7 @@
&thread_attributes,
true,
0,
- NULL,
+ nullptr,
&worker_process,
&worker_thread)) {
ReportFatalError();
@@ -343,7 +344,7 @@
DCHECK(CalledOnValidThread());
channel_.reset();
- event_handler_ = NULL;
+ event_handler_ = nullptr;
if (worker_process_.IsValid()) {
TerminateProcess(worker_process_.Get(), CONTROL_C_EXIT);
@@ -385,7 +386,7 @@
channel_.reset();
WorkerProcessLauncher* event_handler = event_handler_;
- event_handler_ = NULL;
+ event_handler_ = nullptr;
event_handler->OnFatalError();
}
diff --git a/remoting/host/win/window_station_and_desktop.cc b/remoting/host/win/window_station_and_desktop.cc
index ed8f19dc..1932392 100644
--- a/remoting/host/win/window_station_and_desktop.cc
+++ b/remoting/host/win/window_station_and_desktop.cc
@@ -9,13 +9,13 @@
namespace remoting {
WindowStationAndDesktop::WindowStationAndDesktop()
- : desktop_(NULL),
- window_station_(NULL) {
+ : desktop_(nullptr),
+ window_station_(nullptr) {
}
WindowStationAndDesktop::~WindowStationAndDesktop() {
- SetDesktop(NULL);
- SetWindowStation(NULL);
+ SetDesktop(nullptr);
+ SetWindowStation(nullptr);
}
void WindowStationAndDesktop::SetDesktop(HDESK desktop) {
diff --git a/remoting/host/win/worker_process_launcher.cc b/remoting/host/win/worker_process_launcher.cc
index 3d01572..144be97 100644
--- a/remoting/host/win/worker_process_launcher.cc
+++ b/remoting/host/win/worker_process_launcher.cc
@@ -61,7 +61,7 @@
kill_process_timeout_(
base::TimeDelta::FromSeconds(kKillProcessTimeoutSeconds)),
launch_backoff_(&kDefaultBackoffPolicy) {
- DCHECK(ipc_handler_ != NULL);
+ DCHECK(ipc_handler_ != nullptr);
LaunchWorker();
}
@@ -69,7 +69,7 @@
WorkerProcessLauncher::~WorkerProcessLauncher() {
DCHECK(CalledOnValidThread());
- ipc_handler_ = NULL;
+ ipc_handler_ = nullptr;
StopWorker();
}
diff --git a/remoting/host/win/worker_process_launcher.h b/remoting/host/win/worker_process_launcher.h
index a61b7555..d48b9dc 100644
--- a/remoting/host/win/worker_process_launcher.h
+++ b/remoting/host/win/worker_process_launcher.h
@@ -105,7 +105,7 @@
virtual void OnObjectSignaled(HANDLE object) override;
// Returns true when the object is being destroyed.
- bool stopping() const { return ipc_handler_ == NULL; }
+ bool stopping() const { return ipc_handler_ == nullptr; }
// Attempts to launch the worker process. Schedules next launch attempt if
// creation of the process fails.
diff --git a/remoting/host/win/worker_process_launcher_unittest.cc b/remoting/host/win/worker_process_launcher_unittest.cc
index e256a7c8..aa6f095 100644
--- a/remoting/host/win/worker_process_launcher_unittest.cc
+++ b/remoting/host/win/worker_process_launcher_unittest.cc
@@ -180,7 +180,8 @@
ScopedHandle worker_process_;
};
-WorkerProcessLauncherTest::WorkerProcessLauncherTest() : event_handler_(NULL) {
+WorkerProcessLauncherTest::WorkerProcessLauncherTest()
+ : event_handler_(nullptr) {
}
WorkerProcessLauncherTest::~WorkerProcessLauncherTest() {
@@ -259,7 +260,7 @@
}
void WorkerProcessLauncherTest::KillProcess() {
- event_handler_ = NULL;
+ event_handler_ = nullptr;
if (worker_process_.IsValid()) {
TerminateProcess(worker_process_.Get(), CONTROL_C_EXIT);
@@ -323,7 +324,7 @@
DisconnectClient();
channel_name_.clear();
channel_server_.reset();
- task_runner_ = NULL;
+ task_runner_ = nullptr;
}
void WorkerProcessLauncherTest::QuitMainMessageLoop() {
@@ -342,14 +343,14 @@
startup_info.cb = sizeof(startup_info);
PROCESS_INFORMATION temp_process_info = {};
- ASSERT_TRUE(CreateProcess(NULL,
+ ASSERT_TRUE(CreateProcess(nullptr,
notepad,
- NULL, // default process attibutes
- NULL, // default thread attibutes
+ nullptr, // default process attibutes
+ nullptr, // default thread attibutes
FALSE, // do not inherit handles
CREATE_SUSPENDED,
- NULL, // no environment
- NULL, // default current directory
+ nullptr, // no environment
+ nullptr, // default current directory
&startup_info,
&temp_process_info));
base::win::ScopedProcessInformation process_information(temp_process_info);
diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc
index 42b8b8c..66d7f0c02 100644
--- a/remoting/host/win/wts_session_process_delegate.cc
+++ b/remoting/host/win/wts_session_process_delegate.cc
@@ -149,8 +149,8 @@
: caller_task_runner_(base::ThreadTaskRunnerHandle::Get()),
io_task_runner_(io_task_runner),
channel_security_(channel_security),
- event_handler_(NULL),
- get_named_pipe_client_pid_(NULL),
+ event_handler_(nullptr),
+ get_named_pipe_client_pid_(nullptr),
launch_elevated_(launch_elevated),
launch_pending_(false),
target_command_(target_command.Pass()) {
@@ -166,15 +166,15 @@
if (launch_elevated_) {
// GetNamedPipeClientProcessId() is available starting from Vista.
HMODULE kernel32 = ::GetModuleHandle(L"kernel32.dll");
- CHECK(kernel32 != NULL);
+ CHECK(kernel32 != nullptr);
get_named_pipe_client_pid_ =
reinterpret_cast<GetNamedPipeClientProcessIdFn>(
GetProcAddress(kernel32, "GetNamedPipeClientProcessId"));
- CHECK(get_named_pipe_client_pid_ != NULL);
+ CHECK(get_named_pipe_client_pid_ != nullptr);
ScopedHandle job;
- job.Set(CreateJobObject(NULL, NULL));
+ job.Set(CreateJobObject(nullptr, nullptr));
if (!job.IsValid()) {
PLOG(ERROR) << "Failed to create a job object";
return false;
@@ -255,7 +255,7 @@
DCHECK(caller_task_runner_->BelongsToCurrentThread());
channel_.reset();
- event_handler_ = NULL;
+ event_handler_ = nullptr;
launch_pending_ = false;
pipe_.Close();
@@ -395,8 +395,8 @@
if (!LaunchProcessWithToken(command_line.GetProgram(),
command_line.GetCommandLineString(),
session_token_.Get(),
- NULL,
- NULL,
+ nullptr,
+ nullptr,
false,
CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB,
base::UTF8ToUTF16(kDefaultDesktopName).c_str(),
@@ -496,7 +496,7 @@
pipe_.Close();
WorkerProcessLauncher* event_handler = event_handler_;
- event_handler_ = NULL;
+ event_handler_ = nullptr;
event_handler->OnFatalError();
}