Index: components/reporting/core/browser/reporting_endpoint.h |
diff --git a/components/reporting/core/browser/reporting_endpoint.h b/components/reporting/core/browser/reporting_endpoint.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6e7bef97774b4797bb2d1bec6bd894832113b605 |
--- /dev/null |
+++ b/components/reporting/core/browser/reporting_endpoint.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_ENDPOINT_H_ |
+#define COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_ENDPOINT_H_ |
+ |
+#include <map> |
+ |
+#include "base/time/time.h" |
+#include "components/reporting/core/browser/reporting_client.h" |
+#include "components/reporting/core/common/reporting_export.h" |
+#include "net/base/backoff_entry.h" |
+#include "url/gurl.h" |
+ |
+namespace reporting { |
+ |
+// Section 2.1 |
+struct REPORTING_EXPORT ReportingEndpoint { |
+ public: |
+ using ClientMap = std::map<GURL, ReportingClient>; |
+ ReportingEndpoint(const GURL& url, |
+ const net::BackoffEntry::Policy& backoff_policy, |
+ base::TimeTicks now); |
+ ~ReportingEndpoint(); |
+ |
+ const GURL url; |
+ |
+ net::BackoffEntry backoff; |
+ base::TimeTicks last_used; |
+ |
+ // Map from client.origin to client. |
+ ClientMap clients; |
+ |
+ bool is_expired(base::TimeTicks now) const; |
+}; |
+ |
+} // namespace reporting |
+ |
+#endif // COMPONENTS_REPORTING_CORE_BROWSER_REPORTING_ENDPOINT_H_ |