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

Side by Side Diff: remoting/host/posix/signal_handler.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // TODO(jamiewalch): Add unit tests for this. 5 // TODO(jamiewalch): Add unit tests for this.
6 6
7 #include "remoting/host/posix/signal_handler.h" 7 #include "remoting/host/posix/signal_handler.h"
8 8
9 #include <errno.h> 9 #include <errno.h>
10 #include <signal.h> 10 #include <signal.h>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 for (SignalHandlers::const_iterator i = signal_handlers_.begin(); 55 for (SignalHandlers::const_iterator i = signal_handlers_.begin();
56 i != signal_handlers_.end(); 56 i != signal_handlers_.end();
57 ++i) { 57 ++i) {
58 if (i->first == buffer) { 58 if (i->first == buffer) {
59 i->second.Run(i->first); 59 i->second.Run(i->first);
60 } 60 }
61 } 61 }
62 } 62 }
63 } 63 }
64 64
65 SignalListener* g_signal_listener = NULL; 65 SignalListener* g_signal_listener = nullptr;
66 int g_write_fd = 0; 66 int g_write_fd = 0;
67 67
68 void GlobalSignalHandler(int signal) { 68 void GlobalSignalHandler(int signal) {
69 char byte = signal; 69 char byte = signal;
70 ignore_result(write(g_write_fd, &byte, 1)); 70 ignore_result(write(g_write_fd, &byte, 1));
71 } 71 }
72 72
73 } // namespace 73 } // namespace
74 74
75 // RegisterSignalHandler registers a signal handler that writes a byte to a 75 // RegisterSignalHandler registers a signal handler that writes a byte to a
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 if (signal(signal_number, GlobalSignalHandler) == SIG_ERR) { 109 if (signal(signal_number, GlobalSignalHandler) == SIG_ERR) {
110 LOG(ERROR) << "signal() failed: " << errno; 110 LOG(ERROR) << "signal() failed: " << errno;
111 return false; 111 return false;
112 } 112 }
113 g_signal_listener->AddSignalHandler(signal_number, handler); 113 g_signal_listener->AddSignalHandler(signal_number, handler);
114 return true; 114 return true;
115 } 115 }
116 116
117 } // namespace remoting 117 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_mac.mm ('k') | remoting/host/register_support_host_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698