Commit 4fd60561 authored by Douglas Creager's avatar Douglas Creager Committed by Commit Bot

Network Service: Disallow Reporting/NEL uploads

Reporting specifies that the user agent should allow users to prohibit
uploads on a per-origin basis.  The Network Service's NetworkDelegate
needs to actively disallow Reporting uploads until we're able to hook
up the permissions manager across the service boundary.

Bug: 845559
Cq-Include-Trybots: luci.chromium.try:linux_mojo;master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ib63890e3b045c0067969a70628191530a96d482f
Reviewed-on: https://chromium-review.googlesource.com/1171571Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: Douglas Creager <dcreager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582654}
parent 0434f5b4
...@@ -52,4 +52,36 @@ bool NetworkServiceNetworkDelegate::OnCanAccessFile( ...@@ -52,4 +52,36 @@ bool NetworkServiceNetworkDelegate::OnCanAccessFile(
return true; return true;
} }
bool NetworkServiceNetworkDelegate::OnCanQueueReportingReport(
const url::Origin& origin) const {
// TODO(crbug.com/845559): Disable all Reporting uploads until we can perform
// a BACKGROUND_SYNC permissions check across service boundaries.
return false;
}
void NetworkServiceNetworkDelegate::OnCanSendReportingReports(
std::set<url::Origin> origins,
base::OnceCallback<void(std::set<url::Origin>)> result_callback) const {
// TODO(crbug.com/845559): Disable all Reporting uploads until we can perform
// a BACKGROUND_SYNC permissions check across service boundaries.
origins.clear();
std::move(result_callback).Run(std::move(origins));
}
bool NetworkServiceNetworkDelegate::OnCanSetReportingClient(
const url::Origin& origin,
const GURL& endpoint) const {
// TODO(crbug.com/845559): Disable all Reporting uploads until we can perform
// a BACKGROUND_SYNC permissions check across service boundaries.
return false;
}
bool NetworkServiceNetworkDelegate::OnCanUseReportingClient(
const url::Origin& origin,
const GURL& endpoint) const {
// TODO(crbug.com/845559): Disable all Reporting uploads until we can perform
// a BACKGROUND_SYNC permissions check across service boundaries.
return false;
}
} // namespace network } // namespace network
...@@ -32,6 +32,15 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkServiceNetworkDelegate ...@@ -32,6 +32,15 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkServiceNetworkDelegate
const base::FilePath& original_path, const base::FilePath& original_path,
const base::FilePath& absolute_path) const override; const base::FilePath& absolute_path) const override;
bool OnCanQueueReportingReport(const url::Origin& origin) const override;
void OnCanSendReportingReports(std::set<url::Origin> origins,
base::OnceCallback<void(std::set<url::Origin>)>
result_callback) const override;
bool OnCanSetReportingClient(const url::Origin& origin,
const GURL& endpoint) const override;
bool OnCanUseReportingClient(const url::Origin& origin,
const GURL& endpoint) const override;
NetworkContext* network_context_; NetworkContext* network_context_;
DISALLOW_COPY_AND_ASSIGN(NetworkServiceNetworkDelegate); DISALLOW_COPY_AND_ASSIGN(NetworkServiceNetworkDelegate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment