Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: blimp/net/tcp_engine_transport.cc

Issue 2462183002: GRPC Stream implementation of HeliumStream
Patch Set: Address gcasto comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « blimp/net/tcp_engine_transport.h ('k') | blimp/net/tcp_transport_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « blimp/net/tcp_engine_transport.h ('k') | blimp/net/tcp_transport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698