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_CORE_BROWSER_REPORTING_REPORTING_CLIENT_H_ |
| 6 #define COMPONENTS_CORE_BROWSER_REPORTING_REPORTING_CLIENT_H_ |
| 7 |
| 8 #include "base/time/time.h" |
| 9 #include "url/gurl.h" |
| 10 |
| 11 namespace reporting { |
| 12 |
| 13 // Section 2.2 |
| 14 struct ReportingClient { |
| 15 public: |
| 16 ReportingClient(const GURL& origin, |
| 17 bool subdomains, |
| 18 const std::string& group, |
| 19 base::TimeDelta ttl, |
| 20 base::TimeTicks creation); |
| 21 |
| 22 GURL origin; |
| 23 bool subdomains; |
| 24 std::string group; |
| 25 base::TimeDelta ttl; |
| 26 base::TimeTicks creation; |
| 27 |
| 28 bool is_expired(base::TimeTicks now) const { return creation + ttl < now; } |
| 29 }; |
| 30 |
| 31 } // namespace reporting |
| 32 |
| 33 #endif // COMPONENTS_CORE_BROWSER_REPORTING_REPORTING_CLIENT_H_ |
OLD | NEW |