Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: net/reporting/reporting_report.h

Issue 2249213002: [OBSOLETE] Reporting: Initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/reporting/reporting_report.h
diff --git a/net/reporting/reporting_report.h b/net/reporting/reporting_report.h
new file mode 100644
index 0000000000000000000000000000000000000000..7bea214190586e664f77c7841c71041f6bfea95a
--- /dev/null
+++ b/net/reporting/reporting_report.h
@@ -0,0 +1,42 @@
+// 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 NET_REPORTING_REPORTING_REPORT_H_
+#define NET_REPORTING_REPORTING_REPORT_H_
+
+#include "base/time/time.h"
+#include "base/values.h"
+#include "url/gurl.h"
+
+namespace net {
+
+// A report queued by another component to be delivered by Reporting.
+struct ReportingReport {
Ryan Sleevi 2017/01/03 21:28:13 From a design standpoint, this feels more like a c
Julia Tuttle 2017/01/25 20:27:46 My gut feeling is that it's a struct, but I'm maki
+ public:
+ ReportingReport();
+ ~ReportingReport();
Ryan Sleevi 2017/01/03 21:28:13 Rule of three applies here - in general, if you pr
Julia Tuttle 2017/01/25 20:27:46 Done.
+
+ std::string ToString() const;
Ryan Sleevi 2017/01/03 21:28:13 From reading the header: Why does this exist? What
Julia Tuttle 2017/01/25 20:27:46 It was for testing, but I'm gonna remove it for no
+
+ std::unique_ptr<base::Value> body;
Ryan Sleevi 2017/01/03 21:28:13 What is this? Why is it a base::Value versus anoth
Julia Tuttle 2017/01/25 20:27:45 It's the report body, which is any JSON.
+ // URL of content that triggered report.
Ryan Sleevi 2017/01/03 21:28:13 nelines between 22-23
Julia Tuttle 2017/01/25 20:27:46 Done.
+ GURL url;
+ // Origin of content that triggered report. Should be url.GetOrigin(), but the
+ // spec doesn't guarantee this, and allows callers to provide URL and origin
+ // separately, so they are separate fields for now.
Ryan Sleevi 2017/01/03 21:28:13 Line break between 24-25 and 29-30 As comments go
Julia Tuttle 2017/01/25 20:27:46 There is a bug filed, at https://github.com/WICG/r
+ GURL origin;
+ std::string group;
+ std::string type;
+
+ // Creation timestamp.
+ base::TimeTicks timestamp;
Ryan Sleevi 2017/01/03 21:28:13 naming: "timestamp" is self-describing without add
Julia Tuttle 2017/01/25 20:27:45 Renamed to "queued".
+ // Number of delivery attempts made.
+ int attempts;
Ryan Sleevi 2017/01/03 21:28:13 size_t for counts - https://chromium.googlesource.
Julia Tuttle 2017/01/25 20:27:45 Done.
+ // Whether this report is currently part of a pending delivery attempt.
+ bool pending;
Ryan Sleevi 2017/01/03 21:28:13 This feels like an interface bleed - why should th
Julia Tuttle 2017/01/25 20:27:46 Obsolete; I'm making Report an inner, private clas
+};
+
+} // namespace net
+
+#endif // NET_REPORTING_REPORTING_REPORT_H_

Powered by Google App Engine
This is Rietveld 408576698