replace NULL->nullptr in src/remoting.
Review URL: https://codereview.chromium.org/810133003
Cr-Commit-Position: refs/heads/master@{#310816}
diff --git a/remoting/client/audio_decode_scheduler.cc b/remoting/client/audio_decode_scheduler.cc
index 79ea22d5..144025ba 100644
--- a/remoting/client/audio_decode_scheduler.cc
+++ b/remoting/client/audio_decode_scheduler.cc
@@ -93,7 +93,7 @@
scoped_ptr<AudioPacket> packet,
const base::Closure& done) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
- // Only process |packet| if it is non-NULL.
+ // Only process |packet| if it is non-null.
if (packet.get() && audio_player_.get())
audio_player_->ProcessAudioPacket(packet.Pass());
done.Run();
diff --git a/remoting/client/jni/chromoting_jni_runtime.cc b/remoting/client/jni/chromoting_jni_runtime.cc
index 38834dd..f077948 100644
--- a/remoting/client/jni/chromoting_jni_runtime.cc
+++ b/remoting/client/jni/chromoting_jni_runtime.cc
@@ -46,7 +46,7 @@
// runtime API keys have been specified by the environment. Unfortunately, we
// neither launch Chromium nor have a command line, so we need to prevent
// them from DCHECKing out when they go looking.
- base::CommandLine::Init(0, NULL);
+ base::CommandLine::Init(0, nullptr);
// Create the singleton now so that the Chromoting threads will be set up.
remoting::ChromotingJniRuntime::GetInstance();
@@ -245,7 +245,7 @@
DCHECK(ui_task_runner_->BelongsToCurrentThread());
if (session_.get()) {
session_->Disconnect();
- session_ = NULL;
+ session_ = nullptr;
}
}
diff --git a/remoting/client/jni/jni_frame_consumer.cc b/remoting/client/jni/jni_frame_consumer.cc
index aeb70d0..badb152 100644
--- a/remoting/client/jni/jni_frame_consumer.cc
+++ b/remoting/client/jni/jni_frame_consumer.cc
@@ -23,7 +23,7 @@
scoped_refptr<ChromotingJniInstance> jni_instance)
: jni_runtime_(jni_runtime),
jni_instance_(jni_instance),
- frame_producer_(NULL) {
+ frame_producer_(nullptr) {
}
JniFrameConsumer::~JniFrameConsumer() {
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index cc4f5cd..ff8a06a 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -168,7 +168,7 @@
g_logging_instance = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<base::Lock>::Leaky
g_logging_lock = LAZY_INSTANCE_INITIALIZER;
-logging::LogMessageHandlerFunction g_logging_old_handler = NULL;
+logging::LogMessageHandlerFunction g_logging_old_handler = nullptr;
} // namespace
@@ -299,9 +299,9 @@
scoped_ptr<base::Value> json(
base::JSONReader::Read(message.AsString(),
base::JSON_ALLOW_TRAILING_COMMAS));
- base::DictionaryValue* message_dict = NULL;
+ base::DictionaryValue* message_dict = nullptr;
std::string method;
- base::DictionaryValue* data = NULL;
+ base::DictionaryValue* data = nullptr;
if (!json.get() ||
!json->GetAsDictionary(&message_dict) ||
!message_dict->GetString("method", &method) ||
@@ -950,7 +950,7 @@
VLOG(0) << "Disconnecting from host.";
// Disconnect the input pipeline and teardown the connection.
- mouse_input_filter_.set_input_stub(NULL);
+ mouse_input_filter_.set_input_stub(nullptr);
client_.reset();
video_renderer_.reset();
}
@@ -1046,7 +1046,7 @@
// Unregister this instance for logging.
g_has_logging_instance = false;
g_logging_instance.Get().reset();
- g_logging_task_runner.Get() = NULL;
+ g_logging_task_runner.Get() = nullptr;
VLOG(1) << "Unregistering global log handler";
}
diff --git a/remoting/client/plugin/delegating_signal_strategy.cc b/remoting/client/plugin/delegating_signal_strategy.cc
index 19ae422..f8d02fd2 100644
--- a/remoting/client/plugin/delegating_signal_strategy.cc
+++ b/remoting/client/plugin/delegating_signal_strategy.cc
@@ -29,7 +29,7 @@
ObserverListBase<Listener>::Iterator it(listeners_);
Listener* listener;
- while ((listener = it.GetNext()) != NULL) {
+ while ((listener = it.GetNext()) != nullptr) {
if (listener->OnSignalStrategyIncomingStanza(stanza.get()))
break;
}
diff --git a/remoting/client/plugin/pepper_entrypoints.cc b/remoting/client/plugin/pepper_entrypoints.cc
index e337ed2..f6086c36 100644
--- a/remoting/client/plugin/pepper_entrypoints.cc
+++ b/remoting/client/plugin/pepper_entrypoints.cc
@@ -43,18 +43,18 @@
void PPP_ShutdownModule() {
delete pp::Module::Get();
- pp::InternalSetModuleSingleton(NULL);
+ pp::InternalSetModuleSingleton(nullptr);
}
const void* PPP_GetInterface(const char* interface_name) {
if (!pp::Module::Get())
- return NULL;
+ return nullptr;
return pp::Module::Get()->GetPluginInterface(interface_name);
}
const void* PPP_GetBrowserInterface(const char* interface_name) {
if (!pp::Module::Get())
- return NULL;
+ return nullptr;
return pp::Module::Get()->GetBrowserInterface(interface_name);
}
diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc
index fa80d46..157efe5 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -60,7 +60,7 @@
} // namespace
PepperInputHandler::PepperInputHandler()
- : input_stub_(NULL),
+ : input_stub_(nullptr),
has_focus_(false),
send_mouse_input_when_unfocused_(false),
send_mouse_move_deltas_(false),
diff --git a/remoting/client/plugin/pepper_packet_socket_factory.cc b/remoting/client/plugin/pepper_packet_socket_factory.cc
index e1b7ed2..b8a1249 100644
--- a/remoting/client/plugin/pepper_packet_socket_factory.cc
+++ b/remoting/client/plugin/pepper_packet_socket_factory.cc
@@ -413,7 +413,7 @@
uint16 max_port) {
scoped_ptr<UdpPacketSocket> result(new UdpPacketSocket(pp_instance_));
if (!result->Init(local_address, min_port, max_port))
- return NULL;
+ return nullptr;
return result.release();
}
@@ -424,7 +424,7 @@
int opts) {
// We don't use TCP sockets for remoting connections.
NOTREACHED();
- return NULL;
+ return nullptr;
}
rtc::AsyncPacketSocket* PepperPacketSocketFactory::CreateClientTcpSocket(
@@ -435,7 +435,7 @@
int opts) {
// We don't use TCP sockets for remoting connections.
NOTREACHED();
- return NULL;
+ return nullptr;
}
rtc::AsyncResolverInterface*
diff --git a/remoting/client/server_log_entry_client.cc b/remoting/client/server_log_entry_client.cc
index 981d1086..d8ff47a 100644
--- a/remoting/client/server_log_entry_client.cc
+++ b/remoting/client/server_log_entry_client.cc
@@ -56,7 +56,7 @@
return kValueSessionStateClosed;
default:
NOTREACHED();
- return NULL;
+ return nullptr;
}
}
@@ -86,7 +86,7 @@
return "unknown-error";
default:
NOTREACHED();
- return NULL;
+ return nullptr;
}
}
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();
}
diff --git a/remoting/protocol/audio_reader.cc b/remoting/protocol/audio_reader.cc
index 0cede0b..c4f036d 100644
--- a/remoting/protocol/audio_reader.cc
+++ b/remoting/protocol/audio_reader.cc
@@ -16,7 +16,7 @@
AudioReader::AudioReader(AudioPacket::Encoding encoding)
: ChannelDispatcherBase(kAudioChannelName),
encoding_(encoding),
- audio_stub_(NULL) {
+ audio_stub_(nullptr) {
}
AudioReader::~AudioReader() {
diff --git a/remoting/protocol/authenticator.h b/remoting/protocol/authenticator.h
index 1210989..5ed10d86 100644
--- a/remoting/protocol/authenticator.h
+++ b/remoting/protocol/authenticator.h
@@ -79,7 +79,7 @@
static scoped_ptr<buzz::XmlElement> CreateEmptyAuthenticatorMessage();
// Finds Authenticator message among child elements of |message|, or
- // returns NULL otherwise.
+ // returns nullptr otherwise.
static const buzz::XmlElement* FindAuthenticatorMessage(
const buzz::XmlElement* message);
@@ -125,7 +125,7 @@
// authenticator for the new session. |first_message| specifies
// authentication part of the session-initiate stanza so that
// appropriate type of Authenticator can be chosen for the session
- // (useful when multiple authenticators is supported). Returns NULL
+ // (useful when multiple authenticators is supported). Returns nullptr
// if the |first_message| is invalid and the session should be
// rejected. ProcessMessage() should be called with |first_message|
// for the result of this method.
diff --git a/remoting/protocol/authenticator_test_base.cc b/remoting/protocol/authenticator_test_base.cc
index 50708a7..09bb5977 100644
--- a/remoting/protocol/authenticator_test_base.cc
+++ b/remoting/protocol/authenticator_test_base.cc
@@ -151,8 +151,8 @@
testing::Mock::VerifyAndClearExpectations(&host_callback_);
if (!expected_fail) {
- ASSERT_TRUE(client_socket_.get() != NULL);
- ASSERT_TRUE(host_socket_.get() != NULL);
+ ASSERT_TRUE(client_socket_.get() != nullptr);
+ ASSERT_TRUE(host_socket_.get() != nullptr);
}
}
diff --git a/remoting/protocol/buffered_socket_writer.cc b/remoting/protocol/buffered_socket_writer.cc
index 8ebe593..28845f9 100644
--- a/remoting/protocol/buffered_socket_writer.cc
+++ b/remoting/protocol/buffered_socket_writer.cc
@@ -27,10 +27,10 @@
BufferedSocketWriterBase::BufferedSocketWriterBase()
: buffer_size_(0),
- socket_(NULL),
+ socket_(nullptr),
write_pending_(false),
closed_(false),
- destroyed_flag_(NULL) {
+ destroyed_flag_(nullptr) {
}
void BufferedSocketWriterBase::Init(net::Socket* socket,
@@ -115,7 +115,7 @@
// Stop doing anything if we've been destroyed by the callback.
return;
}
- destroyed_flag_ = NULL;
+ destroyed_flag_ = nullptr;
}
*write_again = true;
@@ -177,7 +177,7 @@
net::IOBuffer** buffer, int* size) {
if (!current_buf_.get()) {
if (queue_.empty()) {
- *buffer = NULL;
+ *buffer = nullptr;
return; // Nothing to write.
}
current_buf_ = new net::DrainableIOBuffer(queue_.front()->data.get(),
@@ -193,14 +193,14 @@
current_buf_->DidConsume(written);
if (current_buf_->BytesRemaining() == 0) {
- current_buf_ = NULL;
+ current_buf_ = nullptr;
return PopQueue();
}
return base::Closure();
}
void BufferedSocketWriter::OnError(int result) {
- current_buf_ = NULL;
+ current_buf_ = nullptr;
}
BufferedSocketWriter::~BufferedSocketWriter() {
@@ -212,7 +212,7 @@
void BufferedDatagramWriter::GetNextPacket(
net::IOBuffer** buffer, int* size) {
if (queue_.empty()) {
- *buffer = NULL;
+ *buffer = nullptr;
return; // Nothing to write.
}
*buffer = queue_.front()->data.get();
diff --git a/remoting/protocol/buffered_socket_writer.h b/remoting/protocol/buffered_socket_writer.h
index ab8ba0d6..264de45 100644
--- a/remoting/protocol/buffered_socket_writer.h
+++ b/remoting/protocol/buffered_socket_writer.h
@@ -73,7 +73,7 @@
// Following three methods must be implemented in child classes.
// Returns next packet that needs to be written to the socket. Implementation
- // must set |*buffer| to NULL if there is nothing left in the queue.
+ // must set |*buffer| to nullptr if there is nothing left in the queue.
virtual void GetNextPacket(net::IOBuffer** buffer, int* size) = 0;
// Returns closure that must be executed or null closure if the last write
diff --git a/remoting/protocol/channel_dispatcher_base.cc b/remoting/protocol/channel_dispatcher_base.cc
index 945f5e2f..0209cc2 100644
--- a/remoting/protocol/channel_dispatcher_base.cc
+++ b/remoting/protocol/channel_dispatcher_base.cc
@@ -15,7 +15,7 @@
ChannelDispatcherBase::ChannelDispatcherBase(const char* channel_name)
: channel_name_(channel_name),
- channel_factory_(NULL) {
+ channel_factory_(nullptr) {
}
ChannelDispatcherBase::~ChannelDispatcherBase() {
@@ -55,7 +55,7 @@
return;
}
- channel_factory_ = NULL;
+ channel_factory_ = nullptr;
channel_ = socket.Pass();
OnInitialized();
diff --git a/remoting/protocol/channel_dispatcher_base.h b/remoting/protocol/channel_dispatcher_base.h
index f71d291..705b224 100644
--- a/remoting/protocol/channel_dispatcher_base.h
+++ b/remoting/protocol/channel_dispatcher_base.h
@@ -41,7 +41,7 @@
const InitializedCallback& callback);
// Returns true if the channel is currently connected.
- bool is_connected() { return channel() != NULL; }
+ bool is_connected() { return channel() != nullptr; }
protected:
explicit ChannelDispatcherBase(const char* channel_name);
diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc
index abeb7b217..62bb9d2 100644
--- a/remoting/protocol/channel_multiplexer.cc
+++ b/remoting/protocol/channel_multiplexer.cc
@@ -191,7 +191,7 @@
send_id_(send_id),
id_sent_(false),
receive_id_(kChannelIdUnknown),
- socket_(NULL) {
+ socket_(nullptr) {
}
ChannelMultiplexer::MuxChannel::~MuxChannel() {
@@ -227,7 +227,7 @@
void ChannelMultiplexer::MuxChannel::OnSocketDestroyed() {
DCHECK(socket_);
- socket_ = NULL;
+ socket_ = nullptr;
}
bool ChannelMultiplexer::MuxChannel::DoWrite(
@@ -335,7 +335,7 @@
void ChannelMultiplexer::MuxSocket::OnPacketReceived() {
if (!read_callback_.is_null()) {
int result = channel_->DoRead(read_buffer_.get(), read_buffer_size_);
- read_buffer_ = NULL;
+ read_buffer_ = nullptr;
DCHECK_GT(result, 0);
net::CompletionCallback cb;
std::swap(cb, read_callback_);
@@ -395,7 +395,7 @@
void ChannelMultiplexer::OnBaseChannelReady(
scoped_ptr<net::StreamSocket> socket) {
- base_channel_factory_ = NULL;
+ base_channel_factory_ = nullptr;
base_channel_ = socket.Pass();
if (base_channel_.get()) {
@@ -472,7 +472,7 @@
}
int receive_id = packet->channel_id();
- MuxChannel* channel = NULL;
+ MuxChannel* channel = nullptr;
std::map<int, MuxChannel*>::iterator it =
channels_by_receive_id_.find(receive_id);
if (it != channels_by_receive_id_.end()) {
diff --git a/remoting/protocol/channel_multiplexer.h b/remoting/protocol/channel_multiplexer.h
index 74f268e..2b93d2e 100644
--- a/remoting/protocol/channel_multiplexer.h
+++ b/remoting/protocol/channel_multiplexer.h
@@ -57,7 +57,7 @@
bool DoWrite(scoped_ptr<MultiplexPacket> packet,
const base::Closure& done_task);
- // Factory used to create |base_channel_|. Set to NULL once creation is
+ // Factory used to create |base_channel_|. Set to nullptr once creation is
// finished or failed.
StreamChannelFactory* base_channel_factory_;
diff --git a/remoting/protocol/channel_multiplexer_unittest.cc b/remoting/protocol/channel_multiplexer_unittest.cc
index 37b7e897..bb8d30f 100644
--- a/remoting/protocol/channel_multiplexer_unittest.cc
+++ b/remoting/protocol/channel_multiplexer_unittest.cc
@@ -363,7 +363,7 @@
host_mux_->CreateChannel(kTestChannelName2, base::Bind(
&MockConnectCallback::OnConnected, base::Unretained(&cb2)));
- EXPECT_CALL(cb1, OnConnectedPtr(NULL))
+ EXPECT_CALL(cb1, OnConnectedPtr(nullptr))
.Times(AtMost(1))
.WillOnce(InvokeWithoutArgs(
this, &ChannelMultiplexerTest::DeleteAfterSessionFail));
diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc
index 6777937d..6b2c4fc 100644
--- a/remoting/protocol/chromium_socket_factory.cc
+++ b/remoting/protocol/chromium_socket_factory.cc
@@ -123,7 +123,7 @@
}
for (uint32 port = min_port; port <= max_port; ++port) {
- socket_.reset(new net::UDPServerSocket(NULL, net::NetLog::Source()));
+ socket_.reset(new net::UDPServerSocket(nullptr, net::NetLog::Source()));
int result = socket_->Listen(
net::IPEndPoint(local_endpoint.address(), static_cast<uint16>(port)));
if (result == net::OK) {
@@ -364,7 +364,7 @@
uint16 min_port, uint16 max_port) {
scoped_ptr<UdpPacketSocket> result(new UdpPacketSocket());
if (!result->Init(local_address, min_port, max_port))
- return NULL;
+ return nullptr;
return result.release();
}
@@ -375,7 +375,7 @@
int opts) {
// We don't use TCP sockets for remoting connections.
NOTIMPLEMENTED();
- return NULL;
+ return nullptr;
}
rtc::AsyncPacketSocket*
@@ -387,7 +387,7 @@
int opts) {
// We don't use TCP sockets for remoting connections.
NOTREACHED();
- return NULL;
+ return nullptr;
}
rtc::AsyncResolverInterface*
diff --git a/remoting/protocol/chromium_socket_factory_unittest.cc b/remoting/protocol/chromium_socket_factory_unittest.cc
index d1b8a9c..1f1310995 100644
--- a/remoting/protocol/chromium_socket_factory_unittest.cc
+++ b/remoting/protocol/chromium_socket_factory_unittest.cc
@@ -22,7 +22,7 @@
socket_.reset(socket_factory_->CreateUdpSocket(
rtc::SocketAddress("127.0.0.1", 0), 0, 0));
- ASSERT_TRUE(socket_.get() != NULL);
+ ASSERT_TRUE(socket_.get() != nullptr);
EXPECT_EQ(socket_->GetState(), rtc::AsyncPacketSocket::STATE_BOUND);
socket_->SignalReadPacket.connect(
this, &ChromiumSocketFactoryTest::OnPacket);
@@ -71,7 +71,7 @@
scoped_ptr<rtc::AsyncPacketSocket> sending_socket(
socket_factory_->CreateUdpSocket(
rtc::SocketAddress("127.0.0.1", 0), 0, 0));
- ASSERT_TRUE(sending_socket.get() != NULL);
+ ASSERT_TRUE(sending_socket.get() != nullptr);
EXPECT_EQ(sending_socket->GetState(),
rtc::AsyncPacketSocket::STATE_BOUND);
@@ -88,7 +88,7 @@
const uint16 kMaxPort = 12410;
socket_.reset(socket_factory_->CreateUdpSocket(
rtc::SocketAddress("127.0.0.1", 0), kMaxPort, kMaxPort));
- ASSERT_TRUE(socket_.get() != NULL);
+ ASSERT_TRUE(socket_.get() != nullptr);
EXPECT_EQ(socket_->GetState(), rtc::AsyncPacketSocket::STATE_BOUND);
EXPECT_GE(socket_->GetLocalAddress().port(), kMinPort);
EXPECT_LE(socket_->GetLocalAddress().port(), kMaxPort);
diff --git a/remoting/protocol/client_control_dispatcher.cc b/remoting/protocol/client_control_dispatcher.cc
index 5a6bad59..f08e6cf 100644
--- a/remoting/protocol/client_control_dispatcher.cc
+++ b/remoting/protocol/client_control_dispatcher.cc
@@ -60,8 +60,8 @@
ClientControlDispatcher::ClientControlDispatcher()
: ChannelDispatcherBase(kControlChannelName),
- client_stub_(NULL),
- clipboard_stub_(NULL) {
+ client_stub_(nullptr),
+ clipboard_stub_(nullptr) {
}
ClientControlDispatcher::~ClientControlDispatcher() {
diff --git a/remoting/protocol/clipboard_echo_filter.cc b/remoting/protocol/clipboard_echo_filter.cc
index d89c43c..206f6619 100644
--- a/remoting/protocol/clipboard_echo_filter.cc
+++ b/remoting/protocol/clipboard_echo_filter.cc
@@ -10,8 +10,8 @@
namespace protocol {
ClipboardEchoFilter::ClipboardEchoFilter()
- : host_stub_(NULL),
- client_stub_(NULL),
+ : host_stub_(nullptr),
+ client_stub_(nullptr),
client_filter_(this),
host_filter_(this) {
}
diff --git a/remoting/protocol/clipboard_filter.cc b/remoting/protocol/clipboard_filter.cc
index d82547f..e45140e2 100644
--- a/remoting/protocol/clipboard_filter.cc
+++ b/remoting/protocol/clipboard_filter.cc
@@ -8,7 +8,7 @@
namespace remoting {
namespace protocol {
-ClipboardFilter::ClipboardFilter() : clipboard_stub_(NULL), enabled_(true) {
+ClipboardFilter::ClipboardFilter() : clipboard_stub_(nullptr), enabled_(true) {
}
ClipboardFilter::ClipboardFilter(ClipboardStub* clipboard_stub)
@@ -23,7 +23,7 @@
}
void ClipboardFilter::InjectClipboardEvent(const ClipboardEvent& event) {
- if (enabled_ && clipboard_stub_ != NULL)
+ if (enabled_ && clipboard_stub_ != nullptr)
clipboard_stub_->InjectClipboardEvent(event);
}
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index 2135190b..536fa75 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -19,10 +19,10 @@
namespace protocol {
ConnectionToClient::ConnectionToClient(protocol::Session* session)
- : handler_(NULL),
- clipboard_stub_(NULL),
- host_stub_(NULL),
- input_stub_(NULL),
+ : handler_(nullptr),
+ clipboard_stub_(nullptr),
+ host_stub_(nullptr),
+ input_stub_(nullptr),
session_(session) {
session_->SetEventHandler(this);
}
diff --git a/remoting/protocol/connection_to_client.h b/remoting/protocol/connection_to_client.h
index f221dcce..8f075b7 100644
--- a/remoting/protocol/connection_to_client.h
+++ b/remoting/protocol/connection_to_client.h
@@ -86,7 +86,7 @@
// Get the stubs used by the host to transmit messages to the client.
// The stubs must not be accessed before OnConnectionAuthenticated(), or
// after OnConnectionClosed().
- // Note that the audio stub will be NULL if audio is not enabled.
+ // Note that the audio stub will be nullptr if audio is not enabled.
virtual VideoStub* video_stub();
virtual AudioStub* audio_stub();
virtual ClientStub* client_stub();
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 94f33c8..9217202b 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -26,11 +26,11 @@
namespace protocol {
ConnectionToHost::ConnectionToHost()
- : event_callback_(NULL),
- client_stub_(NULL),
- clipboard_stub_(NULL),
- audio_stub_(NULL),
- signal_strategy_(NULL),
+ : event_callback_(nullptr),
+ client_stub_(nullptr),
+ clipboard_stub_(nullptr),
+ audio_stub_(nullptr),
+ signal_strategy_(nullptr),
state_(INITIALIZING),
error_(OK) {
}
@@ -287,8 +287,8 @@
void ConnectionToHost::CloseChannels() {
control_dispatcher_.reset();
event_dispatcher_.reset();
- clipboard_forwarder_.set_clipboard_stub(NULL);
- event_forwarder_.set_input_stub(NULL);
+ clipboard_forwarder_.set_clipboard_stub(nullptr);
+ event_forwarder_.set_input_stub(nullptr);
video_dispatcher_.reset();
audio_reader_.reset();
}
diff --git a/remoting/protocol/content_description.cc b/remoting/protocol/content_description.cc
index 0308fda2..5d8aaac 100644
--- a/remoting/protocol/content_description.cc
+++ b/remoting/protocol/content_description.cc
@@ -123,7 +123,7 @@
ContentDescription* ContentDescription::Copy() const {
if (!candidate_config_.get() || !authenticator_message_.get()) {
- return NULL;
+ return nullptr;
}
scoped_ptr<XmlElement> message(new XmlElement(*authenticator_message_));
return new ContentDescription(candidate_config_->Clone(), message.Pass());
diff --git a/remoting/protocol/datagram_channel_factory.h b/remoting/protocol/datagram_channel_factory.h
index 6d94ae5..ae22dde2 100644
--- a/remoting/protocol/datagram_channel_factory.h
+++ b/remoting/protocol/datagram_channel_factory.h
@@ -24,10 +24,11 @@
DatagramChannelFactory() {}
// Creates new channels and calls the |callback| when then new channel is
- // created and connected. The |callback| is called with NULL if channel setup
- // failed for any reason. Callback may be called synchronously, before the
- // call returns. All channels must be destroyed, and CancelChannelCreation()
- // called for any pending channels, before the factory is destroyed.
+ // created and connected. The |callback| is called with nullptr if channel
+ // setup failed for any reason. Callback may be called synchronously, before
+ // the call returns. All channels must be destroyed, and
+ // CancelChannelCreation() called for any pending channels, before the factory
+ // is destroyed.
virtual void CreateChannel(const std::string& name,
const ChannelCreatedCallback& callback) = 0;
diff --git a/remoting/protocol/fake_datagram_socket.cc b/remoting/protocol/fake_datagram_socket.cc
index daf6a4be..75a50b3 100644
--- a/remoting/protocol/fake_datagram_socket.cc
+++ b/remoting/protocol/fake_datagram_socket.cc
@@ -34,7 +34,7 @@
if (!read_callback_.is_null()) {
DCHECK_EQ(input_pos_, static_cast<int>(input_packets_.size()) - 1);
int result = CopyReadData(read_buffer_.get(), read_buffer_size_);
- read_buffer_ = NULL;
+ read_buffer_ = nullptr;
net::CompletionCallback callback = read_callback_;
read_callback_.Reset();
@@ -110,7 +110,7 @@
FakeDatagramChannelFactory::~FakeDatagramChannelFactory() {
for (ChannelsMap::iterator it = channels_.begin(); it != channels_.end();
++it) {
- EXPECT_TRUE(it->second == NULL);
+ EXPECT_TRUE(it->second == nullptr);
}
}
@@ -128,7 +128,7 @@
void FakeDatagramChannelFactory::CreateChannel(
const std::string& name,
const ChannelCreatedCallback& callback) {
- EXPECT_TRUE(channels_[name] == NULL);
+ EXPECT_TRUE(channels_[name] == nullptr);
scoped_ptr<FakeDatagramSocket> channel(new FakeDatagramSocket());
channels_[name] = channel->GetWeakPtr();
diff --git a/remoting/protocol/fake_datagram_socket.h b/remoting/protocol/fake_datagram_socket.h
index 86369ae..9669c0b 100644
--- a/remoting/protocol/fake_datagram_socket.h
+++ b/remoting/protocol/fake_datagram_socket.h
@@ -100,7 +100,7 @@
// Can be used to retrieve FakeDatagramSocket created by this factory, e.g. to
// feed data into it. The caller doesn't get ownership of the result. Returns
- // NULL if the socket doesn't exist.
+ // nullptr if the socket doesn't exist.
FakeDatagramSocket* GetFakeChannel(const std::string& name);
// DatagramChannelFactory interface.
diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc
index fe5a2eb1..ba6a5a97 100644
--- a/remoting/protocol/fake_session.cc
+++ b/remoting/protocol/fake_session.cc
@@ -10,7 +10,7 @@
const char kTestJid[] = "[email protected]/chromoting123";
FakeSession::FakeSession()
- : event_handler_(NULL),
+ : event_handler_(nullptr),
candidate_config_(CandidateSessionConfig::CreateDefault()),
config_(SessionConfig::ForTest()),
jid_(kTestJid),
diff --git a/remoting/protocol/fake_stream_socket.cc b/remoting/protocol/fake_stream_socket.cc
index 57ce4f6b..678b9f5c 100644
--- a/remoting/protocol/fake_stream_socket.cc
+++ b/remoting/protocol/fake_stream_socket.cc
@@ -43,7 +43,7 @@
memcpy(read_buffer_->data(),
&(*input_data_.begin()) + input_pos_, result);
input_pos_ += result;
- read_buffer_ = NULL;
+ read_buffer_ = nullptr;
net::CompletionCallback callback = read_callback_;
read_callback_.Reset();
diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc
index dfb7d181..0c19d17 100644
--- a/remoting/protocol/host_control_dispatcher.cc
+++ b/remoting/protocol/host_control_dispatcher.cc
@@ -19,8 +19,8 @@
HostControlDispatcher::HostControlDispatcher()
: ChannelDispatcherBase(kControlChannelName),
- clipboard_stub_(NULL),
- host_stub_(NULL) {
+ clipboard_stub_(nullptr),
+ host_stub_(nullptr) {
}
HostControlDispatcher::~HostControlDispatcher() {
diff --git a/remoting/protocol/host_event_dispatcher.cc b/remoting/protocol/host_event_dispatcher.cc
index 3ece9bb..7bc93fb 100644
--- a/remoting/protocol/host_event_dispatcher.cc
+++ b/remoting/protocol/host_event_dispatcher.cc
@@ -16,7 +16,7 @@
HostEventDispatcher::HostEventDispatcher()
: ChannelDispatcherBase(kEventChannelName),
- input_stub_(NULL) {
+ input_stub_(nullptr) {
}
HostEventDispatcher::~HostEventDispatcher() {
diff --git a/remoting/protocol/input_filter.cc b/remoting/protocol/input_filter.cc
index 66ea2d1..44bc247 100644
--- a/remoting/protocol/input_filter.cc
+++ b/remoting/protocol/input_filter.cc
@@ -7,7 +7,7 @@
namespace remoting {
namespace protocol {
-InputFilter::InputFilter() : input_stub_(NULL), enabled_(true) {
+InputFilter::InputFilter() : input_stub_(nullptr), enabled_(true) {
}
InputFilter::InputFilter(InputStub* input_stub)
@@ -18,17 +18,17 @@
}
void InputFilter::InjectKeyEvent(const KeyEvent& event) {
- if (enabled_ && input_stub_ != NULL)
+ if (enabled_ && input_stub_ != nullptr)
input_stub_->InjectKeyEvent(event);
}
void InputFilter::InjectTextEvent(const TextEvent& event) {
- if (enabled_ && input_stub_ != NULL)
+ if (enabled_ && input_stub_ != nullptr)
input_stub_->InjectTextEvent(event);
}
void InputFilter::InjectMouseEvent(const MouseEvent& event) {
- if (enabled_ && input_stub_ != NULL)
+ if (enabled_ && input_stub_ != nullptr)
input_stub_->InjectMouseEvent(event);
}
diff --git a/remoting/protocol/it2me_host_authenticator_factory.cc b/remoting/protocol/it2me_host_authenticator_factory.cc
index 20a1ada..d20f2e8a 100644
--- a/remoting/protocol/it2me_host_authenticator_factory.cc
+++ b/remoting/protocol/it2me_host_authenticator_factory.cc
@@ -28,7 +28,8 @@
const std::string& remote_jid,
const buzz::XmlElement* first_message) {
return NegotiatingHostAuthenticator::CreateWithSharedSecret(
- local_cert_, key_pair_, shared_secret_, AuthenticationMethod::NONE, NULL);
+ local_cert_, key_pair_, shared_secret_, AuthenticationMethod::NONE,
+ nullptr);
}
} // namespace protocol
diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc
index f59a56d..c2c9b80 100644
--- a/remoting/protocol/jingle_messages.cc
+++ b/remoting/protocol/jingle_messages.cc
@@ -126,7 +126,7 @@
bool JingleMessage::IsJingleMessage(const buzz::XmlElement* stanza) {
return stanza->Name() == QName(kJabberNamespace, "iq") &&
stanza->Attr(QName(std::string(), "type")) == "set" &&
- stanza->FirstNamed(QName(kJingleNamespace, "jingle")) != NULL;
+ stanza->FirstNamed(QName(kJingleNamespace, "jingle")) != nullptr;
}
// static
@@ -194,7 +194,7 @@
// session-info is allowed to be empty.
info.reset(new XmlElement(*child));
} else {
- info.reset(NULL);
+ info.reset(nullptr);
}
return true;
}
@@ -224,7 +224,7 @@
return false;
}
- description.reset(NULL);
+ description.reset(nullptr);
if (action == SESSION_INITIATE || action == SESSION_ACCEPT) {
const XmlElement* description_tag = content_tag->FirstNamed(
QName(kChromotingXmlNamespace, "description"));
@@ -247,7 +247,7 @@
QName qn_candidate(kP2PTransportNamespace, "candidate");
for (const XmlElement* candidate_tag =
transport_tag->FirstNamed(qn_candidate);
- candidate_tag != NULL;
+ candidate_tag != nullptr;
candidate_tag = candidate_tag->NextNamed(qn_candidate)) {
NamedCandidate candidate;
if (!ParseCandidate(candidate_tag, &candidate)) {
@@ -363,7 +363,7 @@
iq->SetAttr(QName(kEmptyNamespace, "type"), "error");
for (const buzz::XmlElement* child = request_stanza->FirstElement();
- child != NULL; child = child->NextElement()) {
+ child != nullptr; child = child->NextElement()) {
iq->AddElement(new buzz::XmlElement(*child));
}
diff --git a/remoting/protocol/jingle_messages_unittest.cc b/remoting/protocol/jingle_messages_unittest.cc
index 26a22d1..de58443 100644
--- a/remoting/protocol/jingle_messages_unittest.cc
+++ b/remoting/protocol/jingle_messages_unittest.cc
@@ -41,7 +41,7 @@
return false;
}
- for (const XmlAttr* exp_attr = exp->FirstAttr(); exp_attr != NULL;
+ for (const XmlAttr* exp_attr = exp->FirstAttr(); exp_attr != nullptr;
exp_attr = exp_attr->NextAttr()) {
if (exp_attr->Name().Namespace() == kXmlNsNs ||
exp_attr->Name() == QName(kXmlNs)) {
@@ -256,7 +256,7 @@
EXPECT_TRUE(message.ParseXml(source_message.get(), &error)) << error;
EXPECT_EQ(message.action, JingleMessage::SESSION_INFO);
- ASSERT_TRUE(message.info.get() != NULL);
+ ASSERT_TRUE(message.info.get() != nullptr);
EXPECT_TRUE(message.info->Name() ==
buzz::QName("urn:xmpp:jingle:1", "test-info"));
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 2277ac0..edc48eea 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -71,7 +71,7 @@
JingleSession::JingleSession(JingleSessionManager* session_manager)
: session_manager_(session_manager),
- event_handler_(NULL),
+ event_handler_(nullptr),
state_(INITIALIZING),
error_(OK),
config_is_set_(false),
@@ -342,7 +342,7 @@
std::string type_str = JingleMessage::GetActionName(request_type);
- // |response| will be NULL if the request timed out.
+ // |response| will be nullptr if the request timed out.
if (!response) {
LOG(ERROR) << type_str << " request timed out.";
CloseInternal(SIGNALING_TIMEOUT);
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc
index 1adef6f..16cd369 100644
--- a/remoting/protocol/jingle_session_manager.cc
+++ b/remoting/protocol/jingle_session_manager.cc
@@ -23,8 +23,8 @@
JingleSessionManager::JingleSessionManager(
scoped_ptr<TransportFactory> transport_factory)
: transport_factory_(transport_factory.Pass()),
- signal_strategy_(NULL),
- listener_(NULL),
+ signal_strategy_(nullptr),
+ listener_(nullptr),
ready_(false) {
}
@@ -63,11 +63,11 @@
// Close() can be called only after all sessions are destroyed.
DCHECK(sessions_.empty());
- listener_ = NULL;
+ listener_ = nullptr;
if (signal_strategy_) {
signal_strategy_->RemoveListener(this);
- signal_strategy_ = NULL;
+ signal_strategy_ = nullptr;
}
}
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc
index c92448ab..6ea3fb6 100644
--- a/remoting/protocol/jingle_session_unittest.cc
+++ b/remoting/protocol/jingle_session_unittest.cc
@@ -151,8 +151,8 @@
NetworkSettings network_settings(NetworkSettings::NAT_TRAVERSAL_OUTGOING);
scoped_ptr<TransportFactory> host_transport(new LibjingleTransportFactory(
- NULL,
- ChromiumPortAllocator::Create(NULL, network_settings).Pass(),
+ nullptr,
+ ChromiumPortAllocator::Create(nullptr, network_settings).Pass(),
network_settings));
host_server_.reset(new JingleSessionManager(host_transport.Pass()));
host_server_->Init(host_signal_strategy_.get(), &host_server_listener_);
@@ -165,8 +165,8 @@
EXPECT_CALL(client_server_listener_, OnSessionManagerReady())
.Times(1);
scoped_ptr<TransportFactory> client_transport(new LibjingleTransportFactory(
- NULL,
- ChromiumPortAllocator::Create(NULL, network_settings).Pass(),
+ nullptr,
+ ChromiumPortAllocator::Create(nullptr, network_settings).Pass(),
network_settings));
client_server_.reset(
new JingleSessionManager(client_transport.Pass()));
@@ -506,7 +506,7 @@
// Terminate the message loop when we get rejection notification
// from the host.
- EXPECT_CALL(host_channel_callback_, OnDone(NULL))
+ EXPECT_CALL(host_channel_callback_, OnDone(nullptr))
.WillOnce(QuitThread());
ExpectRouteChange(kChannelName);
diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc
index 310b40e..fe8a076 100644
--- a/remoting/protocol/libjingle_transport_factory.cc
+++ b/remoting/protocol/libjingle_transport_factory.cc
@@ -115,7 +115,7 @@
const NetworkSettings& network_settings)
: port_allocator_(port_allocator),
network_settings_(network_settings),
- event_handler_(NULL),
+ event_handler_(nullptr),
ice_username_fragment_(
rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH)),
ice_password_(rtc::CreateRandomString(cricket::ICE_PWD_LENGTH)),
@@ -178,7 +178,7 @@
// Create P2PTransportChannel, attach signal handlers and connect it.
// TODO(sergeyu): Specify correct component ID for the channel.
channel_.reset(new cricket::P2PTransportChannel(
- std::string(), 0, NULL, port_allocator_));
+ std::string(), 0, nullptr, port_allocator_));
channel_->SetIceProtocolType(cricket::ICEPROTO_GOOGLE);
channel_->SetIceCredentials(ice_username_fragment_, ice_password_);
channel_->SignalRequestSignaling.connect(
diff --git a/remoting/protocol/message_decoder.cc b/remoting/protocol/message_decoder.cc
index 59e78b7..20d79bfa 100644
--- a/remoting/protocol/message_decoder.cc
+++ b/remoting/protocol/message_decoder.cc
@@ -39,7 +39,7 @@
// If the next payload size is still not known or we don't have enough
// data for parsing then exit.
if (!next_payload_known_ || buffer_.total_bytes() < next_payload_)
- return NULL;
+ return nullptr;
CompoundBuffer* message_buffer = new CompoundBuffer();
message_buffer->CopyFrom(buffer_, 0, next_payload_);
diff --git a/remoting/protocol/message_decoder.h b/remoting/protocol/message_decoder.h
index 70a1a073..fc42871d 100644
--- a/remoting/protocol/message_decoder.h
+++ b/remoting/protocol/message_decoder.h
@@ -40,7 +40,7 @@
void AddData(scoped_refptr<net::IOBuffer> data, int data_size);
// Returns next message from the stream. Ownership of the result is
- // passed to the caller. Returns NULL if there are no complete
+ // passed to the caller. Returns nullptr if there are no complete
// messages yet, otherwise returns a buffer that contains one
// message.
CompoundBuffer* GetNextMessage();
diff --git a/remoting/protocol/message_reader.cc b/remoting/protocol/message_reader.cc
index 1284273..9528b83 100644
--- a/remoting/protocol/message_reader.cc
+++ b/remoting/protocol/message_reader.cc
@@ -22,7 +22,7 @@
static const int kReadBufferSize = 4096;
MessageReader::MessageReader()
- : socket_(NULL),
+ : socket_(nullptr),
read_pending_(false),
pending_messages_(0),
closed_(false),
diff --git a/remoting/protocol/name_value_map.h b/remoting/protocol/name_value_map.h
index 02e7bc3..587188a2 100644
--- a/remoting/protocol/name_value_map.h
+++ b/remoting/protocol/name_value_map.h
@@ -24,7 +24,7 @@
return map[i].name;
}
NOTREACHED();
- return NULL;
+ return nullptr;
}
template <typename T, size_t N>
diff --git a/remoting/protocol/negotiating_authenticator_unittest.cc b/remoting/protocol/negotiating_authenticator_unittest.cc
index 82e3fc49..2c56882 100644
--- a/remoting/protocol/negotiating_authenticator_unittest.cc
+++ b/remoting/protocol/negotiating_authenticator_unittest.cc
@@ -70,7 +70,7 @@
methods.push_back(AuthenticationMethod::Spake2(
AuthenticationMethod::NONE));
}
- bool pairing_expected = pairing_registry_.get() != NULL;
+ bool pairing_expected = pairing_registry_.get() != nullptr;
FetchSecretCallback fetch_secret_callback =
base::Bind(&NegotiatingAuthenticatorTest::FetchSecret,
client_interactive_pin,
@@ -122,8 +122,8 @@
host_auth_ = host_->CreateChannelAuthenticator();
RunChannelAuth(false);
- EXPECT_TRUE(client_socket_.get() != NULL);
- EXPECT_TRUE(host_socket_.get() != NULL);
+ EXPECT_TRUE(client_socket_.get() != nullptr);
+ EXPECT_TRUE(host_socket_.get() != nullptr);
StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
kMessageSize, kMessages);
diff --git a/remoting/protocol/negotiating_host_authenticator.h b/remoting/protocol/negotiating_host_authenticator.h
index 411cdb1e..16d45e76 100644
--- a/remoting/protocol/negotiating_host_authenticator.h
+++ b/remoting/protocol/negotiating_host_authenticator.h
@@ -30,7 +30,7 @@
~NegotiatingHostAuthenticator() override;
// Creates a host authenticator, using a fixed shared secret/PIN hash.
- // If |pairing_registry| is non-NULL then the Spake2Pair method will
+ // If |pairing_registry| is non-nullptr then the Spake2Pair method will
// be offered, supporting PIN-less authentication.
static scoped_ptr<Authenticator> CreateWithSharedSecret(
const std::string& local_cert,
diff --git a/remoting/protocol/pairing_authenticator_base.cc b/remoting/protocol/pairing_authenticator_base.cc
index 7435e55..54fde0c 100644
--- a/remoting/protocol/pairing_authenticator_base.cc
+++ b/remoting/protocol/pairing_authenticator_base.cc
@@ -117,7 +117,7 @@
std::string error = pairing_failed_tag->Attr(kPairingErrorAttribute);
LOG(ERROR) << "Pairing failed: " << error;
}
- return pairing_failed_tag != NULL;
+ return pairing_failed_tag != nullptr;
}
void PairingAuthenticatorBase::CheckForFailedSpakeExchange(
@@ -131,7 +131,7 @@
using_paired_secret_ = false;
error_message_ = "invalid-shared-secret";
v2_authenticator_.reset();
- buzz::XmlElement* no_message = NULL;
+ buzz::XmlElement* no_message = nullptr;
SetAuthenticatorCallback set_authenticator = base::Bind(
&PairingAuthenticatorBase::SetAuthenticatorAndProcessMessage,
weak_factory_.GetWeakPtr(), no_message, resume_callback);
diff --git a/remoting/protocol/ppapi_module_stub.cc b/remoting/protocol/ppapi_module_stub.cc
index 829aaaa..22d4f6c 100644
--- a/remoting/protocol/ppapi_module_stub.cc
+++ b/remoting/protocol/ppapi_module_stub.cc
@@ -8,7 +8,7 @@
// Factory function for your specialization of the Module object.
Module* CreateModule() {
- return NULL;
+ return nullptr;
}
} // namespace pp
diff --git a/remoting/protocol/session_config.h b/remoting/protocol/session_config.h
index 4246228..c0313a0 100644
--- a/remoting/protocol/session_config.h
+++ b/remoting/protocol/session_config.h
@@ -138,7 +138,7 @@
}
// Selects session configuration that is supported by both participants.
- // NULL is returned if such configuration doesn't exist. When selecting
+ // nullptr is returned if such configuration doesn't exist. When selecting
// channel configuration priority is given to the configs listed first
// in |client_config|.
bool Select(const CandidateSessionConfig* client_config,
@@ -150,7 +150,8 @@
// Extracts final protocol configuration. Must be used for the description
// received in the session-accept stanza. If the selection is ambiguous
// (e.g. there is more than one configuration for one of the channel)
- // or undefined (e.g. no configurations for a channel) then NULL is returned.
+ // or undefined (e.g. no configurations for a channel) then nullptr is
+ // returned.
bool GetFinalConfig(SessionConfig* result) const;
scoped_ptr<CandidateSessionConfig> Clone() const;
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc
index 575f215..e01998d 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc
@@ -138,7 +138,7 @@
}
bool SslHmacChannelAuthenticator::is_ssl_server() {
- return local_key_pair_.get() != NULL;
+ return local_key_pair_.get() != nullptr;
}
void SslHmacChannelAuthenticator::OnConnected(int result) {
@@ -192,8 +192,8 @@
void SslHmacChannelAuthenticator::OnAuthBytesWritten(int result) {
DCHECK(CalledOnValidThread());
- if (HandleAuthBytesWritten(result, NULL))
- WriteAuthenticationBytes(NULL);
+ if (HandleAuthBytesWritten(result, nullptr))
+ WriteAuthenticationBytes(nullptr);
}
bool SslHmacChannelAuthenticator::HandleAuthBytesWritten(
@@ -210,7 +210,7 @@
if (auth_write_buf_->BytesRemaining() > 0)
return true;
- auth_write_buf_ = NULL;
+ auth_write_buf_ = nullptr;
CheckDone(callback_called);
return false;
}
@@ -254,8 +254,8 @@
return false;
}
- auth_read_buf_ = NULL;
- CheckDone(NULL);
+ auth_read_buf_ = nullptr;
+ CheckDone(nullptr);
return false;
}
@@ -275,8 +275,8 @@
}
void SslHmacChannelAuthenticator::CheckDone(bool* callback_called) {
- if (auth_write_buf_.get() == NULL && auth_read_buf_.get() == NULL) {
- DCHECK(socket_.get() != NULL);
+ if (auth_write_buf_.get() == nullptr && auth_read_buf_.get() == nullptr) {
+ DCHECK(socket_.get() != nullptr);
if (callback_called)
*callback_called = true;
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc b/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
index e57ae00..c0c61f8 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator_unittest.cc
@@ -88,9 +88,9 @@
int callback_counter = 2;
if (expected_fail) {
- EXPECT_CALL(client_callback_, OnDone(net::ERR_FAILED, NULL))
+ EXPECT_CALL(client_callback_, OnDone(net::ERR_FAILED, nullptr))
.WillOnce(QuitThreadOnCounter(&callback_counter));
- EXPECT_CALL(host_callback_, OnDone(net::ERR_FAILED, NULL))
+ EXPECT_CALL(host_callback_, OnDone(net::ERR_FAILED, nullptr))
.WillOnce(QuitThreadOnCounter(&callback_counter));
} else {
EXPECT_CALL(client_callback_, OnDone(net::OK, NotNull()))
@@ -151,8 +151,8 @@
RunChannelAuth(false);
- ASSERT_TRUE(client_socket_.get() != NULL);
- ASSERT_TRUE(host_socket_.get() != NULL);
+ ASSERT_TRUE(client_socket_.get() != nullptr);
+ ASSERT_TRUE(host_socket_.get() != nullptr);
StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
100, 2);
@@ -171,7 +171,7 @@
RunChannelAuth(true);
- ASSERT_TRUE(host_socket_.get() == NULL);
+ ASSERT_TRUE(host_socket_.get() == nullptr);
}
} // namespace protocol
diff --git a/remoting/protocol/stream_channel_factory.h b/remoting/protocol/stream_channel_factory.h
index 48088c759..6dc01688 100644
--- a/remoting/protocol/stream_channel_factory.h
+++ b/remoting/protocol/stream_channel_factory.h
@@ -29,7 +29,7 @@
StreamChannelFactory() {}
// Creates new channels and calls the |callback| when then new channel is
- // created and connected. The |callback| is called with NULL if connection
+ // created and connected. The |callback| is called with nullptr if connection
// failed for any reason. Callback may be called synchronously, before the
// call returns. All channels must be destroyed, and CancelChannelCreation()
// called for any pending channels, before the factory is destroyed.
diff --git a/remoting/protocol/v2_authenticator.cc b/remoting/protocol/v2_authenticator.cc
index 37652a2..f37e74f 100644
--- a/remoting/protocol/v2_authenticator.cc
+++ b/remoting/protocol/v2_authenticator.cc
@@ -31,7 +31,7 @@
// static
bool V2Authenticator::IsEkeMessage(const buzz::XmlElement* message) {
- return message->FirstNamed(kEkeTag) != NULL;
+ return message->FirstNamed(kEkeTag) != nullptr;
}
// static
@@ -200,7 +200,7 @@
}
bool V2Authenticator::is_host_side() const {
- return local_key_pair_.get() != NULL;
+ return local_key_pair_.get() != nullptr;
}
} // namespace protocol
diff --git a/remoting/signaling/fake_signal_strategy.cc b/remoting/signaling/fake_signal_strategy.cc
index 62c4ead..d0274997 100644
--- a/remoting/signaling/fake_signal_strategy.cc
+++ b/remoting/signaling/fake_signal_strategy.cc
@@ -136,7 +136,7 @@
ObserverListBase<Listener>::Iterator it(listeners_);
Listener* listener;
- while ((listener = it.GetNext()) != NULL) {
+ while ((listener = it.GetNext()) != nullptr) {
if (listener->OnSignalStrategyIncomingStanza(stanza_ptr))
break;
}
diff --git a/remoting/signaling/iq_sender.cc b/remoting/signaling/iq_sender.cc
index f2779369..d3e7432 100644
--- a/remoting/signaling/iq_sender.cc
+++ b/remoting/signaling/iq_sender.cc
@@ -146,7 +146,7 @@
}
void IqRequest::OnTimeout() {
- CallCallback(NULL);
+ CallCallback(nullptr);
}
void IqRequest::OnResponse(const buzz::XmlElement* stanza) {
diff --git a/remoting/signaling/iq_sender.h b/remoting/signaling/iq_sender.h
index 02744ed..dfdfbfe3 100644
--- a/remoting/signaling/iq_sender.h
+++ b/remoting/signaling/iq_sender.h
@@ -33,7 +33,7 @@
class IqSender : public SignalStrategy::Listener {
public:
// Callback that is called when an Iq response is received. Called
- // with the |response| set to NULL in case of a timeout.
+ // with the |response| set to nullptr in case of a timeout.
typedef base::Callback<void(IqRequest* request,
const buzz::XmlElement* response)> ReplyCallback;
@@ -85,7 +85,7 @@
~IqRequest();
// Sets timeout for the request. When the timeout expires the
- // callback is called with the |response| set to NULL.
+ // callback is called with the |response| set to nullptr.
void SetTimeout(base::TimeDelta timeout);
private:
diff --git a/remoting/signaling/iq_sender_unittest.cc b/remoting/signaling/iq_sender_unittest.cc
index be305cc..1b7e3e3 100644
--- a/remoting/signaling/iq_sender_unittest.cc
+++ b/remoting/signaling/iq_sender_unittest.cc
@@ -113,7 +113,7 @@
request_->SetTimeout(base::TimeDelta::FromMilliseconds(2));
- EXPECT_CALL(callback_, OnReply(request_.get(), NULL))
+ EXPECT_CALL(callback_, OnReply(request_.get(), nullptr))
.WillOnce(InvokeWithoutArgs(&message_loop_, &base::MessageLoop::Quit));
message_loop_.Run();
}
diff --git a/remoting/signaling/jingle_info_request.cc b/remoting/signaling/jingle_info_request.cc
index 2795821..be0f75f5 100644
--- a/remoting/signaling/jingle_info_request.cc
+++ b/remoting/signaling/jingle_info_request.cc
@@ -58,7 +58,7 @@
const buzz::XmlElement* query =
stanza->FirstNamed(buzz::QN_JINGLE_INFO_QUERY);
- if (query == NULL) {
+ if (query == nullptr) {
LOG(WARNING) << "No Jingle info found in Jingle Info query response."
<< stanza->Str();
on_jingle_info_cb_.Run(relay_token, relay_hosts, stun_hosts);
@@ -69,7 +69,7 @@
if (stun) {
for (const buzz::XmlElement* server =
stun->FirstNamed(buzz::QN_JINGLE_INFO_SERVER);
- server != NULL;
+ server != nullptr;
server = server->NextNamed(buzz::QN_JINGLE_INFO_SERVER)) {
std::string host = server->Attr(buzz::QN_JINGLE_INFO_HOST);
std::string port_str = server->Attr(buzz::QN_JINGLE_INFO_UDP);
@@ -90,7 +90,7 @@
relay_token = relay->TextNamed(buzz::QN_JINGLE_INFO_TOKEN);
for (const buzz::XmlElement* server =
relay->FirstNamed(buzz::QN_JINGLE_INFO_SERVER);
- server != NULL;
+ server != nullptr;
server = server->NextNamed(buzz::QN_JINGLE_INFO_SERVER)) {
std::string host = server->Attr(buzz::QN_JINGLE_INFO_HOST);
if (host != buzz::STR_EMPTY)
diff --git a/remoting/signaling/log_to_server.cc b/remoting/signaling/log_to_server.cc
index dd6d93de..731dc58 100644
--- a/remoting/signaling/log_to_server.cc
+++ b/remoting/signaling/log_to_server.cc
@@ -50,7 +50,7 @@
}
void LogToServer::SendPendingEntries() {
- if (iq_sender_ == NULL) {
+ if (iq_sender_ == nullptr) {
return;
}
if (pending_entries_.empty()) {
diff --git a/remoting/signaling/server_log_entry.cc b/remoting/signaling/server_log_entry.cc
index 684c74e..d91a32a9 100644
--- a/remoting/signaling/server_log_entry.cc
+++ b/remoting/signaling/server_log_entry.cc
@@ -47,7 +47,7 @@
}
void ServerLogEntry::AddModeField(ServerLogEntry::Mode mode) {
- const char* mode_value = NULL;
+ const char* mode_value = nullptr;
switch (mode) {
case IT2ME:
mode_value = kValueModeIt2Me;
diff --git a/remoting/signaling/server_log_entry_unittest.cc b/remoting/signaling/server_log_entry_unittest.cc
index 4f9b0aa..ac3506d 100644
--- a/remoting/signaling/server_log_entry_unittest.cc
+++ b/remoting/signaling/server_log_entry_unittest.cc
@@ -21,16 +21,16 @@
XmlElement* GetLogElementFromStanza(XmlElement* stanza) {
if (stanza->Name() != QName(kJabberClientNamespace, "iq")) {
ADD_FAILURE() << "Expected element 'iq'";
- return NULL;
+ return nullptr;
}
XmlElement* log_element = stanza->FirstChild()->AsElement();
if (log_element->Name() != QName(kChromotingNamespace, "log")) {
ADD_FAILURE() << "Expected element 'log'";
- return NULL;
+ return nullptr;
}
if (log_element->NextChild()) {
ADD_FAILURE() << "Expected only 1 child of 'iq'";
- return NULL;
+ return nullptr;
}
return log_element;
}
@@ -38,17 +38,17 @@
XmlElement* GetSingleLogEntryFromStanza(XmlElement* stanza) {
XmlElement* log_element = GetLogElementFromStanza(stanza);
if (!log_element) {
- // Test failure already recorded, so just return NULL here.
- return NULL;
+ // Test failure already recorded, so just return nullptr here.
+ return nullptr;
}
XmlElement* entry = log_element->FirstChild()->AsElement();
if (entry->Name() != QName(kChromotingNamespace, "entry")) {
ADD_FAILURE() << "Expected element 'entry'";
- return NULL;
+ return nullptr;
}
if (entry->NextChild()) {
ADD_FAILURE() << "Expected only 1 child of 'log'";
- return NULL;
+ return nullptr;
}
return entry;
}
@@ -59,7 +59,7 @@
const XmlElement* elem,
std::string* error) {
int attrCount = 0;
- for (const XmlAttr* attr = elem->FirstAttr(); attr != NULL;
+ for (const XmlAttr* attr = elem->FirstAttr(); attr != nullptr;
attr = attr->NextAttr(), attrCount++) {
if (attr->Name().Namespace().length() != 0) {
*error = "attribute has non-empty namespace " +
diff --git a/remoting/signaling/server_log_entry_unittest.h b/remoting/signaling/server_log_entry_unittest.h
index 5d5c589..aa03681c 100644
--- a/remoting/signaling/server_log_entry_unittest.h
+++ b/remoting/signaling/server_log_entry_unittest.h
@@ -16,11 +16,11 @@
extern const char kChromotingNamespace[];
// Verifies that |stanza| contains a <log> element and returns it. Otherwise
-// returns NULL and records a test failure.
+// returns nullptr and records a test failure.
buzz::XmlElement* GetLogElementFromStanza(buzz::XmlElement* stanza);
// Verifies that |stanza| contains only 1 log entry, and returns the <entry>
-// element. Otherwise returns NULL and records a test failure.
+// element. Otherwise returns nullptr and records a test failure.
buzz::XmlElement* GetSingleLogEntryFromStanza(buzz::XmlElement* stanza);
// Verifies a logging stanza.
diff --git a/remoting/signaling/xmpp_signal_strategy.cc b/remoting/signaling/xmpp_signal_strategy.cc
index 6ff287d..c8629236 100644
--- a/remoting/signaling/xmpp_signal_strategy.cc
+++ b/remoting/signaling/xmpp_signal_strategy.cc
@@ -53,7 +53,7 @@
: socket_factory_(socket_factory),
request_context_getter_(request_context_getter),
resource_name_(kDefaultResourceName),
- xmpp_client_(NULL),
+ xmpp_client_(nullptr),
xmpp_server_config_(xmpp_server_config),
state_(DISCONNECTED),
error_(OK) {
@@ -138,9 +138,9 @@
xmpp_client_->Disconnect();
- // |xmpp_client_| should be set to NULL in OnConnectionStateChanged()
+ // |xmpp_client_| should be set to nullptr in OnConnectionStateChanged()
// in response to Disconnect() call above.
- DCHECK(xmpp_client_ == NULL);
+ DCHECK(xmpp_client_ == nullptr);
}
}
@@ -195,7 +195,7 @@
DCHECK(CalledOnValidThread());
ObserverListBase<Listener>::Iterator it(listeners_);
Listener* listener;
- while ((listener = it.GetNext()) != NULL) {
+ while ((listener = it.GetNext()) != nullptr) {
if (listener->OnSignalStrategyIncomingStanza(stanza))
return true;
}
@@ -236,7 +236,7 @@
// Client is destroyed by the TaskRunner after the client is
// closed. Reset the pointer so we don't try to use it later.
- xmpp_client_ = NULL;
+ xmpp_client_ = nullptr;
switch (error) {
case buzz::XmppEngine::ERROR_UNAUTHORIZED:
diff --git a/remoting/test/fake_socket_factory.cc b/remoting/test/fake_socket_factory.cc
index 183595ee..0f0d418a 100644
--- a/remoting/test/fake_socket_factory.cc
+++ b/remoting/test/fake_socket_factory.cc
@@ -212,7 +212,7 @@
}
}
if (port < 0)
- return NULL;
+ return nullptr;
} else {
do {
port = next_port_;
@@ -237,7 +237,7 @@
const rtc::SocketAddress& local_address,
uint16 min_port, uint16 max_port,
int opts) {
- return NULL;
+ return nullptr;
}
rtc::AsyncPacketSocket* FakePacketSocketFactory::CreateClientTcpSocket(
@@ -246,12 +246,12 @@
const rtc::ProxyInfo& proxy_info,
const std::string& user_agent,
int opts) {
- return NULL;
+ return nullptr;
}
rtc::AsyncResolverInterface*
FakePacketSocketFactory::CreateAsyncResolver() {
- return NULL;
+ return nullptr;
}
const scoped_refptr<base::SingleThreadTaskRunner>&
diff --git a/remoting/test/protocol_perftest.cc b/remoting/test/protocol_perftest.cc
index 1194f2b..7c4ffa3 100644
--- a/remoting/test/protocol_perftest.cc
+++ b/remoting/test/protocol_perftest.cc
@@ -111,14 +111,14 @@
void SetPairingResponse(
const protocol::PairingResponse& pairing_response) override {}
void DeliverHostMessage(const protocol::ExtensionMessage& message) override {}
- protocol::ClipboardStub* GetClipboardStub() override { return NULL; }
+ protocol::ClipboardStub* GetClipboardStub() override { return nullptr; }
protocol::CursorShapeStub* GetCursorShapeStub() override {
return &cursor_shape_stub_;
}
// VideoRenderer interface.
void OnSessionConfig(const protocol::SessionConfig& config) override {}
- ChromotingStats* GetStats() override { return NULL; }
+ ChromotingStats* GetStats() override { return nullptr; }
void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet,
const base::Closure& done) override {
if (video_packet->data().empty()) {
@@ -270,7 +270,7 @@
host_secret.value = "123456";
scoped_ptr<protocol::AuthenticatorFactory> auth_factory =
protocol::Me2MeHostAuthenticatorFactory::CreateWithSharedSecret(
- true, kHostOwner, host_cert, key_pair, host_secret, NULL);
+ true, kHostOwner, host_cert, key_pair, host_secret, nullptr);
host_->SetAuthenticatorFactory(auth_factory.Pass());
host_->AddStatusObserver(this);
@@ -405,7 +405,7 @@
ReceiveFrame(&latency);
LOG(INFO) << "First frame latency: " << latency.InMillisecondsF() << "ms";
- ReceiveFrames(20, NULL);
+ ReceiveFrames(20, nullptr);
base::TimeTicks started = base::TimeTicks::Now();
ReceiveFrames(40, &latency);
@@ -465,7 +465,7 @@
StartHostAndClient(protocol::ChannelConfig::CODEC_VERBATIM);
ASSERT_NO_FATAL_FAILURE(WaitConnected());
- ReceiveFrame(NULL);
+ ReceiveFrame(nullptr);
base::TimeDelta expected = GetParam().latency_average;
if (GetParam().bandwidth > 0) {