| 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 "blimp/net/tcp_engine_transport.h" | 5 #include "blimp/net/tcp_engine_transport.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 std::unique_ptr<BlimpConnection> TCPEngineTransport::MakeConnection() { | 69 std::unique_ptr<BlimpConnection> TCPEngineTransport::MakeConnection() { |
| 70 return base::MakeUnique<TCPConnection>(TakeMessagePort()); | 70 return base::MakeUnique<TCPConnection>(TakeMessagePort()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 const char* TCPEngineTransport::GetName() const { | 73 const char* TCPEngineTransport::GetName() const { |
| 74 return "TCP"; | 74 return "TCP"; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void TCPEngineTransport::GetLocalAddress(net::IPEndPoint* address) const { | 77 void TCPEngineTransport::GetAssignmentOptions( |
| 78 AssignmentOptions* assignment_options) const { |
| 78 DCHECK(server_socket_); | 79 DCHECK(server_socket_); |
| 79 server_socket_->GetLocalAddress(address); | 80 server_socket_->GetLocalAddress(&assignment_options->engine_endpoint); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void TCPEngineTransport::OnTCPConnectAccepted(int result) { | 83 void TCPEngineTransport::OnTCPConnectAccepted(int result) { |
| 83 DCHECK_NE(net::ERR_IO_PENDING, result); | 84 DCHECK_NE(net::ERR_IO_PENDING, result); |
| 84 DCHECK(accepted_socket_); | 85 DCHECK(accepted_socket_); |
| 85 if (result != net::OK) { | 86 if (result != net::OK) { |
| 86 accepted_socket_.reset(); | 87 accepted_socket_.reset(); |
| 87 } | 88 } |
| 88 base::ResetAndReturn(&connect_callback_).Run(result); | 89 base::ResetAndReturn(&connect_callback_).Run(result); |
| 89 } | 90 } |
| 90 | 91 |
| 91 } // namespace blimp | 92 } // namespace blimp |
| OLD | NEW |