OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_ENDPOINT_H_ |
| 6 #define COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_ENDPOINT_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/time/time.h" |
| 11 #include "components/reporting/core/browser/reporting_client.h" |
| 12 #include "components/reporting/core/common/reporting_export.h" |
| 13 #include "net/base/backoff_entry.h" |
| 14 #include "url/gurl.h" |
| 15 |
| 16 namespace reporting { |
| 17 |
| 18 // Section 2.1 |
| 19 struct REPORTING_EXPORT ReportingEndpoint { |
| 20 public: |
| 21 using ClientMap = std::map<GURL, ReportingClient>; |
| 22 ReportingEndpoint(const GURL& url, |
| 23 const net::BackoffEntry::Policy& backoff_policy, |
| 24 base::TimeTicks now); |
| 25 ~ReportingEndpoint(); |
| 26 |
| 27 const GURL url; |
| 28 |
| 29 net::BackoffEntry backoff; |
| 30 base::TimeTicks last_used; |
| 31 |
| 32 // Map from client.origin to client. |
| 33 ClientMap clients; |
| 34 |
| 35 bool is_expired(base::TimeTicks now) const; |
| 36 }; |
| 37 |
| 38 } // namespace reporting |
| 39 |
| 40 #endif // COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_ENDPOINT_H_ |
OLD | NEW |