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

Unified Diff: net/reporting/reporting_service.cc

Issue 2751883003: Reporting: Implement serializer. (Closed)
Patch Set: rebase Created 3 years, 8 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_policy.cc ('k') | net/reporting/reporting_test_util.h » ('j') | 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 128c510b34f8a2e54869ae1cbc4d6d02c5f7233d..6d2b215ce5f1f2c30b43e3a89d92d780ea445011 100644
--- a/net/reporting/reporting_service.cc
+++ b/net/reporting/reporting_service.cc
@@ -25,7 +25,11 @@ namespace {
class ReportingServiceImpl : public ReportingService {
public:
ReportingServiceImpl(std::unique_ptr<ReportingContext> context)
- : context_(std::move(context)) {}
+ : context_(std::move(context)) {
+ // TODO(juliatuttle): This can be slow, so it might be better to expose it
+ // as a separate method and call it separately from constructing everything.
+ context_->Initialize();
+ }
~ReportingServiceImpl() override {}
@@ -33,12 +37,14 @@ class ReportingServiceImpl : public ReportingService {
const std::string& group,
const std::string& type,
std::unique_ptr<const base::Value> body) override {
+ DCHECK(context_->initialized());
context_->cache()->AddReport(url, group, type, std::move(body),
context_->tick_clock()->NowTicks(), 0);
}
void ProcessHeader(const GURL& url,
const std::string& header_value) override {
+ DCHECK(context_->initialized());
ReportingHeaderParser::ParseHeader(context_.get(), url, header_value);
}
« no previous file with comments | « net/reporting/reporting_policy.cc ('k') | net/reporting/reporting_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698