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

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: Fix remoting.gyp. 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/jingle_session_manager_factory.h"
26 #include "remoting/host/network_settings.h"
25 #include "remoting/host/pin_hash.h" 27 #include "remoting/host/pin_hash.h"
26 #include "remoting/host/plugin/daemon_controller.h" 28 #include "remoting/host/plugin/daemon_controller.h"
27 #include "remoting/host/plugin/host_log_handler.h" 29 #include "remoting/host/plugin/host_log_handler.h"
28 #include "remoting/host/policy_hack/nat_policy.h" 30 #include "remoting/host/policy_hack/nat_policy.h"
29 #include "remoting/host/register_support_host_request.h" 31 #include "remoting/host/register_support_host_request.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
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 base::Bind(&HostNPScriptObject::OnReceivedSupportID, 551 base::Bind(&HostNPScriptObject::OnReceivedSupportID,
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(),
Sergey Ulanov 2012/06/13 01:57:19 nit: IMHO the code is more readable when if we kee
simonmorris 2012/06/13 16:26:33 Done.
560 NetworkSettings(nat_traversal_enabled_ ? 562 signal_strategy_.get(),
561 NetworkSettings::NAT_TRAVERSAL_ENABLED : 563 desktop_environment_.get(),
562 NetworkSettings::NAT_TRAVERSAL_DISABLED)); 564 JingleSessionManagerFactory::CreateSessionManager(
565 NetworkSettings(nat_traversal_enabled_ ?
566 NetworkSettings::NAT_TRAVERSAL_ENABLED :
567 NetworkSettings::NAT_TRAVERSAL_DISABLED),
568 host_context_->url_request_context_getter()));
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);
570 576
571 { 577 {
572 base::AutoLock auto_lock(ui_strings_lock_); 578 base::AutoLock auto_lock(ui_strings_lock_);
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698