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/network_settings.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" |
| 31 #include "remoting/host/session_manager_factory.h" |
30 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 32 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
31 #include "remoting/protocol/it2me_host_authenticator_factory.h" | 33 #include "remoting/protocol/it2me_host_authenticator_factory.h" |
32 | 34 |
33 namespace remoting { | 35 namespace remoting { |
34 | 36 |
35 namespace { | 37 namespace { |
36 | 38 |
37 const char* kAttrNameAccessCode = "accessCode"; | 39 const char* kAttrNameAccessCode = "accessCode"; |
38 const char* kAttrNameAccessCodeLifetime = "accessCodeLifetime"; | 40 const char* kAttrNameAccessCodeLifetime = "accessCodeLifetime"; |
39 const char* kAttrNameClient = "client"; | 41 const char* kAttrNameClient = "client"; |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 base::Unretained(this)))); | 555 base::Unretained(this)))); |
554 | 556 |
555 // Beyond this point nothing can fail, so save the config and request. | 557 // Beyond this point nothing can fail, so save the config and request. |
556 signal_strategy_.reset(signal_strategy.release()); | 558 signal_strategy_.reset(signal_strategy.release()); |
557 register_request_.reset(register_request.release()); | 559 register_request_.reset(register_request.release()); |
558 | 560 |
559 // Create the Host. | 561 // Create the Host. |
560 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; | 562 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; |
561 host_ = new ChromotingHost( | 563 host_ = new ChromotingHost( |
562 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), | 564 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), |
563 NetworkSettings(nat_traversal_enabled_ ? | 565 CreateHostSessionManager( |
564 NetworkSettings::NAT_TRAVERSAL_ENABLED : | 566 NetworkSettings(nat_traversal_enabled_ ? |
565 NetworkSettings::NAT_TRAVERSAL_DISABLED)); | 567 NetworkSettings::NAT_TRAVERSAL_ENABLED : |
| 568 NetworkSettings::NAT_TRAVERSAL_DISABLED), |
| 569 host_context_->url_request_context_getter())); |
566 host_->AddStatusObserver(this); | 570 host_->AddStatusObserver(this); |
567 log_to_server_.reset( | 571 log_to_server_.reset( |
568 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); | 572 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); |
569 base::Closure disconnect_callback = base::Bind( | 573 base::Closure disconnect_callback = base::Bind( |
570 &ChromotingHost::Shutdown, base::Unretained(host_.get()), | 574 &ChromotingHost::Shutdown, base::Unretained(host_.get()), |
571 base::Closure()); | 575 base::Closure()); |
572 it2me_host_user_interface_->Start(host_.get(), disconnect_callback); | 576 it2me_host_user_interface_->Start(host_.get(), disconnect_callback); |
573 | 577 |
574 { | 578 { |
575 base::AutoLock auto_lock(ui_strings_lock_); | 579 base::AutoLock auto_lock(ui_strings_lock_); |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 return is_good; | 1169 return is_good; |
1166 } | 1170 } |
1167 | 1171 |
1168 void HostNPScriptObject::SetException(const std::string& exception_string) { | 1172 void HostNPScriptObject::SetException(const std::string& exception_string) { |
1169 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); | 1173 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); |
1170 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); | 1174 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); |
1171 LOG(INFO) << exception_string; | 1175 LOG(INFO) << exception_string; |
1172 } | 1176 } |
1173 | 1177 |
1174 } // namespace remoting | 1178 } // namespace remoting |
OLD | NEW |