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

Unified Diff: net/reporting/reporting_header_parser.cc

Issue 2751103002: Reporting: Wrap existing classes in context. (Closed)
Patch Set: Move before BrowsingDataRemover, GarbageCollector, and Serializer CLs. Created 3 years, 9 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
Index: net/reporting/reporting_header_parser.cc
diff --git a/net/reporting/reporting_header_parser.cc b/net/reporting/reporting_header_parser.cc
index 2bf6ddc368d4241688eea7aff334da93bbb6ded6..8dbcb8e20abf5f31cae43f12a2f71fbd4017c03c 100644
--- a/net/reporting/reporting_header_parser.cc
+++ b/net/reporting/reporting_header_parser.cc
@@ -8,11 +8,11 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
+#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "base/values.h"
#include "net/reporting/reporting_cache.h"
-#include "url/gurl.h"
-#include "url/origin.h"
+#include "net/reporting/reporting_context.h"
namespace net {
@@ -27,8 +27,7 @@ const char kMaxAgeKey[] = "max-age";
} // namespace
// static
-void ReportingHeaderParser::ParseHeader(ReportingCache* cache,
- base::TimeTicks now,
+void ReportingHeaderParser::ParseHeader(ReportingContext* context,
const GURL& url,
const std::string& json_value) {
DCHECK(url.SchemeIsCryptographic());
@@ -42,6 +41,8 @@ void ReportingHeaderParser::ParseHeader(ReportingCache* cache,
bool is_list = value->GetAsList(&list);
DCHECK(is_list);
+ ReportingCache* cache = context->cache();
+ base::TimeTicks now = context->tick_clock()->NowTicks();
for (size_t i = 0; i < list->GetSize(); i++) {
const base::Value* endpoint = nullptr;
bool got_endpoint = list->Get(i, &endpoint);

Powered by Google App Engine
This is Rietveld 408576698