OLD | NEW |
(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_H_ |
| 6 #define NET_REPORTING_REPORTING_DELEGATE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "net/base/net_export.h" |
| 12 |
| 13 class GURL; |
| 14 |
| 15 namespace url { |
| 16 class Origin; |
| 17 } // namespace url |
| 18 |
| 19 namespace net { |
| 20 |
| 21 class NET_EXPORT ReportingDelegate { |
| 22 public: |
| 23 virtual ~ReportingDelegate(); |
| 24 |
| 25 // Checks whether |origin| is allowed to queue reports for future delivery. |
| 26 virtual bool CanQueueReport(const url::Origin& origin) const = 0; |
| 27 |
| 28 // Checks whether |origin| is allowed to receive reports, either in real time |
| 29 // or that were queued earlier. |
| 30 virtual bool CanSendReport(const url::Origin& origin) const = 0; |
| 31 |
| 32 // Checks whether |origin| can set |endpoint| to be used for future report |
| 33 // deliveries. |
| 34 virtual bool CanSetClient(const url::Origin& origin, |
| 35 const GURL& endpoint) const = 0; |
| 36 |
| 37 // Checks whether |origin| can use |endpoint| for a report delivery right now. |
| 38 virtual bool CanUseClient(const url::Origin& origin, |
| 39 const GURL& endpoint) const = 0; |
| 40 |
| 41 static std::unique_ptr<ReportingDelegate> Create(); |
| 42 }; |
| 43 |
| 44 } // namespace net |
| 45 |
| 46 #endif // NET_REPORTING_REPORTING_DELEGATE_H_ |
OLD | NEW |