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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 10913260: Cleanups in Chromoting Host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/plugin/daemon_installer_win.cc ('k') | remoting/host/signaling_connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 6317b240f3faa35eb748c8b6f4e0df80da78f1b5..ce69d50e29b61712a4b276a07d9486ceb36f636b 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -37,7 +37,6 @@
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/chromoting_messages.h"
#include "remoting/host/config_file_watcher.h"
-#include "remoting/host/constants.h"
#include "remoting/host/config_file_watcher.h"
#include "remoting/host/desktop_environment_factory.h"
#include "remoting/host/desktop_resizer.h"
@@ -46,6 +45,7 @@
#include "remoting/host/heartbeat_sender.h"
#include "remoting/host/host_config.h"
#include "remoting/host/host_event_logger.h"
+#include "remoting/host/host_exit_codes.h"
#include "remoting/host/host_user_interface.h"
#include "remoting/host/json_host_config.h"
#include "remoting/host/log_to_server.h"
@@ -201,10 +201,10 @@ class HostProcess
// the first configuration update. Otherwise, post a task to create new
// authenticator factory in case PIN has changed.
if (policy_watcher_.get() == NULL) {
-#if defined(OS_MACOSX) || defined(OS_WIN)
bool want_user_interface = true;
-
-#if defined(OS_MACOSX)
+#if defined(OS_LINUX)
+ want_user_interface = false;
+#elif defined(OS_MACOSX)
// Don't try to display any UI on top of the system's login screen as this
// is rejected by the Window Server on OS X 10.7.4, and prevents the
// capturer from working (http://crbug.com/140984).
@@ -212,15 +212,12 @@ class HostProcess
// TODO(lambroslambrou): Use a better technique of detecting whether we're
// running in the LoginWindow context, and refactor this into a separate
// function to be used here and in CurtainMode::ActivateCurtain().
- if (getuid() == 0) {
- want_user_interface = false;
- }
+ want_user_interface = getuid() != 0;
#endif // OS_MACOSX
if (want_user_interface) {
host_user_interface_.reset(new HostUserInterface(context_.get()));
}
-#endif // OS_MACOSX || OS_WIN
StartWatchingPolicy();
} else {
@@ -243,7 +240,6 @@ class HostProcess
void StartWatchingConfigChanges() {
#if !defined(REMOTING_MULTI_PROCESS)
-
// Start watching the host configuration file.
config_watcher_.reset(new ConfigFileWatcher(context_->ui_task_runner(),
context_->file_task_runner(),
@@ -252,13 +248,13 @@ class HostProcess
#endif // !defined(REMOTING_MULTI_PROCESS)
}
-#if defined(OS_POSIX)
void ListenForShutdownSignal() {
+#if defined(OS_POSIX)
remoting::RegisterSignalHandler(
SIGTERM,
base::Bind(&HostProcess::SigTermHandler, base::Unretained(this)));
- }
#endif // OS_POSIX
+ }
void CreateAuthenticatorFactory() {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
@@ -301,12 +297,10 @@ class HostProcess
return;
}
-#if defined(OS_POSIX)
context_->network_task_runner()->PostTask(
FROM_HERE,
base::Bind(&HostProcess::ListenForShutdownSignal,
base::Unretained(this)));
-#endif // OS_POSIX
StartWatchingConfigChanges();
}
@@ -317,15 +311,10 @@ class HostProcess
void ShutdownHostProcess() {
DCHECK(context_->ui_task_runner()->BelongsToCurrentThread());
-#if !defined(REMOTING_MULTI_PROCESS)
config_watcher_.reset();
-#endif // !defined(REMOTING_MULTI_PROCESS)
daemon_channel_.reset();
-
-#if defined(OS_MACOSX) || defined(OS_WIN)
host_user_interface_.reset();
-#endif
if (policy_watcher_.get()) {
base::WaitableEvent done_event(true, false);
@@ -589,13 +578,11 @@ class HostProcess
resizing_host_observer_.reset(
new ResizingHostObserver(desktop_resizer_.get(), host_));
-#if defined(OS_MACOSX) || defined(OS_WIN)
if (host_user_interface_.get()) {
host_user_interface_->Start(
host_, base::Bind(&HostProcess::OnDisconnectRequested,
base::Unretained(this)));
}
-#endif
host_->Start(xmpp_login_);
@@ -689,10 +676,8 @@ class HostProcess
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
JsonHostConfig config_;
-#if !defined(REMOTING_MULTI_PROCESS)
FilePath host_config_path_;
scoped_ptr<ConfigFileWatcher> config_watcher_;
-#endif // !defined(REMOTING_MULTI_PROCESS)
std::string host_id_;
HostKeyPair key_pair_;
@@ -720,9 +705,7 @@ class HostProcess
scoped_ptr<LogToServer> log_to_server_;
scoped_ptr<HostEventLogger> host_event_logger_;
-#if defined(OS_MACOSX) || defined(OS_WIN)
scoped_ptr<HostUserInterface> host_user_interface_;
-#endif
scoped_refptr<ChromotingHost> host_;
« no previous file with comments | « remoting/host/plugin/daemon_installer_win.cc ('k') | remoting/host/signaling_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698