| 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" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 CreateHostSessionManager(network_settings, | 381 CreateHostSessionManager(network_settings, |
| 382 host_context_->url_request_context_getter()), | 382 host_context_->url_request_context_getter()), |
| 383 host_context_->audio_task_runner(), | 383 host_context_->audio_task_runner(), |
| 384 host_context_->input_task_runner(), | 384 host_context_->input_task_runner(), |
| 385 host_context_->video_capture_task_runner(), | 385 host_context_->video_capture_task_runner(), |
| 386 host_context_->video_encode_task_runner(), | 386 host_context_->video_encode_task_runner(), |
| 387 host_context_->network_task_runner(), | 387 host_context_->network_task_runner(), |
| 388 host_context_->ui_task_runner()); | 388 host_context_->ui_task_runner()); |
| 389 host_->AddStatusObserver(this); | 389 host_->AddStatusObserver(this); |
| 390 log_to_server_.reset( | 390 log_to_server_.reset( |
| 391 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get(), | 391 new LogToServer(host_->AsWeakPtr(), ServerLogEntry::IT2ME, |
| 392 directory_bot_jid_)); | 392 signal_strategy_.get(), directory_bot_jid_)); |
| 393 | 393 |
| 394 // Disable audio by default. | 394 // Disable audio by default. |
| 395 // TODO(sergeyu): Add UI to enable it. | 395 // TODO(sergeyu): Add UI to enable it. |
| 396 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 396 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
| 397 protocol::CandidateSessionConfig::CreateDefault(); | 397 protocol::CandidateSessionConfig::CreateDefault(); |
| 398 protocol::CandidateSessionConfig::DisableAudioChannel(protocol_config.get()); | 398 protocol::CandidateSessionConfig::DisableAudioChannel(protocol_config.get()); |
| 399 host_->set_protocol_config(protocol_config.Pass()); | 399 host_->set_protocol_config(protocol_config.Pass()); |
| 400 | 400 |
| 401 // Create user interface. | 401 // Create user interface. |
| 402 it2me_host_user_interface_->Start(host_.get(), | 402 it2me_host_user_interface_->Start(host_.get(), |
| 403 base::Bind(&It2MeImpl::Disconnect, this)); | 403 base::Bind(&It2MeImpl::Disconnect, this)); |
| 404 | 404 |
| 405 // Create event logger. | 405 // Create event logger. |
| 406 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); | 406 host_event_logger_ = |
| 407 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
| 407 | 408 |
| 408 // Connect signaling and start the host. | 409 // Connect signaling and start the host. |
| 409 signal_strategy_->Connect(); | 410 signal_strategy_->Connect(); |
| 410 host_->Start(uid); | 411 host_->Start(uid); |
| 411 | 412 |
| 412 SetState(kRequestedAccessCode); | 413 SetState(kRequestedAccessCode); |
| 413 return; | 414 return; |
| 414 } | 415 } |
| 415 | 416 |
| 416 void HostNPScriptObject::It2MeImpl::OnShutdownFinished() { | 417 void HostNPScriptObject::It2MeImpl::OnShutdownFinished() { |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 } | 1583 } |
| 1583 | 1584 |
| 1584 void HostNPScriptObject::SetException(const std::string& exception_string) { | 1585 void HostNPScriptObject::SetException(const std::string& exception_string) { |
| 1585 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 1586 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
| 1586 | 1587 |
| 1587 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); | 1588 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); |
| 1588 LOG(INFO) << exception_string; | 1589 LOG(INFO) << exception_string; |
| 1589 } | 1590 } |
| 1590 | 1591 |
| 1591 } // namespace remoting | 1592 } // namespace remoting |
| OLD | NEW |