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

Unified Diff: net/reporting/reporting_delivery_agent.cc

Issue 2889193002: Reporting: Add ReportingDelegate to check site permissions (Closed)
Patch Set: rebase, tweak, format Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/reporting/reporting_delegate.cc ('k') | net/reporting/reporting_endpoint_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_delivery_agent.cc
diff --git a/net/reporting/reporting_delivery_agent.cc b/net/reporting/reporting_delivery_agent.cc
index d875f468b88c2200f6a5df4c1594c34c93607202..8e8661770df6b6dbc7531fa8fa7a94576a26ac56 100644
--- a/net/reporting/reporting_delivery_agent.cc
+++ b/net/reporting/reporting_delivery_agent.cc
@@ -16,6 +16,7 @@
#include "base/timer/timer.h"
#include "base/values.h"
#include "net/reporting/reporting_cache.h"
+#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_endpoint_manager.h"
#include "net/reporting/reporting_observer.h"
#include "net/reporting/reporting_report.h"
@@ -115,6 +116,9 @@ class ReportingDeliveryAgentImpl : public ReportingDeliveryAgent,
std::map<OriginGroup, std::vector<const ReportingReport*>>
origin_group_reports;
for (const ReportingReport* report : reports) {
+ url::Origin origin(report->url);
+ if (!delegate()->CanSendReport(origin))
+ continue;
OriginGroup origin_group(url::Origin(report->url), report->group);
origin_group_reports[origin_group].push_back(report);
}
@@ -186,6 +190,7 @@ class ReportingDeliveryAgentImpl : public ReportingDeliveryAgent,
const ReportingPolicy& policy() { return context_->policy(); }
base::TickClock* tick_clock() { return context_->tick_clock(); }
+ ReportingDelegate* delegate() { return context_->delegate(); }
ReportingCache* cache() { return context_->cache(); }
ReportingUploader* uploader() { return context_->uploader(); }
ReportingEndpointManager* endpoint_manager() {
« no previous file with comments | « net/reporting/reporting_delegate.cc ('k') | net/reporting/reporting_endpoint_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698