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/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <nacl_io/nacl_io.h> | 10 #include <nacl_io/nacl_io.h> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "remoting/client/plugin/pepper_audio_player.h" | 45 #include "remoting/client/plugin/pepper_audio_player.h" |
46 #include "remoting/client/plugin/pepper_main_thread_task_runner.h" | 46 #include "remoting/client/plugin/pepper_main_thread_task_runner.h" |
47 #include "remoting/client/plugin/pepper_mouse_locker.h" | 47 #include "remoting/client/plugin/pepper_mouse_locker.h" |
48 #include "remoting/client/plugin/pepper_port_allocator.h" | 48 #include "remoting/client/plugin/pepper_port_allocator.h" |
49 #include "remoting/client/plugin/pepper_video_renderer_2d.h" | 49 #include "remoting/client/plugin/pepper_video_renderer_2d.h" |
50 #include "remoting/client/plugin/pepper_video_renderer_3d.h" | 50 #include "remoting/client/plugin/pepper_video_renderer_3d.h" |
51 #include "remoting/client/software_video_renderer.h" | 51 #include "remoting/client/software_video_renderer.h" |
52 #include "remoting/client/token_fetcher_proxy.h" | 52 #include "remoting/client/token_fetcher_proxy.h" |
53 #include "remoting/protocol/connection_to_host.h" | 53 #include "remoting/protocol/connection_to_host.h" |
54 #include "remoting/protocol/host_stub.h" | 54 #include "remoting/protocol/host_stub.h" |
55 #include "remoting/protocol/ice_transport_factory.h" | 55 #include "remoting/protocol/transport_context.h" |
56 #include "url/gurl.h" | 56 #include "url/gurl.h" |
57 | 57 |
58 namespace remoting { | 58 namespace remoting { |
59 | 59 |
60 namespace { | 60 namespace { |
61 | 61 |
62 // Default DPI to assume for old clients that use notifyClientResolution. | 62 // Default DPI to assume for old clients that use notifyClientResolution. |
63 const int kDefaultDPI = 96; | 63 const int kDefaultDPI = 96; |
64 | 64 |
65 // Size of the random seed blob used to initialize RNG in libjingle. OpenSSL | 65 // Size of the random seed blob used to initialize RNG in libjingle. OpenSSL |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 plugin_view_.GetRect().height()); | 686 plugin_view_.GetRect().height()); |
687 mouse_input_filter_.set_input_size(size); | 687 mouse_input_filter_.set_input_size(size); |
688 touch_input_scaler_.set_input_size(size); | 688 touch_input_scaler_.set_input_size(size); |
689 } | 689 } |
690 | 690 |
691 // Setup the signal strategy. | 691 // Setup the signal strategy. |
692 signal_strategy_.reset(new DelegatingSignalStrategy( | 692 signal_strategy_.reset(new DelegatingSignalStrategy( |
693 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, | 693 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, |
694 weak_factory_.GetWeakPtr()))); | 694 weak_factory_.GetWeakPtr()))); |
695 | 695 |
696 // Create TransportFactory. | 696 // Create TransportContext. |
697 scoped_ptr<protocol::TransportFactory> transport_factory( | 697 scoped_refptr<protocol::TransportContext> transport_context( |
698 new protocol::IceTransportFactory( | 698 new protocol::TransportContext( |
699 signal_strategy_.get(), PepperPortAllocator::Create(this).Pass(), | 699 signal_strategy_.get(), |
| 700 make_scoped_ptr(new PepperPortAllocatorFactory(this)), |
700 protocol::NetworkSettings( | 701 protocol::NetworkSettings( |
701 protocol::NetworkSettings::NAT_TRAVERSAL_FULL), | 702 protocol::NetworkSettings::NAT_TRAVERSAL_FULL), |
702 protocol::TransportRole::CLIENT)); | 703 protocol::TransportRole::CLIENT)); |
703 | 704 |
704 // Create Authenticator. | 705 // Create Authenticator. |
705 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> | 706 scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> |
706 token_fetcher(new TokenFetcherProxy( | 707 token_fetcher(new TokenFetcherProxy( |
707 base::Bind(&ChromotingInstance::FetchThirdPartyToken, | 708 base::Bind(&ChromotingInstance::FetchThirdPartyToken, |
708 weak_factory_.GetWeakPtr()), | 709 weak_factory_.GetWeakPtr()), |
709 host_public_key)); | 710 host_public_key)); |
(...skipping 14 matching lines...) Expand all Loading... |
724 scoped_ptr<protocol::CandidateSessionConfig> config = | 725 scoped_ptr<protocol::CandidateSessionConfig> config = |
725 protocol::CandidateSessionConfig::CreateDefault(); | 726 protocol::CandidateSessionConfig::CreateDefault(); |
726 if (std::find(experiments_list.begin(), experiments_list.end(), "vp9") != | 727 if (std::find(experiments_list.begin(), experiments_list.end(), "vp9") != |
727 experiments_list.end()) { | 728 experiments_list.end()) { |
728 config->set_vp9_experiment_enabled(true); | 729 config->set_vp9_experiment_enabled(true); |
729 } | 730 } |
730 client_->set_protocol_config(config.Pass()); | 731 client_->set_protocol_config(config.Pass()); |
731 | 732 |
732 // Kick off the connection. | 733 // Kick off the connection. |
733 client_->Start(signal_strategy_.get(), authenticator.Pass(), | 734 client_->Start(signal_strategy_.get(), authenticator.Pass(), |
734 transport_factory.Pass(), host_jid, capabilities); | 735 transport_context, host_jid, capabilities); |
735 | 736 |
736 // Start timer that periodically sends perf stats. | 737 // Start timer that periodically sends perf stats. |
737 stats_update_timer_.Start( | 738 stats_update_timer_.Start( |
738 FROM_HERE, base::TimeDelta::FromSeconds(kUIStatsUpdatePeriodSeconds), | 739 FROM_HERE, base::TimeDelta::FromSeconds(kUIStatsUpdatePeriodSeconds), |
739 base::Bind(&ChromotingInstance::UpdatePerfStatsInUI, | 740 base::Bind(&ChromotingInstance::UpdatePerfStatsInUI, |
740 base::Unretained(this))); | 741 base::Unretained(this))); |
741 } | 742 } |
742 | 743 |
743 void ChromotingInstance::HandleDisconnect(const base::DictionaryValue& data) { | 744 void ChromotingInstance::HandleDisconnect(const base::DictionaryValue& data) { |
744 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 745 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 if (is_custom_counts_histogram) { | 1148 if (is_custom_counts_histogram) { |
1148 uma.HistogramCustomCounts(histogram_name, value, histogram_min, | 1149 uma.HistogramCustomCounts(histogram_name, value, histogram_min, |
1149 histogram_max, histogram_buckets); | 1150 histogram_max, histogram_buckets); |
1150 } else { | 1151 } else { |
1151 uma.HistogramCustomTimes(histogram_name, value, histogram_min, | 1152 uma.HistogramCustomTimes(histogram_name, value, histogram_min, |
1152 histogram_max, histogram_buckets); | 1153 histogram_max, histogram_buckets); |
1153 } | 1154 } |
1154 } | 1155 } |
1155 | 1156 |
1156 } // namespace remoting | 1157 } // namespace remoting |
OLD | NEW |