summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 20:42:04 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 20:42:04 +0000
commit1d14f58b753c59924cef2f5bb4a0f1cb88db07d5 (patch)
treea0bdee96486c4f0cbe4bb8e23ed5b890c8131587 /base
parentfd346b76799059213d36109a799bc029f3a2ed1d (diff)
downloadchromium_src-1d14f58b753c59924cef2f5bb4a0f1cb88db07d5.zip
chromium_src-1d14f58b753c59924cef2f5bb4a0f1cb88db07d5.tar.gz
chromium_src-1d14f58b753c59924cef2f5bb4a0f1cb88db07d5.tar.bz2
Add metrics to measure time elapsed between form load and form submission with or without Autofill.
BUG=none TEST=unit_tests --gtest_filter=AutofillMetricsTest.* Review URL: http://codereview.chromium.org/7740070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/time.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/base/time.h b/base/time.h
index aa97f0a..8590e99 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_;
}