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

Unified Diff: components/domain_reliability/beacon.h

Issue 1180223006: Domain Reliability: Simplify configs and reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix memory leak in unittests Created 5 years, 1 month 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: components/domain_reliability/beacon.h
diff --git a/components/domain_reliability/beacon.h b/components/domain_reliability/beacon.h
index aba7bf9503b15b49e86d7c32a196d00b8c3c941e..83e3e125a9d0478d3a7beb43cc04bf3e662bd700 100644
--- a/components/domain_reliability/beacon.h
+++ b/components/domain_reliability/beacon.h
@@ -7,8 +7,10 @@
#include <string>
+#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
#include "components/domain_reliability/domain_reliability_export.h"
+#include "url/gurl.h"
namespace base {
class Value;
@@ -24,13 +26,21 @@ struct DOMAIN_RELIABILITY_EXPORT DomainReliabilityBeacon {
// Converts the Beacon to JSON format for uploading. Calculates the age
// relative to an upload time of |upload_time|.
- base::Value* ToValue(base::TimeTicks upload_time,
- base::TimeTicks last_network_change_time) const;
+ //
+ // |last_network_change_time| is used to determine which beacons are
+ // labeled as from a previous network connection.
+ // |collector_url| is compared to the URLs in the beacons to determine which
+ // are being uploaded to a same-origin collector.
+ // |path_prefixes| are used to include only a known-safe (not PII) prefix of
+ // URLs when uploading to a non-same-origin collector.
+ scoped_ptr<base::Value> ToValue(
+ base::TimeTicks upload_time,
+ base::TimeTicks last_network_change_time,
+ const GURL& collector_url,
+ const ScopedVector<std::string>& path_prefixes) const;
// The URL that the beacon is reporting on, if included.
- std::string url;
- // The domain that the beacon is reporting on, if included.
- std::string domain;
+ GURL url;
// The resource name that the beacon is reporting on, if included.
std::string resource;
// Status string (e.g. "ok", "dns.nxdomain", "http.403").
« no previous file with comments | « components/domain_reliability/baked_in_configs/www_youtube_com.json ('k') | components/domain_reliability/beacon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698