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

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

Issue 1696563002: Blimp: add support for SSL connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland (safe_json issue fixed). Created 4 years, 9 months 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 "base/callback.h" 7 #include "base/callback.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 base::Bind(callback, result)); 54 base::Bind(callback, result));
55 } 55 }
56 56
57 scoped_ptr<BlimpConnection> TCPEngineTransport::TakeConnection() { 57 scoped_ptr<BlimpConnection> TCPEngineTransport::TakeConnection() {
58 DCHECK(connect_callback_.is_null()); 58 DCHECK(connect_callback_.is_null());
59 DCHECK(accepted_socket_); 59 DCHECK(accepted_socket_);
60 return make_scoped_ptr( 60 return make_scoped_ptr(
61 new StreamSocketConnection(std::move(accepted_socket_))); 61 new StreamSocketConnection(std::move(accepted_socket_)));
62 } 62 }
63 63
64 const std::string TCPEngineTransport::GetName() const { 64 const char* TCPEngineTransport::GetName() const {
65 return "TCP"; 65 return "TCP";
66 } 66 }
67 67
68 int TCPEngineTransport::GetLocalAddressForTesting( 68 int TCPEngineTransport::GetLocalAddressForTesting(
69 net::IPEndPoint* address) const { 69 net::IPEndPoint* address) const {
70 DCHECK(server_socket_); 70 DCHECK(server_socket_);
71 return server_socket_->GetLocalAddress(address); 71 return server_socket_->GetLocalAddress(address);
72 } 72 }
73 73
74 void TCPEngineTransport::OnTCPConnectAccepted(int result) { 74 void TCPEngineTransport::OnTCPConnectAccepted(int result) {
75 DCHECK_NE(net::ERR_IO_PENDING, result); 75 DCHECK_NE(net::ERR_IO_PENDING, result);
76 DCHECK(accepted_socket_); 76 DCHECK(accepted_socket_);
77 if (result != net::OK) { 77 if (result != net::OK) {
78 accepted_socket_.reset(); 78 accepted_socket_.reset();
79 } 79 }
80 base::ResetAndReturn(&connect_callback_).Run(result); 80 base::ResetAndReturn(&connect_callback_).Run(result);
81 } 81 }
82 82
83 } // namespace blimp 83 } // 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