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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 // Setup the signal strategy. | 676 // Setup the signal strategy. |
677 signal_strategy_.reset(new DelegatingSignalStrategy( | 677 signal_strategy_.reset(new DelegatingSignalStrategy( |
678 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, | 678 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, |
679 weak_factory_.GetWeakPtr()))); | 679 weak_factory_.GetWeakPtr()))); |
680 | 680 |
681 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator( | 681 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator( |
682 PepperPortAllocator::Create(this)); | 682 PepperPortAllocator::Create(this)); |
683 scoped_ptr<protocol::TransportFactory> transport_factory( | 683 scoped_ptr<protocol::TransportFactory> transport_factory( |
684 new protocol::LibjingleTransportFactory( | 684 new protocol::LibjingleTransportFactory( |
685 signal_strategy_.get(), port_allocator.Pass(), | 685 signal_strategy_.get(), port_allocator.Pass(), |
686 NetworkSettings(NetworkSettings::NAT_TRAVERSAL_ENABLED))); | 686 NetworkSettings(NetworkSettings::NAT_TRAVERSAL_FULL))); |
687 | 687 |
688 // Kick off the connection. | 688 // Kick off the connection. |
689 client_->Start(signal_strategy_.get(), transport_factory.Pass()); | 689 client_->Start(signal_strategy_.get(), transport_factory.Pass()); |
690 | 690 |
691 // Start timer that periodically sends perf stats. | 691 // Start timer that periodically sends perf stats. |
692 plugin_task_runner_->PostDelayedTask( | 692 plugin_task_runner_->PostDelayedTask( |
693 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, | 693 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, |
694 weak_factory_.GetWeakPtr()), | 694 weak_factory_.GetWeakPtr()), |
695 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 695 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
696 } | 696 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 pp::VarArrayBuffer array_buffer(buffer_size); | 1128 pp::VarArrayBuffer array_buffer(buffer_size); |
1129 void* data_ptr = array_buffer.Map(); | 1129 void* data_ptr = array_buffer.Map(); |
1130 memcpy(data_ptr, buffer, buffer_size); | 1130 memcpy(data_ptr, buffer, buffer_size); |
1131 array_buffer.Unmap(); | 1131 array_buffer.Unmap(); |
1132 pp::VarDictionary data_dictionary; | 1132 pp::VarDictionary data_dictionary; |
1133 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1133 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
1134 PostChromotingMessage("mediaSourceData", data_dictionary); | 1134 PostChromotingMessage("mediaSourceData", data_dictionary); |
1135 } | 1135 } |
1136 | 1136 |
1137 } // namespace remoting | 1137 } // namespace remoting |
OLD | NEW |