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

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

Issue 2689953004: Reporting: Implement header parser. (Closed)
Patch Set: DISALLOW_COPY_AND_ASSIGN 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 unified diff | Download patch
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_DELEGATE_IMPL_H_
6 #define NET_REPORTING_REPORTING_DELEGATE_IMPL_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/time/tick_clock.h"
12 #include "base/values.h"
13 #include "net/base/net_export.h"
14 #include "net/reporting/reporting_delegate.h"
15 #include "url/gurl.h"
16
17 namespace net {
18
19 class ReportingCache;
20
21 class NET_EXPORT ReportingDelegateImpl : public ReportingDelegate {
22 public:
23 ReportingDelegateImpl(base::TickClock* clock, ReportingCache* cache);
shivanisha 2017/03/15 23:38:01 Since the constructor takes raw pointers, it needs
24
25 ~ReportingDelegateImpl() override;
26
27 void OnReportGenerated(const GURL& url,
28 const std::string& group,
29 const std::string& type,
30 std::unique_ptr<const base::Value> body) override;
31
32 void OnHeaderReceived(const GURL& url,
33 const std::string& json_value) override;
34
35 private:
36 // Processes a single endpoint's parsed value from the Report-To header(s).
37 // Creates, updates, or removes a client in the cache as needed.
38 //
shivanisha 2017/03/15 23:38:01 We can probably remove the empty lines between par
39 // |url| is the URL that the header came from.
40 //
41 // |value| is the parsed value.
42 void ProcessEndpoint(const GURL& url, const base::Value& value);
43
44 base::TickClock* clock_;
45 ReportingCache* cache_;
46
47 DISALLOW_COPY_AND_ASSIGN(ReportingDelegateImpl);
48 };
49
50 } // namespace net
51
52 #endif // NET_REPORTING_REPORTING_DELEGATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698