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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 // Setup the signal strategy. | 669 // Setup the signal strategy. |
670 signal_strategy_.reset(new DelegatingSignalStrategy( | 670 signal_strategy_.reset(new DelegatingSignalStrategy( |
671 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, | 671 local_jid, base::Bind(&ChromotingInstance::SendOutgoingIq, |
672 weak_factory_.GetWeakPtr()))); | 672 weak_factory_.GetWeakPtr()))); |
673 | 673 |
674 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator( | 674 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator( |
675 PepperPortAllocator::Create(this)); | 675 PepperPortAllocator::Create(this)); |
676 scoped_ptr<protocol::TransportFactory> transport_factory( | 676 scoped_ptr<protocol::TransportFactory> transport_factory( |
677 new protocol::LibjingleTransportFactory( | 677 new protocol::LibjingleTransportFactory( |
678 signal_strategy_.get(), port_allocator.Pass(), | 678 signal_strategy_.get(), port_allocator.Pass(), |
679 NetworkSettings(NetworkSettings::NAT_TRAVERSAL_FULL))); | 679 NetworkSettings(NetworkSettings::NAT_TRAVERSAL_ENABLED))); |
680 | 680 |
681 // Kick off the connection. | 681 // Kick off the connection. |
682 client_->Start(signal_strategy_.get(), transport_factory.Pass()); | 682 client_->Start(signal_strategy_.get(), transport_factory.Pass()); |
683 | 683 |
684 // Start timer that periodically sends perf stats. | 684 // Start timer that periodically sends perf stats. |
685 plugin_task_runner_->PostDelayedTask( | 685 plugin_task_runner_->PostDelayedTask( |
686 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, | 686 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, |
687 weak_factory_.GetWeakPtr()), | 687 weak_factory_.GetWeakPtr()), |
688 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 688 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
689 } | 689 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 pp::VarArrayBuffer array_buffer(buffer_size); | 1121 pp::VarArrayBuffer array_buffer(buffer_size); |
1122 void* data_ptr = array_buffer.Map(); | 1122 void* data_ptr = array_buffer.Map(); |
1123 memcpy(data_ptr, buffer, buffer_size); | 1123 memcpy(data_ptr, buffer, buffer_size); |
1124 array_buffer.Unmap(); | 1124 array_buffer.Unmap(); |
1125 pp::VarDictionary data_dictionary; | 1125 pp::VarDictionary data_dictionary; |
1126 data_dictionary.Set(pp::Var("buffer"), array_buffer); | 1126 data_dictionary.Set(pp::Var("buffer"), array_buffer); |
1127 PostChromotingMessage("mediaSourceData", data_dictionary); | 1127 PostChromotingMessage("mediaSourceData", data_dictionary); |
1128 } | 1128 } |
1129 | 1129 |
1130 } // namespace remoting | 1130 } // namespace remoting |
OLD | NEW |