| 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 #include "remoting/host/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Send the configuration to the network process. | 36 // Send the configuration to the network process. |
| 37 Send(new ChromotingDaemonNetworkMsg_Configuration(serialized_config_)); | 37 Send(new ChromotingDaemonNetworkMsg_Configuration(serialized_config_)); |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool DaemonProcess::OnMessageReceived(const IPC::Message& message) { | 40 bool DaemonProcess::OnMessageReceived(const IPC::Message& message) { |
| 41 DCHECK(main_task_runner()->BelongsToCurrentThread()); | 41 DCHECK(main_task_runner()->BelongsToCurrentThread()); |
| 42 | 42 |
| 43 return false; | 43 return false; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void DaemonProcess::OnPermanentError() { |
| 47 DCHECK(main_task_runner()->BelongsToCurrentThread()); |
| 48 |
| 49 Stop(); |
| 50 } |
| 51 |
| 46 DaemonProcess::DaemonProcess( | 52 DaemonProcess::DaemonProcess( |
| 47 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 53 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 48 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 54 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| 49 const base::Closure& stopped_callback) | 55 const base::Closure& stopped_callback) |
| 50 : Stoppable(main_task_runner, stopped_callback), | 56 : Stoppable(main_task_runner, stopped_callback), |
| 51 main_task_runner_(main_task_runner), | 57 main_task_runner_(main_task_runner), |
| 52 io_task_runner_(io_task_runner) { | 58 io_task_runner_(io_task_runner) { |
| 53 // Initialize on the same thread that will be used for shutting down. | 59 // Initialize on the same thread that will be used for shutting down. |
| 54 main_task_runner_->PostTask( | 60 main_task_runner_->PostTask( |
| 55 FROM_HERE, | 61 FROM_HERE, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 78 } | 84 } |
| 79 | 85 |
| 80 void DaemonProcess::DoStop() { | 86 void DaemonProcess::DoStop() { |
| 81 DCHECK(main_task_runner()->BelongsToCurrentThread()); | 87 DCHECK(main_task_runner()->BelongsToCurrentThread()); |
| 82 | 88 |
| 83 config_watcher_.reset(); | 89 config_watcher_.reset(); |
| 84 CompleteStopping(); | 90 CompleteStopping(); |
| 85 } | 91 } |
| 86 | 92 |
| 87 } // namespace remoting | 93 } // namespace remoting |
| OLD | NEW |