| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/protocol/ice_transport.h" | 5 #include "remoting/protocol/ice_transport.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 std::unique_ptr<buzz::XmlElement> transport_info) { | 111 std::unique_ptr<buzz::XmlElement> transport_info) { |
| 112 ASSERT_TRUE(target_transport); | 112 ASSERT_TRUE(target_transport); |
| 113 EXPECT_TRUE( | 113 EXPECT_TRUE( |
| 114 (*target_transport)->ProcessTransportInfo(transport_info.get())); | 114 (*target_transport)->ProcessTransportInfo(transport_info.get())); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void InitializeConnection() { | 117 void InitializeConnection() { |
| 118 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 118 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
| 119 | 119 |
| 120 host_transport_.reset(new IceTransport( | 120 host_transport_.reset(new IceTransport( |
| 121 new TransportContext( | 121 new TransportContext(nullptr, |
| 122 nullptr, base::WrapUnique(new ChromiumPortAllocatorFactory()), | 122 base::MakeUnique<ChromiumPortAllocatorFactory>(), |
| 123 nullptr, network_settings_, TransportRole::SERVER), | 123 nullptr, network_settings_, TransportRole::SERVER), |
| 124 &host_event_handler_)); | 124 &host_event_handler_)); |
| 125 if (!host_authenticator_) { | 125 if (!host_authenticator_) { |
| 126 host_authenticator_.reset(new FakeAuthenticator( | 126 host_authenticator_.reset(new FakeAuthenticator( |
| 127 FakeAuthenticator::HOST, 0, FakeAuthenticator::ACCEPT, true)); | 127 FakeAuthenticator::HOST, 0, FakeAuthenticator::ACCEPT, true)); |
| 128 } | 128 } |
| 129 | 129 |
| 130 client_transport_.reset(new IceTransport( | 130 client_transport_.reset(new IceTransport( |
| 131 new TransportContext( | 131 new TransportContext(nullptr, |
| 132 nullptr, base::WrapUnique(new ChromiumPortAllocatorFactory()), | 132 base::MakeUnique<ChromiumPortAllocatorFactory>(), |
| 133 nullptr, network_settings_, TransportRole::CLIENT), | 133 nullptr, network_settings_, TransportRole::CLIENT), |
| 134 &client_event_handler_)); | 134 &client_event_handler_)); |
| 135 if (!client_authenticator_) { | 135 if (!client_authenticator_) { |
| 136 client_authenticator_.reset(new FakeAuthenticator( | 136 client_authenticator_.reset(new FakeAuthenticator( |
| 137 FakeAuthenticator::CLIENT, 0, FakeAuthenticator::ACCEPT, true)); | 137 FakeAuthenticator::CLIENT, 0, FakeAuthenticator::ACCEPT, true)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 host_event_handler_.set_error_callback(base::Bind( | 140 host_event_handler_.set_error_callback(base::Bind( |
| 141 &IceTransportTest::OnTransportError, base::Unretained(this))); | 141 &IceTransportTest::OnTransportError, base::Unretained(this))); |
| 142 client_event_handler_.set_error_callback(base::Bind( | 142 client_event_handler_.set_error_callback(base::Bind( |
| 143 &IceTransportTest::OnTransportError, base::Unretained(this))); | 143 &IceTransportTest::OnTransportError, base::Unretained(this))); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 MessagePipeConnectionTester tester(host_message_pipe_.get(), | 338 MessagePipeConnectionTester tester(host_message_pipe_.get(), |
| 339 client_message_pipe_.get(), kMessageSize, | 339 client_message_pipe_.get(), kMessageSize, |
| 340 kMessages); | 340 kMessages); |
| 341 tester.RunAndCheckResults(); | 341 tester.RunAndCheckResults(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 | 344 |
| 345 } // namespace protocol | 345 } // namespace protocol |
| 346 } // namespace remoting | 346 } // namespace remoting |
| OLD | NEW |