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

Unified Diff: components/ukm/ukm_source.h

Issue 2722983006: Add UKM initial_url and session_id fields. (Closed)
Patch Set: fix android build take 2 Created 3 years, 10 months 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
« no previous file with comments | « components/ukm/ukm_service_unittest.cc ('k') | components/ukm/ukm_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_source.h
diff --git a/components/ukm/ukm_source.h b/components/ukm/ukm_source.h
index ce5ad57295f368df2acad67045382a9a28bdf190..6834746810143c3e846fd35ef11a9ac2752b8b41 100644
--- a/components/ukm/ukm_source.h
+++ b/components/ukm/ukm_source.h
@@ -25,16 +25,32 @@ class UkmSource {
int32_t id() const { return id_; }
void set_id(int32_t id) { id_ = id; }
+ const GURL& initial_url() const { return initial_url_; }
const GURL& url() const { return url_; }
+
+ // Sets the URL for this source. Should be invoked when a source is
+ // initialized.
void set_url(const GURL& url) { url_ = url; }
+ // Updates the URL for this source. Must be called after set_url. If a new URL
+ // is passed to UpdateUrl, the initial_url field is populated with the
+ // original URL provided to set_url, and the url field is updated with the
+ // value provided to this method.
+ void UpdateUrl(const GURL& url);
+
// Serializes the members of the class into the supplied proto.
void PopulateProto(Source* proto_source) const;
private:
int32_t id_;
+
+ // The final, canonical URL for this source.
GURL url_;
+ // The initial URL for this source. Only set if different from |url_| (i.e. if
+ // the URL changed over the lifetime of this source).
+ GURL initial_url_;
+
DISALLOW_COPY_AND_ASSIGN(UkmSource);
};
« no previous file with comments | « components/ukm/ukm_service_unittest.cc ('k') | components/ukm/ukm_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698