Chromium Code Reviews| Index: net/reporting/reporting_client.h |
| diff --git a/net/reporting/reporting_client.h b/net/reporting/reporting_client.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1e68006f5340740806a28c5af7d1b9544ae2bac9 |
| --- /dev/null |
| +++ b/net/reporting/reporting_client.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2017 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 NET_REPORTING_REPORTING_CLIENT_H_ |
| +#define NET_REPORTING_REPORTING_CLIENT_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/time/time.h" |
| +#include "net/base/net_export.h" |
| +#include "url/gurl.h" |
| +#include "url/origin.h" |
| + |
| +namespace net { |
| + |
| +// The configuration by an origin to use an endpoint for report delivery. |
| +struct NET_EXPORT ReportingClient { |
| + public: |
| + 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.
|
| + |
| + 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.
|
| + ReportingClient(const url::Origin& origin, |
| + const GURL& endpoint, |
| + Subdomains subdomains, |
| + const std::string& group, |
| + base::TimeTicks expires); |
| + ~ReportingClient(); |
| + |
| + // The origin from which reports will be delivered. |
| + url::Origin origin; |
| + |
| + // The endpoint to which reports may be delivered. (Origins may configure |
| + // many.) |
| + GURL endpoint; |
| + |
| + // Whether subdomains of the host of |origin| should also be handled by this |
| + // client. |
| + Subdomains subdomains; |
|
jkarlin
2017/03/17 15:07:03
Needs a default value.
Julia Tuttle
2017/03/21 18:41:02
Done.
|
| + |
| + // The endpoint group to which this client belongs. |
| + std::string group; |
| + |
| + // When this client's max-age has expired. |
| + base::TimeTicks expires; |
| + |
| + // 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.
|
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // NET_REPORTING_REPORTING_CLIENT_H_ |