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

Unified Diff: net/reporting/reporting_header_parser.h

Issue 2689953004: Reporting: Implement header parser. (Closed)
Patch Set: Extract header parser and make static 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
« no previous file with comments | « net/BUILD.gn ('k') | net/reporting/reporting_header_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_header_parser.h
diff --git a/net/reporting/reporting_header_parser.h b/net/reporting/reporting_header_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..647ff41397c553617419f79f3d7817fc413116ad
--- /dev/null
+++ b/net/reporting/reporting_header_parser.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_REPORTING_REPORTING_HEADER_PARSER_H_
+#define NET_REPORTING_REPORTING_HEADER_PARSER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "net/base/net_export.h"
+#include "url/gurl.h"
+
+namespace base {
+class Value;
+} // namespace base
+
+namespace net {
+
+class ReportingCache;
+
+class NET_EXPORT ReportingHeaderParser {
shivanisha 2017/03/15 23:38:01 class documentation.
Julia Tuttle 2017/03/21 18:52:33 Done.
+ public:
+ static void ParseHeader(ReportingCache* cache,
shivanisha 2017/03/15 23:38:01 API documentation
Julia Tuttle 2017/03/21 18:52:33 Done.
+ base::TimeTicks now,
+ const GURL& url,
+ const std::string& json_value);
+
+ private:
+ // Processes a single endpoint's parsed value from the Report-To header(s).
+ // Creates, updates, or removes a client in the cache as needed.
+ //
+ // |url| is the URL that the header came from.
+ //
+ // |value| is the parsed value.
+ static void ProcessEndpoint(ReportingCache* cache,
+ base::TimeTicks now,
shivanisha 2017/03/15 23:38:01 How is this function different from ReportingDeleg
Julia Tuttle 2017/03/21 18:52:33 It's similar; I just chose to break out the header
+ const GURL& url,
+ const base::Value& value);
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ReportingHeaderParser);
+};
+
+} // namespace net
+
+#endif // NET_REPORTING_REPORTING_HEADER_PARSER_H_
« no previous file with comments | « net/BUILD.gn ('k') | net/reporting/reporting_header_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698