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

Unified Diff: net/reporting/reporting_service.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_header_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_service.cc
diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_service.cc
index 1da91004b540765670dcd0b19e37441bafd6c319..4c85eb07305ac6467a7d5fd8f03770aa242deeb7 100644
--- a/net/reporting/reporting_service.cc
+++ b/net/reporting/reporting_service.cc
@@ -15,6 +15,7 @@
#include "net/reporting/reporting_browsing_data_remover.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_context.h"
+#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_header_parser.h"
#include "net/reporting/reporting_persister.h"
#include "url/gurl.h"
@@ -34,6 +35,9 @@ class ReportingServiceImpl : public ReportingService {
const std::string& group,
const std::string& type,
std::unique_ptr<const base::Value> body) override {
+ if (!context_->delegate()->CanQueueReport(url::Origin(url)))
+ return;
+
context_->cache()->AddReport(url, group, type, std::move(body),
context_->tick_clock()->NowTicks(), 0);
}
« no previous file with comments | « net/reporting/reporting_header_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698