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

Unified Diff: base/android/time_utils.cc

Issue 2472163003: [CustomTabs] Report the navigation start as absolute time (Closed)
Patch Set: Cache tick offset Created 4 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: base/android/time_utils.cc
diff --git a/base/android/time_utils.cc b/base/android/time_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b5a8ed13131b0bf4b017c6834c50b7dea79c11d4
--- /dev/null
+++ b/base/android/time_utils.cc
@@ -0,0 +1,24 @@
+// 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.
+
+#include "base/android/time_utils.h"
+
+#include <stdint.h>
+
+#include "base/time/time.h"
+#include "jni/TimeUtils_jni.h"
+
+namespace base {
+namespace android {
+
+static jlong GetTimeTicksNowUs(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
+ return (TimeTicks::Now() - TimeTicks()).InMicroseconds();
+}
+
+bool RegisterTimeUtils(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace android
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698