juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 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 | |
Julia Tuttle | ec467a5f | 2018-02-22 20:22:45 | [diff] [blame^] | 8 | #include <memory> |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 9 | |
| 10 | #include "base/macros.h" |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 11 | #include "net/base/net_export.h" |
| 12 | |
| 13 | class GURL; |
| 14 | |
Julia Tuttle | ec467a5f | 2018-02-22 20:22:45 | [diff] [blame^] | 15 | namespace base { |
| 16 | class Value; |
| 17 | } // namespace base |
| 18 | |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 19 | namespace net { |
| 20 | |
juliatuttle | ee4b55e | 2017-04-07 17:09:45 | [diff] [blame] | 21 | class ReportingContext; |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 22 | |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 23 | class NET_EXPORT ReportingHeaderParser { |
| 24 | public: |
juliatuttle | 667c0bb | 2017-07-06 15:17:13 | [diff] [blame] | 25 | static void RecordHeaderDiscardedForNoReportingService(); |
| 26 | static void RecordHeaderDiscardedForInvalidSSLInfo(); |
| 27 | static void RecordHeaderDiscardedForCertStatusError(); |
Julia Tuttle | ec467a5f | 2018-02-22 20:22:45 | [diff] [blame^] | 28 | static void RecordHeaderDiscardedForInvalidJson(); |
juliatuttle | 667c0bb | 2017-07-06 15:17:13 | [diff] [blame] | 29 | |
juliatuttle | ee4b55e | 2017-04-07 17:09:45 | [diff] [blame] | 30 | static void ParseHeader(ReportingContext* context, |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 31 | const GURL& url, |
Julia Tuttle | ec467a5f | 2018-02-22 20:22:45 | [diff] [blame^] | 32 | std::unique_ptr<base::Value> value); |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 33 | |
| 34 | private: |
juliatuttle | 1690bc6 | 2017-03-29 17:16:02 | [diff] [blame] | 35 | DISALLOW_IMPLICIT_CONSTRUCTORS(ReportingHeaderParser); |
| 36 | }; |
| 37 | |
| 38 | } // namespace net |
| 39 | |
| 40 | #endif // NET_REPORTING_REPORTING_HEADER_PARSER_H_ |