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

Side by Side Diff: net/reporting/reporting_header_parser.h

Issue 2689953004: Reporting: Implement header parser. (Closed)
Patch Set: Make requested changes. 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 unified diff | Download patch
« no previous file with comments | « net/BUILD.gn ('k') | net/reporting/reporting_header_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_REPORTING_REPORTING_HEADER_PARSER_H_
6 #define NET_REPORTING_REPORTING_HEADER_PARSER_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/time/time.h"
12 #include "net/base/net_export.h"
13
14 class GURL;
15
16 namespace base {
17 class Value;
18 } // namespace base
19
20 namespace net {
21
22 class ReportingCache;
23
24 // Parses Report-To headers and writes the endpoint configurations to the
25 // ReportingCache.
26 class NET_EXPORT ReportingHeaderParser {
27 public:
28 // Parses the normalized Report-To header value |json_value| sent in response
29 // to a request for |url| at |now|, and applies the endpoint configurations
30 // to |cache|.
31 static void ParseHeader(ReportingCache* cache,
32 base::TimeTicks now,
33 const GURL& url,
34 const std::string& json_value);
35
36 private:
37 // Processes a single endpoint's parsed value from the Report-To header(s).
38 // Creates, updates, or removes a client in the cache as needed.
39 //
40 // |url| is the URL that the header came from.
41 //
42 // |value| is the parsed value.
43 static void ProcessEndpoint(ReportingCache* cache,
44 base::TimeTicks now,
45 const GURL& url,
46 const base::Value& value);
47
48 DISALLOW_IMPLICIT_CONSTRUCTORS(ReportingHeaderParser);
49 };
50
51 } // namespace net
52
53 #endif // NET_REPORTING_REPORTING_HEADER_PARSER_H_
OLDNEW
« 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