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

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

Issue 2891133003: Reporting: Wire ReportingDelegate into ChromeNetworkDelegate (Closed)
Patch Set: Created 3 years, 7 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/reporting/reporting_context.cc ('k') | net/reporting/reporting_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_REPORTING_REPORTING_DELEGATE_H_ 5 #ifndef NET_REPORTING_REPORTING_DELEGATE_H_
6 #define NET_REPORTING_REPORTING_DELEGATE_H_ 6 #define NET_REPORTING_REPORTING_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "net/base/net_export.h" 11 #include "net/base/net_export.h"
12 12
13 class GURL; 13 class GURL;
14 14
15 namespace url { 15 namespace url {
16 class Origin; 16 class Origin;
17 } // namespace url 17 } // namespace url
18 18
19 namespace net { 19 namespace net {
20 20
21 class URLRequestContext;
22
21 class NET_EXPORT ReportingDelegate { 23 class NET_EXPORT ReportingDelegate {
22 public: 24 public:
23 virtual ~ReportingDelegate(); 25 virtual ~ReportingDelegate();
24 26
25 // Checks whether |origin| is allowed to queue reports for future delivery. 27 // Checks whether |origin| is allowed to queue reports for future delivery.
26 virtual bool CanQueueReport(const url::Origin& origin) const = 0; 28 virtual bool CanQueueReport(const url::Origin& origin) const = 0;
27 29
28 // Checks whether |origin| is allowed to receive reports, either in real time 30 // Checks whether |origin| is allowed to receive reports, either in real time
29 // or that were queued earlier. 31 // or that were queued earlier.
30 virtual bool CanSendReport(const url::Origin& origin) const = 0; 32 virtual bool CanSendReport(const url::Origin& origin) const = 0;
31 33
32 // Checks whether |origin| can set |endpoint| to be used for future report 34 // Checks whether |origin| can set |endpoint| to be used for future report
33 // deliveries. 35 // deliveries.
34 virtual bool CanSetClient(const url::Origin& origin, 36 virtual bool CanSetClient(const url::Origin& origin,
35 const GURL& endpoint) const = 0; 37 const GURL& endpoint) const = 0;
36 38
37 // Checks whether |origin| can use |endpoint| for a report delivery right now. 39 // Checks whether |origin| can use |endpoint| for a report delivery right now.
38 virtual bool CanUseClient(const url::Origin& origin, 40 virtual bool CanUseClient(const url::Origin& origin,
39 const GURL& endpoint) const = 0; 41 const GURL& endpoint) const = 0;
40 42
41 static std::unique_ptr<ReportingDelegate> Create(); 43 static std::unique_ptr<ReportingDelegate> Create(
44 URLRequestContext* request_context);
42 }; 45 };
43 46
44 } // namespace net 47 } // namespace net
45 48
46 #endif // NET_REPORTING_REPORTING_DELEGATE_H_ 49 #endif // NET_REPORTING_REPORTING_DELEGATE_H_
OLDNEW
« no previous file with comments | « net/reporting/reporting_context.cc ('k') | net/reporting/reporting_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698