OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 desktop_environment_.reset(DesktopEnvironment::Create(&host_context_)); | 505 desktop_environment_.reset(DesktopEnvironment::Create(&host_context_)); |
506 if (desktop_environment_.get() == NULL) { | 506 if (desktop_environment_.get() == NULL) { |
507 SetState(kError); | 507 SetState(kError); |
508 return; | 508 return; |
509 } | 509 } |
510 | 510 |
511 // Beyond this point nothing can fail, so save the config and request. | 511 // Beyond this point nothing can fail, so save the config and request. |
512 host_config_ = host_config; | 512 host_config_ = host_config; |
513 register_request_.reset(register_request.release()); | 513 register_request_.reset(register_request.release()); |
514 | 514 |
515 log_to_server_ = new LogToServer(host_context_.network_message_loop()); | |
Sergey Ulanov
2011/11/17 01:16:33
Can you please add flag to disable/enable logging?
simonmorris
2011/11/18 19:23:04
Done.
It's just disabled for now - enabling it ca
| |
516 | |
515 // Create the Host. | 517 // Create the Host. |
516 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; | 518 LOG(INFO) << "NAT state: " << nat_traversal_enabled_; |
517 host_ = ChromotingHost::Create( | 519 host_ = ChromotingHost::Create( |
518 &host_context_, host_config_, desktop_environment_.get(), | 520 &host_context_, host_config_, desktop_environment_.get(), |
519 access_verifier.release(), nat_traversal_enabled_); | 521 access_verifier.release(), nat_traversal_enabled_); |
520 host_->AddStatusObserver(this); | 522 host_->AddStatusObserver(this); |
521 host_->AddStatusObserver(register_request_.get()); | 523 host_->AddStatusObserver(register_request_.get()); |
524 host_->AddStatusObserver(log_to_server_.get()); | |
522 host_->set_it2me(true); | 525 host_->set_it2me(true); |
523 | 526 |
524 { | 527 { |
525 base::AutoLock auto_lock(ui_strings_lock_); | 528 base::AutoLock auto_lock(ui_strings_lock_); |
526 host_->SetUiStrings(ui_strings_); | 529 host_->SetUiStrings(ui_strings_); |
527 } | 530 } |
528 | 531 |
529 // Start the Host. | 532 // Start the Host. |
530 host_->Start(); | 533 host_->Start(); |
531 | 534 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
838 uint32_t argCount) { | 841 uint32_t argCount) { |
839 NPVariant np_result; | 842 NPVariant np_result; |
840 bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args, | 843 bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args, |
841 argCount, &np_result); | 844 argCount, &np_result); |
842 if (is_good) | 845 if (is_good) |
843 g_npnetscape_funcs->releasevariantvalue(&np_result); | 846 g_npnetscape_funcs->releasevariantvalue(&np_result); |
844 return is_good; | 847 return is_good; |
845 } | 848 } |
846 | 849 |
847 } // namespace remoting | 850 } // namespace remoting |
OLD | NEW |