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

Side by Side Diff: remoting/host/win/rdp_client.cc

Issue 655063002: Use uint16 for port numbers more pervasively. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert bad change 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
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/protocol/chromium_socket_factory.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/host/win/rdp_client.h" 5 #include "remoting/host/win/rdp_client.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 DCHECK(base::MessageLoopForUI::IsCurrent()); 131 DCHECK(base::MessageLoopForUI::IsCurrent());
132 DCHECK(!rdp_client_window_); 132 DCHECK(!rdp_client_window_);
133 DCHECK(!self_); 133 DCHECK(!self_);
134 134
135 // Read the port number used by RDP. 135 // Read the port number used by RDP.
136 DWORD server_port; 136 DWORD server_port;
137 base::win::RegKey key(HKEY_LOCAL_MACHINE, kRdpPortKeyName, KEY_READ); 137 base::win::RegKey key(HKEY_LOCAL_MACHINE, kRdpPortKeyName, KEY_READ);
138 if (!key.Valid() || 138 if (!key.Valid() ||
139 (key.ReadValueDW(kRdpPortValueName, &server_port) != ERROR_SUCCESS)) { 139 (key.ReadValueDW(kRdpPortValueName, &server_port) != ERROR_SUCCESS) ||
140 server_port > 65535) {
140 server_port = kDefaultRdpPort; 141 server_port = kDefaultRdpPort;
141 } 142 }
142 143
143 net::IPAddressNumber server_address( 144 net::IPAddressNumber server_address(
144 kRdpLoopbackAddress, 145 kRdpLoopbackAddress,
145 kRdpLoopbackAddress + arraysize(kRdpLoopbackAddress)); 146 kRdpLoopbackAddress + arraysize(kRdpLoopbackAddress));
146 net::IPEndPoint server_endpoint(server_address, server_port); 147 net::IPEndPoint server_endpoint(server_address,
148 static_cast<uint16>(server_port));
147 149
148 // Create the ActiveX control window. 150 // Create the ActiveX control window.
149 rdp_client_window_.reset(new RdpClientWindow(server_endpoint, terminal_id, 151 rdp_client_window_.reset(new RdpClientWindow(server_endpoint, terminal_id,
150 this)); 152 this));
151 if (!rdp_client_window_->Connect(screen_size)) { 153 if (!rdp_client_window_->Connect(screen_size)) {
152 rdp_client_window_.reset(); 154 rdp_client_window_.reset();
153 155
154 // Notify the caller that connection attempt failed. 156 // Notify the caller that connection attempt failed.
155 NotifyClosed(); 157 NotifyClosed();
156 } 158 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 227 }
226 228
227 if (event_handler_) { 229 if (event_handler_) {
228 RdpClient::EventHandler* event_handler = event_handler_; 230 RdpClient::EventHandler* event_handler = event_handler_;
229 event_handler_ = NULL; 231 event_handler_ = NULL;
230 event_handler->OnRdpClosed(); 232 event_handler->OnRdpClosed();
231 } 233 }
232 } 234 }
233 235
234 } // namespace remoting 236 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/protocol/chromium_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698