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_CLIENT_H_ | |
6 #define NET_REPORTING_REPORTING_CLIENT_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/time/time.h" | |
11 #include "net/base/net_export.h" | |
12 #include "url/gurl.h" | |
13 #include "url/origin.h" | |
14 | |
15 namespace net { | |
16 | |
17 // The configuration by an origin to use an endpoint for report delivery. | |
18 struct NET_EXPORT ReportingClient { | |
19 public: | |
20 enum Subdomains { EXCLUDE_SUBDOMAINS = 0, INCLUDE_SUBDOMAINS = 1 }; | |
jkarlin
2017/03/17 15:07:03
Prefer 'enum class'. Then you can rename the value
Julia Tuttle
2017/03/21 18:41:03
...huh, I had no idea that was a thing. Cool.
| |
21 | |
22 ReportingClient(); | |
jkarlin
2017/03/17 15:07:03
Any reason to allow the empty constructor?
Julia Tuttle
2017/03/21 18:41:02
Hm, not anymore.
| |
23 ReportingClient(const url::Origin& origin, | |
24 const GURL& endpoint, | |
25 Subdomains subdomains, | |
26 const std::string& group, | |
27 base::TimeTicks expires); | |
28 ~ReportingClient(); | |
29 | |
30 // The origin from which reports will be delivered. | |
31 url::Origin origin; | |
32 | |
33 // The endpoint to which reports may be delivered. (Origins may configure | |
34 // many.) | |
35 GURL endpoint; | |
36 | |
37 // Whether subdomains of the host of |origin| should also be handled by this | |
38 // client. | |
39 Subdomains subdomains; | |
jkarlin
2017/03/17 15:07:03
Needs a default value.
Julia Tuttle
2017/03/21 18:41:02
Done.
| |
40 | |
41 // The endpoint group to which this client belongs. | |
42 std::string group; | |
43 | |
44 // When this client's max-age has expired. | |
45 base::TimeTicks expires; | |
46 | |
47 // Copy and assign allowed. | |
jkarlin
2017/03/17 15:07:03
Probably best to declare the copy and assignment o
Julia Tuttle
2017/03/21 18:41:03
Actually I don't think I need them anymore.
| |
48 }; | |
49 | |
50 } // namespace net | |
51 | |
52 #endif // NET_REPORTING_REPORTING_CLIENT_H_ | |
OLD | NEW |