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

Side by Side Diff: remoting/host/plugin/host_script_object.cc

Issue 10538091: [Chromoting] Make ChromotingHost's dependency on libjingle injected, instead of hard-coded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve comments. Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 base::Unretained(this)))); 552 base::Unretained(this))));
551 553
552 // Beyond this point nothing can fail, so save the config and request. 554 // Beyond this point nothing can fail, so save the config and request.
553 signal_strategy_.reset(signal_strategy.release()); 555 signal_strategy_.reset(signal_strategy.release());
554 register_request_.reset(register_request.release()); 556 register_request_.reset(register_request.release());
555 557
556 // Create the Host. 558 // Create the Host.
557 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; 559 LOG(INFO) << "NAT state: " << nat_traversal_enabled_;
558 host_ = new ChromotingHost( 560 host_ = new ChromotingHost(
559 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(), 561 host_context_.get(), signal_strategy_.get(), desktop_environment_.get(),
560 NetworkSettings(nat_traversal_enabled_ ? 562 CreateHostSessionManager(
561 NetworkSettings::NAT_TRAVERSAL_ENABLED : 563 NetworkSettings(nat_traversal_enabled_ ?
562 NetworkSettings::NAT_TRAVERSAL_DISABLED)); 564 NetworkSettings::NAT_TRAVERSAL_ENABLED :
565 NetworkSettings::NAT_TRAVERSAL_DISABLED),
566 host_context_->url_request_context_getter()));
563 host_->AddStatusObserver(this); 567 host_->AddStatusObserver(this);
564 log_to_server_.reset( 568 log_to_server_.reset(
565 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); 569 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get()));
566 base::Closure disconnect_callback = base::Bind( 570 base::Closure disconnect_callback = base::Bind(
567 &ChromotingHost::Shutdown, base::Unretained(host_.get()), 571 &ChromotingHost::Shutdown, base::Unretained(host_.get()),
568 base::Closure()); 572 base::Closure());
569 it2me_host_user_interface_->Start(host_.get(), disconnect_callback); 573 it2me_host_user_interface_->Start(host_.get(), disconnect_callback);
570 574
571 { 575 {
572 base::AutoLock auto_lock(ui_strings_lock_); 576 base::AutoLock auto_lock(ui_strings_lock_);
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 return is_good; 1166 return is_good;
1163 } 1167 }
1164 1168
1165 void HostNPScriptObject::SetException(const std::string& exception_string) { 1169 void HostNPScriptObject::SetException(const std::string& exception_string) {
1166 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); 1170 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread());
1167 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); 1171 g_npnetscape_funcs->setexception(parent_, exception_string.c_str());
1168 LOG(INFO) << exception_string; 1172 LOG(INFO) << exception_string;
1169 } 1173 }
1170 1174
1171 } // namespace remoting 1175 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698