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/plugin/host_script_object.h" | 5 #include "remoting/host/plugin/host_script_object.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
17 #include "remoting/base/auth_token_util.h" | 17 #include "remoting/base/auth_token_util.h" |
18 #include "remoting/host/chromoting_host.h" | 18 #include "remoting/host/chromoting_host.h" |
19 #include "remoting/host/chromoting_host_context.h" | 19 #include "remoting/host/chromoting_host_context.h" |
20 #include "remoting/host/desktop_environment.h" | 20 #include "remoting/host/desktop_environment.h" |
21 #include "remoting/host/host_config.h" | 21 #include "remoting/host/host_config.h" |
22 #include "remoting/host/host_key_pair.h" | 22 #include "remoting/host/host_key_pair.h" |
23 #include "remoting/host/host_secret.h" | 23 #include "remoting/host/host_secret.h" |
24 #include "remoting/host/it2me_host_user_interface.h" | 24 #include "remoting/host/it2me_host_user_interface.h" |
25 #include "remoting/host/jingle_session_manager_factory.h" | |
25 #include "remoting/host/pin_hash.h" | 26 #include "remoting/host/pin_hash.h" |
26 #include "remoting/host/plugin/daemon_controller.h" | 27 #include "remoting/host/plugin/daemon_controller.h" |
27 #include "remoting/host/plugin/host_log_handler.h" | 28 #include "remoting/host/plugin/host_log_handler.h" |
28 #include "remoting/host/policy_hack/nat_policy.h" | 29 #include "remoting/host/policy_hack/nat_policy.h" |
29 #include "remoting/host/register_support_host_request.h" | 30 #include "remoting/host/register_support_host_request.h" |
30 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 31 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
31 #include "remoting/protocol/it2me_host_authenticator_factory.h" | 32 #include "remoting/protocol/it2me_host_authenticator_factory.h" |
32 | 33 |
33 namespace remoting { | 34 namespace remoting { |
34 | 35 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 scoped_ptr<RegisterSupportHostRequest> register_request( | 547 scoped_ptr<RegisterSupportHostRequest> register_request( |
547 new RegisterSupportHostRequest( | 548 new RegisterSupportHostRequest( |
548 signal_strategy.get(), &host_key_pair_, | 549 signal_strategy.get(), &host_key_pair_, |
549 base::Bind(&HostNPScriptObject::OnReceivedSupportID, | 550 base::Bind(&HostNPScriptObject::OnReceivedSupportID, |
550 base::Unretained(this)))); | 551 base::Unretained(this)))); |
551 | 552 |
552 // Beyond this point nothing can fail, so save the config and request. | 553 // Beyond this point nothing can fail, so save the config and request. |
553 signal_strategy_.reset(signal_strategy.release()); | 554 signal_strategy_.reset(signal_strategy.release()); |
554 register_request_.reset(register_request.release()); | 555 register_request_.reset(register_request.release()); |
555 | 556 |
557 // Create the session manager factory. | |
Wez
2012/06/11 22:17:06
nit: Suggest e.g. "Create a SessionManagerFactory
simonmorris
2012/06/11 23:08:59
Removed code.
| |
558 scoped_ptr<SessionManagerFactory> session_manager_factory( | |
559 new JingleSessionManagerFactory()); | |
560 | |
556 // Create the Host. | 561 // Create the Host. |
557 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; | 562 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; |
558 host_ = new ChromotingHost( | 563 host_ = new ChromotingHost( |
559 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), | 564 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), |
565 session_manager_factory.Pass(), | |
Wez
2012/06/11 22:17:06
Do you need to assign to a local & Pass(), or coul
simonmorris
2012/06/11 23:08:59
Done.
| |
560 NetworkSettings(nat_traversal_enabled_ ? | 566 NetworkSettings(nat_traversal_enabled_ ? |
561 NetworkSettings::NAT_TRAVERSAL_ENABLED : | 567 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
562 NetworkSettings::NAT_TRAVERSAL_DISABLED)); | 568 NetworkSettings::NAT_TRAVERSAL_DISABLED)); |
563 host_->AddStatusObserver(this); | 569 host_->AddStatusObserver(this); |
564 log_to_server_.reset( | 570 log_to_server_.reset( |
565 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); | 571 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); |
566 base::Closure disconnect_callback = base::Bind( | 572 base::Closure disconnect_callback = base::Bind( |
567 &ChromotingHost::Shutdown, base::Unretained(host_.get()), | 573 &ChromotingHost::Shutdown, base::Unretained(host_.get()), |
568 base::Closure()); | 574 base::Closure()); |
569 it2me_host_user_interface_->Start(host_.get(), disconnect_callback); | 575 it2me_host_user_interface_->Start(host_.get(), disconnect_callback); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1162 return is_good; | 1168 return is_good; |
1163 } | 1169 } |
1164 | 1170 |
1165 void HostNPScriptObject::SetException(const std::string& exception_string) { | 1171 void HostNPScriptObject::SetException(const std::string& exception_string) { |
1166 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); | 1172 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); |
1167 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); | 1173 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); |
1168 LOG(INFO) << exception_string; | 1174 LOG(INFO) << exception_string; |
1169 } | 1175 } |
1170 | 1176 |
1171 } // namespace remoting | 1177 } // namespace remoting |
OLD | NEW |