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

Issue 6488010: Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. (Closed)

Created:
9 years, 10 months ago by Brian Ryner
Modified:
9 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, chrome-anti-phishing_googlegroups.com, jochen (gone - plz use gerrit), lzheng, Paweł Hajdan Jr., rvargas (doing something else), Ryan Sleevi
Visibility:
Public.

Description

Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. This will be used to run pre-classification checks for client-side phishing detection, and will also enable the socket address to be exposed via the webRequest extension API. This is adapted from the original patch by pmarks on http://codereview.chromium.org/6369003/ . BUG=51663 TEST=added socket address checks to various unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75620

Patch Set 1 #

Total comments: 13

Patch Set 2 : Address review comments and add an end-to-end test #

Patch Set 3 : propagate GetPeerAddressErrors, and sync #

Total comments: 8

Patch Set 4 : Use HostPortPair everywhere #

Total comments: 9

Patch Set 5 : Address eroman's comments #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+318 lines, -9 lines) Patch
M base/pickle.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M base/pickle.cc View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M base/pickle_unittest.cc View 1 2 3 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/test/render_view_host_browsertest.cc View 1 2 3 4 2 chunks +43 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/test/test_render_view_host.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/common_param_traits.h View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/common/common_param_traits.cc View 1 2 3 2 chunks +22 lines, -0 lines 0 comments Download
M chrome/common/common_param_traits_unittest.cc View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M chrome/common/render_messages.cc View 1 2 3 chunks +5 lines, -1 line 0 comments Download
M chrome/common/render_messages_params.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/render_messages_params.cc View 1 2 3 3 chunks +5 lines, -1 line 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M net/base/host_port_pair.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M net/base/host_port_pair.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M net/ftp/ftp_network_transaction.cc View 1 2 3 4 2 chunks +10 lines, -2 lines 0 comments Download
M net/ftp/ftp_network_transaction_unittest.cc View 1 2 3 3 chunks +7 lines, -0 lines 0 comments Download
M net/ftp/ftp_response_info.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M net/http/http_cache_unittest.cc View 1 2 3 2 chunks +26 lines, -0 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_response_info.h View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M net/http/http_response_info.cc View 1 2 3 4 chunks +17 lines, -0 lines 3 comments Download
M net/http/http_stream_parser.cc View 1 2 3 4 3 chunks +10 lines, -1 line 0 comments Download
M net/socket/socket_test_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_http_stream.cc View 1 2 3 4 2 chunks +10 lines, -1 line 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M net/url_request/url_request.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M net/url_request/url_request.cc View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M net/url_request/url_request_ftp_job.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M net/url_request/url_request_ftp_job.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M net/url_request/url_request_http_job.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M net/url_request/url_request_job.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M net/url_request/url_request_job.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 9 chunks +30 lines, -0 lines 0 comments Download
M webkit/glue/resource_loader_bridge.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M webkit/glue/weburlloader_impl.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
Brian Ryner
9 years, 10 months ago (2011-02-11 00:12:38 UTC) #1
pmarks
Note that in my original change, the JavaScript part served as an end-to-end test for ...
9 years, 10 months ago (2011-02-11 00:36:38 UTC) #2
Paweł Hajdan Jr.
Drive-by with FTP-related comments. Please let me do another review before committing. http://codereview.chromium.org/6488010/diff/1/net/ftp/ftp_network_transaction.cc File net/ftp/ftp_network_transaction.cc ...
9 years, 10 months ago (2011-02-11 19:34:54 UTC) #3
Brian Ryner
I added an end-to-end test as pmarks suggested -- currently it's in render_view_host_browsertest, but I'm ...
9 years, 10 months ago (2011-02-11 23:01:07 UTC) #4
Paweł Hajdan Jr.
http://codereview.chromium.org/6488010/diff/1/net/ftp/ftp_network_transaction.cc File net/ftp/ftp_network_transaction.cc (right): http://codereview.chromium.org/6488010/diff/1/net/ftp/ftp_network_transaction.cc#newcode631 net/ftp/ftp_network_transaction.cc:631: response_.socket_address.clear(); On 2011/02/11 23:01:07, Brian Ryner wrote: > On ...
9 years, 10 months ago (2011-02-14 09:10:02 UTC) #5
Brian Ryner
So just to clarify, you're thinking that we would want to take the error code ...
9 years, 10 months ago (2011-02-14 20:29:20 UTC) #6
Paweł Hajdan Jr.
On 2011/02/14 20:29:20, Brian Ryner wrote: > So just to clarify, you're thinking that we ...
9 years, 10 months ago (2011-02-15 08:37:38 UTC) #7
Brian Ryner
Ok, updated the CL to propagate GetPeerAddress failures. Please take another look.
9 years, 10 months ago (2011-02-15 21:32:45 UTC) #8
eroman
http://codereview.chromium.org/6488010/diff/19001/net/ftp/ftp_network_transaction_unittest.cc File net/ftp/ftp_network_transaction_unittest.cc (right): http://codereview.chromium.org/6488010/diff/19001/net/ftp/ftp_network_transaction_unittest.cc#newcode834 net/ftp/ftp_network_transaction_unittest.cc:834: EXPECT_EQ("192.0.2.33:0", transaction_.GetResponseInfo()->socket_address); Is that port number of zero an ...
9 years, 10 months ago (2011-02-16 21:41:13 UTC) #9
Brian Ryner
One question about switching to HostPortPair -- do you think we should do this for ...
9 years, 10 months ago (2011-02-16 22:52:29 UTC) #10
eroman
> One question about switching to HostPortPair -- do you think we should do this ...
9 years, 10 months ago (2011-02-17 00:39:10 UTC) #11
Brian Ryner
Splitting up the host and port makes sense to me, and we may as well ...
9 years, 10 months ago (2011-02-17 00:51:23 UTC) #12
pmarks
On 2011/02/17 00:51:23, Brian Ryner wrote: > Splitting up the host and port makes sense ...
9 years, 10 months ago (2011-02-17 01:01:45 UTC) #13
Brian Ryner
I'm currently thinking "remoteIPAddress" and "remotePort" for the WebKit parts, sound reasonable? On 2011/02/17 01:01:45, ...
9 years, 10 months ago (2011-02-17 02:28:09 UTC) #14
pmarks
On 2011/02/17 02:28:09, Brian Ryner wrote: > I'm currently thinking "remoteIPAddress" and "remotePort" for the ...
9 years, 10 months ago (2011-02-17 02:33:07 UTC) #15
Brian Ryner
https://bugs.webkit.org/show_bug.cgi?id=54607 On 2011/02/17 02:33:07, pmarks wrote: > On 2011/02/17 02:28:09, Brian Ryner wrote: > > ...
9 years, 10 months ago (2011-02-17 04:48:23 UTC) #16
Brian Ryner
Updated to use HostPortPair (everywhere) to hold the remote IP address and port. Please take ...
9 years, 10 months ago (2011-02-18 02:19:30 UTC) #17
eroman
LGTM, nice test coverage! http://codereview.chromium.org/6488010/diff/25003/chrome/browser/renderer_host/test/render_view_host_browsertest.cc File chrome/browser/renderer_host/test/render_view_host_browsertest.cc (right): http://codereview.chromium.org/6488010/diff/25003/chrome/browser/renderer_host/test/render_view_host_browsertest.cc#newcode232 chrome/browser/renderer_host/test/render_view_host_browsertest.cc:232: RenderViewHostTestTabContentsObserver(TabContents* tab_contents) nit: mark single-argument ...
9 years, 10 months ago (2011-02-18 02:48:29 UTC) #18
eroman
http://codereview.chromium.org/6488010/diff/25003/net/spdy/spdy_http_stream.cc File net/spdy/spdy_http_stream.cc (right): http://codereview.chromium.org/6488010/diff/25003/net/spdy/spdy_http_stream.cc#newcode235 net/spdy/spdy_http_stream.cc:235: // Put the peer's ip and port into the ...
9 years, 10 months ago (2011-02-18 02:49:24 UTC) #19
Brian Ryner
http://codereview.chromium.org/6488010/diff/25003/chrome/browser/renderer_host/test/render_view_host_browsertest.cc File chrome/browser/renderer_host/test/render_view_host_browsertest.cc (right): http://codereview.chromium.org/6488010/diff/25003/chrome/browser/renderer_host/test/render_view_host_browsertest.cc#newcode232 chrome/browser/renderer_host/test/render_view_host_browsertest.cc:232: RenderViewHostTestTabContentsObserver(TabContents* tab_contents) On 2011/02/18 02:48:30, eroman wrote: > nit: ...
9 years, 10 months ago (2011-02-18 04:41:58 UTC) #20
Paweł Hajdan Jr.
FTP code LGTM, thank you.
9 years, 10 months ago (2011-02-18 12:09:38 UTC) #21
pmarks
Looks like Brian checked this in today: http://src.chromium.org/viewvc/chrome?view=rev&revision=75620
9 years, 10 months ago (2011-02-23 02:06:53 UTC) #22
wtc
http://codereview.chromium.org/6488010/diff/35001/net/http/http_response_info.cc File net/http/http_response_info.cc (right): http://codereview.chromium.org/6488010/diff/35001/net/http/http_response_info.cc#newcode173 net/http/http_response_info.cc:173: } We should have bumped the version number when ...
9 years, 8 months ago (2011-04-21 22:44:25 UTC) #23
Brian Ryner
http://codereview.chromium.org/6488010/diff/35001/net/http/http_response_info.cc File net/http/http_response_info.cc (right): http://codereview.chromium.org/6488010/diff/35001/net/http/http_response_info.cc#newcode173 net/http/http_response_info.cc:173: } On 2011/04/21 22:44:25, wtc wrote: > We should ...
9 years, 8 months ago (2011-04-22 00:44:27 UTC) #24
wtc
9 years, 8 months ago (2011-04-22 19:07:13 UTC) #25
No, this is not causing problems.

http://codereview.chromium.org/6488010/diff/35001/net/http/http_response_info.cc
File net/http/http_response_info.cc (right):

http://codereview.chromium.org/6488010/diff/35001/net/http/http_response_info...
net/http/http_response_info.cc:173: }
We could change the check on line 118 to allow version 1, and
read socket_address only if version is > 1 here.

Now that I studied your solution again, I think it is a fine
way to avoid bumping the version number because the new field
is serialized at the end.  The only drawbacks I see are:
1) version 1 records may or may not have the socket_address
field.
2) The code pattern for decoding fields changes starting
on line 167 from
  if (!pickle.Foo())
    return false;
to
  if (pickle.Foo()) {
    // decode next field.
  }

Powered by Google App Engine
This is Rietveld 408576698