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

Unified Diff: base/time.h

Issue 7740070: Add metrics to measure time elapsed between form load and form submission with or without Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Serialize in all the right places Created 9 years, 4 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
Index: base/time.h
diff --git a/base/time.h b/base/time.h
index aa97f0ab4f422c807247e5c226b565fff21ac6c8..8590e993555380faec730a17dfd7f9d93fb3450a 100644
--- a/base/time.h
+++ b/base/time.h
@@ -60,9 +60,18 @@ class BASE_EXPORT TimeDelta {
static TimeDelta FromMilliseconds(int64 ms);
static TimeDelta FromMicroseconds(int64 us);
+ // Converts an integer value representing TimeDelta to a class. This is used
+ // when deserializing a |TimeDelta| structure, using a value known to be
+ // compatible. It is not provided as a constructor because the integer type
+ // may be unclear from the perspective of a caller.
+ static TimeDelta FromInternalValue(int64 delta) {
+ return TimeDelta(delta);
+ }
+
// Returns the internal numeric value of the TimeDelta object. Please don't
// use this and do arithmetic on it, as it is more error prone than using the
// provided operators.
+ // For serializing, use FromInternalValue to reconstitute.
int64 ToInternalValue() const {
return delta_;
}
@@ -487,7 +496,16 @@ class BASE_EXPORT TimeTicks {
return ticks_ == 0;
}
+ // Converts an integer value representing TimeTicks to a class. This is used
+ // when deserializing a |TimeTicks| structure, using a value known to be
+ // compatible. It is not provided as a constructor because the integer type
+ // may be unclear from the perspective of a caller.
+ static TimeTicks FromInternalValue(int64 ticks) {
+ return TimeTicks(ticks);
+ }
+
// Returns the internal numeric value of the TimeTicks object.
+ // For serializing, use FromInternalValue to reconstitute.
int64 ToInternalValue() const {
return ticks_;
}
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager.h » ('j') | chrome/browser/autofill/autofill_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698