summaryrefslogtreecommitdiffstats
path: root/components/nacl/browser
diff options
context:
space:
mode:
authorpkasting <pkasting@chromium.org>2014-11-19 19:35:21 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-20 03:35:46 +0000
commitcba132919fff063c1cfbe88e9a6f1bf4583729cb (patch)
treea5f503e05ed15b987b5d97aabeb66d9fa667a7a1 /components/nacl/browser
parent85d89716b4de9d1280d74a9cbe70e9abcb9c274c (diff)
downloadchromium_src-cba132919fff063c1cfbe88e9a6f1bf4583729cb.zip
chromium_src-cba132919fff063c1cfbe88e9a6f1bf4583729cb.tar.gz
chromium_src-cba132919fff063c1cfbe88e9a6f1bf4583729cb.tar.bz2
Use uint16 for port numbers more pervasively.
We currently use a mixture of ints and uint16s for port numbers. This triggers a variety of "value possibly truncated" warnings on MSVC (currently disabled) wherever we implicitly truncate. Fix this by using uint16 consistently through more functions. (Using int consistently would be more problematic as the majority of third-party/system APIs that use port numbers use 16-bit types for them.) By far the majority of these changes are fallout from changing IPEndPoint, which is widely used; it'd be difficult to split this CL up into smaller pieces :( Note that I didn't use uint16_t to avoid introducing inconsistencies between existing uint16 usage and new uint16_t usage. Conversion of everything to uint16_t can happen later. This CL was reviewed and approved in pieces in the following CLs: https://codereview.chromium.org/716223002/ https://codereview.chromium.org/717263003/ https://codereview.chromium.org/717373002/ https://codereview.chromium.org/718273002/ https://codereview.chromium.org/722503002/ Committing as TBR to the original reviewers. BUG=81439 TEST=none TBR=gunsch,cpu,jhawkins,davidben,jyasskin,mmenke Review URL: https://codereview.chromium.org/655063002 Cr-Commit-Position: refs/heads/master@{#304961}
Diffstat (limited to 'components/nacl/browser')
-rw-r--r--components/nacl/browser/nacl_process_host.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index afb430a..8994ad6 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -757,7 +757,7 @@ void NaClProcessHost::SetDebugStubPort(int port) {
#if defined(OS_POSIX)
// TCP port we chose for NaCl debug stub. It can be any other number.
-static const int kInitialDebugStubPort = 4014;
+static const uint16_t kInitialDebugStubPort = 4014;
net::SocketDescriptor NaClProcessHost::GetDebugStubSocketHandle() {
net::SocketDescriptor s = net::kInvalidSocket;
@@ -765,7 +765,7 @@ net::SocketDescriptor NaClProcessHost::GetDebugStubSocketHandle() {
// allocate any available port.
// On success, if the test system has register a handler
// (GdbDebugStubPortListener), we fire a notification.
- int port = kInitialDebugStubPort;
+ uint16 port = kInitialDebugStubPort;
s = net::TCPListenSocket::CreateAndBind("127.0.0.1", port);
if (s == net::kInvalidSocket) {
s = net::TCPListenSocket::CreateAndBindAnyPort("127.0.0.1", &port);