OLD | NEW |
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> |
11 | 11 |
12 #include <list> | 12 #include <list> |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/message_pump_libevent.h" | 17 #include "base/message_loop/message_pump_libevent.h" |
18 #include "base/posix/eintr_wrapper.h" | 18 #include "base/posix/eintr_wrapper.h" |
19 #include "base/threading/platform_thread.h" | 19 #include "base/threading/platform_thread.h" |
20 | 20 |
21 namespace remoting { | 21 namespace remoting { |
22 namespace { | 22 namespace { |
23 | 23 |
24 class SignalListener : public base::MessagePumpLibevent::Watcher { | 24 class SignalListener : public base::MessagePumpLibevent::Watcher { |
25 public: | 25 public: |
26 SignalListener(); | 26 SignalListener(); |
27 | 27 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |