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

Side by Side Diff: chrome/browser/page_load_metrics/observers/android_page_load_metrics_observer.cc

Issue 2146753002: Android: Remove unneeded RegisterNatives() calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android: Don't require RegisterNatives if there are none Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/page_load_metrics/observers/android_page_load_metrics_o bserver.h" 5 #include "chrome/browser/page_load_metrics/observers/android_page_load_metrics_o bserver.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 14 matching lines...) Expand all
25 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 25 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
26 int64_t first_contentful_paint_ms = 26 int64_t first_contentful_paint_ms =
27 timing.first_contentful_paint->InMilliseconds(); 27 timing.first_contentful_paint->InMilliseconds();
28 base::android::ScopedJavaLocalRef<jobject> java_web_contents = 28 base::android::ScopedJavaLocalRef<jobject> java_web_contents =
29 web_contents_->GetJavaWebContents(); 29 web_contents_->GetJavaWebContents();
30 JNIEnv* env = base::android::AttachCurrentThread(); 30 JNIEnv* env = base::android::AttachCurrentThread();
31 Java_PageLoadMetrics_onFirstContentfulPaint( 31 Java_PageLoadMetrics_onFirstContentfulPaint(
32 env, java_web_contents.obj(), 32 env, java_web_contents.obj(),
33 static_cast<jlong>(first_contentful_paint_ms)); 33 static_cast<jlong>(first_contentful_paint_ms));
34 } 34 }
35
36 bool RegisterPageLoadMetricsBindings(JNIEnv* env) {
37 return RegisterNativesImpl(env);
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698