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

Side by Side Diff: extensions/browser/api/socket/tls_socket.cc

Issue 717263003: Use uint16 for port numbers, extensions/ edition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/socket/tls_socket.h" 5 #include "extensions/browser/api/socket/tls_socket.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "extensions/browser/api/api_resource.h" 9 #include "extensions/browser/api/api_resource.h"
10 #include "net/base/address_list.h" 10 #include "net/base/address_list.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 TLSSocket::TLSSocket(scoped_ptr<net::StreamSocket> tls_socket, 71 TLSSocket::TLSSocket(scoped_ptr<net::StreamSocket> tls_socket,
72 const std::string& owner_extension_id) 72 const std::string& owner_extension_id)
73 : ResumableTCPSocket(owner_extension_id), tls_socket_(tls_socket.Pass()) { 73 : ResumableTCPSocket(owner_extension_id), tls_socket_(tls_socket.Pass()) {
74 } 74 }
75 75
76 TLSSocket::~TLSSocket() { 76 TLSSocket::~TLSSocket() {
77 Disconnect(); 77 Disconnect();
78 } 78 }
79 79
80 void TLSSocket::Connect(const std::string& address, 80 void TLSSocket::Connect(const std::string& address,
81 int port, 81 uint16 port,
82 const CompletionCallback& callback) { 82 const CompletionCallback& callback) {
83 callback.Run(net::ERR_CONNECTION_FAILED); 83 callback.Run(net::ERR_CONNECTION_FAILED);
84 } 84 }
85 85
86 void TLSSocket::Disconnect() { 86 void TLSSocket::Disconnect() {
87 if (tls_socket_) { 87 if (tls_socket_) {
88 tls_socket_->Disconnect(); 88 tls_socket_->Disconnect();
89 tls_socket_.reset(); 89 tls_socket_.reset();
90 } 90 }
91 } 91 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 bool TLSSocket::SetKeepAlive(bool enable, int delay) { 142 bool TLSSocket::SetKeepAlive(bool enable, int delay) {
143 return false; 143 return false;
144 } 144 }
145 145
146 bool TLSSocket::SetNoDelay(bool no_delay) { 146 bool TLSSocket::SetNoDelay(bool no_delay) {
147 return false; 147 return false;
148 } 148 }
149 149
150 int TLSSocket::Listen(const std::string& address, 150 int TLSSocket::Listen(const std::string& address,
151 int port, 151 uint16 port,
152 int backlog, 152 int backlog,
153 std::string* error_msg) { 153 std::string* error_msg) {
154 *error_msg = kTLSSocketTypeInvalidError; 154 *error_msg = kTLSSocketTypeInvalidError;
155 return net::ERR_NOT_IMPLEMENTED; 155 return net::ERR_NOT_IMPLEMENTED;
156 } 156 }
157 157
158 void TLSSocket::Accept(const AcceptCompletionCallback& callback) { 158 void TLSSocket::Accept(const AcceptCompletionCallback& callback) {
159 callback.Run(net::ERR_FAILED, NULL); 159 callback.Run(net::ERR_FAILED, NULL);
160 } 160 }
161 161
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (status != net::OK) { 300 if (status != net::OK) {
301 DVLOG(1) << "Status is not OK or IO-pending: " 301 DVLOG(1) << "Status is not OK or IO-pending: "
302 << net::ErrorToString(status); 302 << net::ErrorToString(status);
303 } 303 }
304 connect_cb.Run(status); 304 connect_cb.Run(status);
305 } 305 }
306 } 306 }
307 307
308 } // namespace extensions 308 } // namespace extensions
309 309
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698