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

Issue 12569007: Remove URL fragment from referrer HTTP header when opening link using "Open Link in New Tab" option. (Closed)

Created:
7 years, 9 months ago by mef
Modified:
7 years, 8 months ago
Reviewers:
pauljensen, brettw, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, creis+watch_chromium.org, shishir+watch_chromium.org, jam, Avi (use Gerrit), joi+watch-content_chromium.org, benjhayden+dwatch_chromium.org, dominich+watch_chromium.org, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, ajwong+watch_chromium.org
Visibility:
Public.

Description

Remove URL fragment from referrer HTTP header (to comply with rfc2616) when opening link using "Open Link in New Tab" option. Change URLRequest::set_referrer to URLRequest::SetReferrer which sanitizes referrer by removing URL fragment, user name and password. Remove URLRequest::GetSanitizedReferrer as URLRequest::referrer is now sanitized during set. BUG=168213 TEST=net_unittests, browser_tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193482

Patch Set 1 : move referrer cleaning into SetReferrer #

Patch Set 2 : RenderViewContextMenu::OpenURL referrer cleanup #

Patch Set 3 : use ExecuteScript to get referrer #

Patch Set 4 : revert testserver.py changes #

Total comments: 22

Patch Set 5 : address code review comments #

Total comments: 16

Patch Set 6 : address code review comments, add UMA_HISTOGRAM #

Total comments: 12

Patch Set 7 : address code review comments #

Total comments: 1

Patch Set 8 : address code review comments #

Total comments: 2

Patch Set 9 : address pauljensen's review comments #

Total comments: 9

Patch Set 10 : "Address Matt's code review comments" #

Total comments: 6

Patch Set 11 : Sync up to rev 189305 #

Patch Set 12 : Address Matt's review comments #

Patch Set 13 : sync up to rev 193385 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+179 lines, -35 lines) Patch
M chrome/browser/automation/url_request_automation_job.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/predictors/resource_prefetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +14 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +103 lines, -0 lines 0 comments Download
M content/browser/android/download_controller_android_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -3 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_fetcher_core.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -3 lines 0 comments Download
M net/url_request/url_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +12 lines, -11 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +30 lines, -3 lines 0 comments Download
M webkit/tools/test_shell/simple_resource_loader_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 23 (0 generated)
mef
Paul, could you take a look? I've reverted my changes to testserver.py. thanks, -m
7 years, 9 months ago (2013-03-14 15:26:41 UTC) #1
pauljensen
Misha, this is looking right on track. Please address my initial comments and then post ...
7 years, 9 months ago (2013-03-14 18:53:44 UTC) #2
pauljensen
Can you also update the description of the CL too?
7 years, 9 months ago (2013-03-14 18:56:32 UTC) #3
mef
Paul, PTAL. Also, URLRequest::SetReferrer currently doesn't sanitize the URL unless it is valid. Maybe it ...
7 years, 9 months ago (2013-03-14 20:31:38 UTC) #4
pauljensen
Can you make the first line of the description a description of what your change ...
7 years, 9 months ago (2013-03-15 13:01:57 UTC) #5
pauljensen
I made some more comments. To answer the question about an invalid URL, I'd consult ...
7 years, 9 months ago (2013-03-15 13:37:45 UTC) #6
mef
Paul, PTAL. https://codereview.chromium.org/12569007/diff/60001/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc File chrome/browser/tab_contents/render_view_context_menu_browsertest.cc (right): https://codereview.chromium.org/12569007/diff/60001/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc#newcode180 chrome/browser/tab_contents/render_view_context_menu_browsertest.cc:180: + "'>link</a>")); On 2013/03/15 13:37:45, pauljensen wrote: ...
7 years, 9 months ago (2013-03-15 16:36:42 UTC) #7
pauljensen
I think we're almost there; this is probably my last set of comments. https://codereview.chromium.org/12569007/diff/66001/chrome/browser/automation/url_request_automation_job.cc File ...
7 years, 9 months ago (2013-03-15 21:50:00 UTC) #8
mef
Paul, PTAL. https://codereview.chromium.org/12569007/diff/66001/chrome/browser/automation/url_request_automation_job.cc File chrome/browser/automation/url_request_automation_job.cc (right): https://codereview.chromium.org/12569007/diff/66001/chrome/browser/automation/url_request_automation_job.cc#newcode485 chrome/browser/automation/url_request_automation_job.cc:485: // URLRequest::SetReferrer() ensures that On 2013/03/15 21:50:00, ...
7 years, 9 months ago (2013-03-18 16:42:07 UTC) #9
pauljensen
Please capitalize URL in the CL description. https://codereview.chromium.org/12569007/diff/66001/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc File chrome/browser/tab_contents/render_view_context_menu_browsertest.cc (right): https://codereview.chromium.org/12569007/diff/66001/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc#newcode208 chrome/browser/tab_contents/render_view_context_menu_browsertest.cc:208: "window.domAutomationController.send(window.document.referrer);", On ...
7 years, 9 months ago (2013-03-18 20:16:19 UTC) #10
mef
Paul, PTAL. I've also removed some patch sets... thanks, -m https://codereview.chromium.org/12569007/diff/80001/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc File chrome/browser/tab_contents/render_view_context_menu_browsertest.cc (right): https://codereview.chromium.org/12569007/diff/80001/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc#newcode210 ...
7 years, 9 months ago (2013-03-18 20:59:16 UTC) #11
pauljensen
LGTM
7 years, 9 months ago (2013-03-19 17:21:37 UTC) #12
mef
Matt, could you please review my changes for referrer fix. thanks, -m
7 years, 9 months ago (2013-03-19 18:33:09 UTC) #13
mmenke
Looks pretty good. https://codereview.chromium.org/12569007/diff/82002/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc File chrome/browser/tab_contents/render_view_context_menu_browsertest.cc (right): https://codereview.chromium.org/12569007/diff/82002/chrome/browser/tab_contents/render_view_context_menu_browsertest.cc#newcode209 chrome/browser/tab_contents/render_view_context_menu_browsertest.cc:209: ASSERT_EQ(correct_referrer, actual_referrer); We should check "document.referrer" ...
7 years, 9 months ago (2013-03-19 19:01:09 UTC) #14
mef
Matt, thanks! I've added tests that you've suggested, could you take another look? thanks, -m ...
7 years, 9 months ago (2013-03-19 21:40:28 UTC) #15
mmenke
LGTM. You may want to separate out the tab_contents changes to a separate CL, since ...
7 years, 9 months ago (2013-03-20 16:33:50 UTC) #16
mef
Hi Brett, could you please review my fix for BUG=168213 (Remove URL fragment from referrer ...
7 years, 9 months ago (2013-03-20 18:25:31 UTC) #17
mef
Hi Brett, sorry to bother you again, but is possible to review this CL some ...
7 years, 8 months ago (2013-04-01 14:44:31 UTC) #18
brettw
What do you need reviewed? Is everything reviewed and you just need owners review for ...
7 years, 8 months ago (2013-04-03 05:23:07 UTC) #19
mef
On 2013/04/03 05:23:07, brettw wrote: > What do you need reviewed? Is everything reviewed and ...
7 years, 8 months ago (2013-04-03 14:43:39 UTC) #20
brettw
owners lgtm
7 years, 8 months ago (2013-04-08 23:23:13 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mef@chromium.org/12569007/111001
7 years, 8 months ago (2013-04-10 20:29:09 UTC) #22
commit-bot: I haz the power
7 years, 8 months ago (2013-04-10 22:46:16 UTC) #23
Message was sent while issue was closed.
Change committed as 193482

Powered by Google App Engine
This is Rietveld 408576698