New issue
Advanced search Search tips

Issue 838906 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug
Proj-Servicification

Blocking:
issue 598073
issue 840359



Sign in to add a comment

Add enable_referrers support to the network service

Project Member Reported by xunji...@chromium.org, May 2 2018

Issue description

We need to add "enable_referrers" support to the network service. This is a per-NetworkContext bool that suppresses referrers.  This would involve getting the configuration to the network service, and updating it on changes. The more complicated part of implementing it in the network service - currently, the police is implemented by the ChromeNetworkDelegate, but we can't just create a new NetworkDelegate and overwrite the old one, at least if we want to use the same code in the in-process route. Could either wrap the old one with an (already existing) class, or implement it another way, like adding a URLRequestDelegate callback.  The wrapper route is probably the simplest.


This bug is filed off mmenke@'s starter list. If anyone has free cycles, please take this.
 
Cc: morlovich@chromium.org
Blocking: 840359
Think it may actually be simplest to go with the URLRequestDelegate route - we wouldn't need to add a callback, could just ignore the initial referrer and set URLRequest::NO_REFERRER on the URLRequest itself.

We could theoretically remove the setting from the network service, and just have consumers respect the setting, but that's probably a lot of work, even if it makes for a cleaner NetworkService API.
Another option: it could potentially be implemented in same place as the stuff we clearly don't want in the network service (e.g. forcing safe search) would be, though I may be way too unfamiliar with the exact APIs involved to reliably assess plausibility.

Hmm. Probably not the greatest idea since the Chrome-specific URL-rewriting stuff pretty much just needs to catch navigation, while with the user expectations on no-referrer it would be bad to miss *anything*. 

Comment 5 by dxie@chromium.org, May 15 2018

Labels: -Pri-3 Proj-Servicification-Canary OS-All Pri-1

Comment 6 by dxie@chromium.org, May 18 2018

Labels: -OS-All OS-Windows OS-Linux OS-Mac OS-Chrome OS-Android
Owner: mmenke@chromium.org
Status: Started (was: Available)
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399

commit b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399
Author: Matt Menke <mmenke@chromium.org>
Date: Mon Jun 18 21:40:16 2018

Hook up EnableReferrers pref to NetworkContexts.

The causes the parameter to work when the network service is enabled.
This CL disables referrers for Safe Browsing requests when the network
service is enabled - none of the requests use referrers, so it seems
like hooking up the kEnableReferrers pref to that NetworkContext is more
effort than it's worth. Never send it rather than always send it just to
make sure we respect the user's preference, when referrers are disabled.

Bug:  838906 
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I8c9d8350bfce99e1140900f5dbcbda9eb0cc9718
Reviewed-on: https://chromium-review.googlesource.com/1087570
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568172}
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/io_thread.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/io_thread.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/chrome_network_delegate.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/chrome_network_delegate.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/chrome_network_delegate_unittest.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/default_network_context_params.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/network_context_configuration_browsertest.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/profile_network_context_service.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/profile_network_context_service.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/system_network_context_manager.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/net/system_network_context_manager.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/profiles/profile_io_data.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/chrome/browser/profiles/profile_io_data.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/net/url_request/url_request_context_builder.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/net/url_request/url_request_context_builder.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/services/network/network_context.cc
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/services/network/network_context.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/services/network/public/mojom/network_context.mojom
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/services/network/test/test_network_context.h
[modify] https://crrev.com/b63ff0d946a5ad8fb4bda550936d6b3bd4f1c399/services/network/url_request_context_builder_mojo.cc

Comment 9 by mmenke@chromium.org, Jun 18 2018

Status: Fixed (was: Started)

Sign in to add a comment