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

Issue 9716020: Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. (Closed)

Created:
8 years, 9 months ago by Wez
Modified:
8 years, 9 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, nkostylev+watch_chromium.org, jam, joi+watch-content_chromium.org, darin-cc_chromium.org, mmenke, brettw-cc_chromium.org, pam+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. This primarily addresses issues with code using the OS-provided htonX() & ntohX() functions from within the Chrome sandbox. Under Windows these functions are provided by ws2_32.dll, which is no longer available within Chrome's sandbox. The new base::HostToNetXX() and NetToHostXX() functions are safe for use by sandboxed code on Windows, and provide a single place where future fixes for other platforms can be made. BUG=117252 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=129476

Patch Set 1 #

Patch Set 2 : Rename base::htons etc to base::HostToNet16 etc. #

Patch Set 3 : Switch a few remaining call-sites. #

Total comments: 2

Patch Set 4 : Revert change to sandbox POC. #

Patch Set 5 : Revert changes under net/spdy/. #

Patch Set 6 : Revert changes under native_client_sdk/ #

Patch Set 7 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -110 lines) Patch
M base/sys_byteorder.h View 1 3 chunks +52 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/web_socket_proxy.cc View 1 2 3 4 7 chunks +10 lines, -9 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_parser.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/metrics/metrics_log_base.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/p2p/socket_host.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_tcp.cc View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/p2p/socket_host_test_utils.h View 1 1 chunk +4 lines, -3 lines 0 comments Download
M crypto/encryptor.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M crypto/p224.cc View 1 2 chunks +24 lines, -23 lines 0 comments Download
M crypto/symmetric_key_win.cc View 1 2 3 4 5 6 2 chunks +2 lines, -3 lines 0 comments Download
M jingle/notifier/base/chrome_async_socket_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M native_client_sdk/src/build_tools/debug_server/debug_stub/transport_common.cc View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M net/base/host_resolver_proc.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M net/base/ip_endpoint.cc View 1 5 chunks +5 lines, -4 lines 0 comments Download
M net/base/listen_socket.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M net/base/listen_socket_unittest.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M net/base/net_util.cc View 1 2 3 4 5 6 4 chunks +3 lines, -11 lines 0 comments Download
M net/base/net_util_unittest.cc View 1 2 3 4 5 6 3 chunks +3 lines, -2 lines 0 comments Download
M net/dns/dns_config_service_posix_unittest.cc View 1 3 chunks +2 lines, -4 lines 0 comments Download
M net/dns/dns_query.cc View 1 3 chunks +5 lines, -5 lines 0 comments Download
M net/dns/dns_response.cc View 1 2 3 2 chunks +5 lines, -5 lines 0 comments Download
M net/dns/dns_test_util.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M net/dns/dns_transaction_unittest.cc View 1 2 3 3 chunks +2 lines, -2 lines 0 comments Download
M net/server/web_socket.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M net/socket/socks5_client_socket.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M net/socket/socks5_client_socket_unittest.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M net/socket/socks_client_socket.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M net/socket/web_socket_server_socket.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ppapi/shared_impl/private/net_address_private_impl.cc View 1 2 3 4 5 6 6 chunks +11 lines, -9 lines 0 comments Download
M sync/util/nigori.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
Wez
PTAL! Most of this CL is a(n annoyingly manual) search-and-replace of htons->HostToNet16 and so-on. The ...
8 years, 9 months ago (2012-03-21 16:44:34 UTC) #1
rvargas (doing something else)
http://codereview.chromium.org/9716020/diff/12001/sandbox/sandbox_poc/pocdll/network.cc File sandbox/sandbox_poc/pocdll/network.cc (right): http://codereview.chromium.org/9716020/diff/12001/sandbox/sandbox_poc/pocdll/network.cc#newcode38 sandbox/sandbox_poc/pocdll/network.cc:38: service.sin_port = base::HostToNet16(88); I'm on the fence about this ...
8 years, 9 months ago (2012-03-21 18:47:41 UTC) #2
Wez
On 2012/03/21 18:47:41, rvargas wrote: > http://codereview.chromium.org/9716020/diff/12001/sandbox/sandbox_poc/pocdll/network.cc > File sandbox/sandbox_poc/pocdll/network.cc (right): > > http://codereview.chromium.org/9716020/diff/12001/sandbox/sandbox_poc/pocdll/network.cc#newcode38 > ...
8 years, 9 months ago (2012-03-21 19:22:05 UTC) #3
Wez
http://codereview.chromium.org/9716020/diff/12001/sandbox/sandbox_poc/pocdll/network.cc File sandbox/sandbox_poc/pocdll/network.cc (right): http://codereview.chromium.org/9716020/diff/12001/sandbox/sandbox_poc/pocdll/network.cc#newcode38 sandbox/sandbox_poc/pocdll/network.cc:38: service.sin_port = base::HostToNet16(88); On 2012/03/21 18:47:41, rvargas wrote: > ...
8 years, 9 months ago (2012-03-21 20:09:03 UTC) #4
willchan no longer on Chromium
Please undo changes to net/spdy/spdy_frame* and net/spdy/spdy_protocol.h as they are pulled in from google3. We're ...
8 years, 9 months ago (2012-03-22 01:41:16 UTC) #5
Wez
On 2012/03/22 01:41:16, willchan wrote: > Please undo changes to net/spdy/spdy_frame* and net/spdy/spdy_protocol.h as they ...
8 years, 9 months ago (2012-03-22 05:09:23 UTC) #6
willchan no longer on Chromium
On Wed, Mar 21, 2012 at 10:09 PM, <wez@chromium.org> wrote: > On 2012/03/22 01:41:16, willchan ...
8 years, 9 months ago (2012-03-22 05:32:19 UTC) #7
willchan no longer on Chromium
lgtm
8 years, 9 months ago (2012-03-22 21:33:40 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wez@chromium.org/9716020/21001
8 years, 9 months ago (2012-03-22 21:51:58 UTC) #9
commit-bot: I haz the power
Presubmit check for 9716020-21001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 9 months ago (2012-03-22 21:52:19 UTC) #10
Wez
dmichael: OWNERS for ppapi/, plz noelallan1: same for native_client_sdk/src, plz akalin: ditto for sync/ rsleevi: ...
8 years, 9 months ago (2012-03-22 22:13:44 UTC) #11
Ryan Sleevi
lgtm
8 years, 9 months ago (2012-03-22 22:29:10 UTC) #12
dmichael (off chromium)
ppapi lgtm
8 years, 9 months ago (2012-03-22 22:48:12 UTC) #13
akalin
jingle/sync lgtm
8 years, 9 months ago (2012-03-22 23:02:03 UTC) #14
noelallen1
lgtm I do not believe the version in native_client_sdk is being used. It probably got ...
8 years, 9 months ago (2012-03-24 17:43:27 UTC) #15
Wez
On 2012/03/24 17:43:27, noelallen1 wrote: > lgtm > > I do not believe the version ...
8 years, 9 months ago (2012-03-27 21:06:56 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wez@chromium.org/9716020/34001
8 years, 9 months ago (2012-03-27 22:46:59 UTC) #17
commit-bot: I haz the power
Presubmit check for 9716020-34001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 9 months ago (2012-03-27 22:47:13 UTC) #18
Wez
On 2012/03/27 22:47:13, I haz the power (commit-bot) wrote: > Presubmit check for 9716020-34001 failed ...
8 years, 9 months ago (2012-03-27 23:09:02 UTC) #19
Sergey Ulanov
lgtm
8 years, 9 months ago (2012-03-27 23:17:52 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wez@chromium.org/9716020/34001
8 years, 9 months ago (2012-03-28 00:46:23 UTC) #21
commit-bot: I haz the power
Try job failure for 9716020-34001 (retry) on linux_chromeos for step "compile" (clobber build). It's a ...
8 years, 9 months ago (2012-03-28 01:08:49 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wez@chromium.org/9716020/42001
8 years, 9 months ago (2012-03-28 16:26:22 UTC) #23
commit-bot: I haz the power
8 years, 9 months ago (2012-03-28 20:19:35 UTC) #24
Change committed as 129476

Powered by Google App Engine
This is Rietveld 408576698