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 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); | 928 host_->SetMaximumSessionDuration(base::TimeDelta::FromHours(20)); |
929 #endif | 929 #endif |
930 | 930 |
931 heartbeat_sender_.reset(new HeartbeatSender( | 931 heartbeat_sender_.reset(new HeartbeatSender( |
932 this, host_id_, signal_strategy_.get(), &key_pair_, directory_bot_jid_)); | 932 this, host_id_, signal_strategy_.get(), &key_pair_, directory_bot_jid_)); |
933 | 933 |
934 host_change_notification_listener_.reset(new HostChangeNotificationListener( | 934 host_change_notification_listener_.reset(new HostChangeNotificationListener( |
935 this, host_id_, signal_strategy_.get(), directory_bot_jid_)); | 935 this, host_id_, signal_strategy_.get(), directory_bot_jid_)); |
936 | 936 |
937 log_to_server_.reset( | 937 log_to_server_.reset( |
938 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get(), | 938 new LogToServer(host_->AsWeakPtr(), ServerLogEntry::ME2ME, |
939 directory_bot_jid_)); | 939 signal_strategy_.get(), directory_bot_jid_)); |
940 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 940 host_event_logger_ = |
| 941 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
941 | 942 |
942 resizing_host_observer_.reset( | 943 resizing_host_observer_.reset( |
943 new ResizingHostObserver(desktop_resizer_.get(), host_)); | 944 new ResizingHostObserver(desktop_resizer_.get(), host_->AsWeakPtr())); |
944 | 945 |
945 // Create a host observer to enable/disable curtain mode as clients connect | 946 // Create a host observer to enable/disable curtain mode as clients connect |
946 // and disconnect. | 947 // and disconnect. |
947 curtaining_host_observer_.reset(new CurtainingHostObserver( | 948 curtaining_host_observer_.reset(new CurtainingHostObserver( |
948 curtain_.get(), host_)); | 949 curtain_.get(), host_->AsWeakPtr())); |
949 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); | 950 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); |
950 | 951 |
951 if (host_user_interface_.get()) { | 952 if (host_user_interface_.get()) { |
952 host_user_interface_->Start( | 953 host_user_interface_->Start( |
953 host_, base::Bind(&HostProcess::OnDisconnectRequested, this)); | 954 host_, base::Bind(&HostProcess::OnDisconnectRequested, this)); |
954 } | 955 } |
955 | 956 |
956 host_->Start(xmpp_login_); | 957 host_->Start(xmpp_login_); |
957 | 958 |
958 CreateAuthenticatorFactory(); | 959 CreateAuthenticatorFactory(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 return exit_code; | 1101 return exit_code; |
1101 } | 1102 } |
1102 | 1103 |
1103 } // namespace remoting | 1104 } // namespace remoting |
1104 | 1105 |
1105 #if !defined(OS_WIN) | 1106 #if !defined(OS_WIN) |
1106 int main(int argc, char** argv) { | 1107 int main(int argc, char** argv) { |
1107 return remoting::HostMain(argc, argv); | 1108 return remoting::HostMain(argc, argv); |
1108 } | 1109 } |
1109 #endif // !defined(OS_WIN) | 1110 #endif // !defined(OS_WIN) |
OLD | NEW |