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

Unified Diff: chrome/browser/ui/android/connection_info_popup_android.cc

Issue 1288183004: jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some newlines for readability Created 5 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: chrome/browser/ui/android/connection_info_popup_android.cc
diff --git a/chrome/browser/ui/android/connection_info_popup_android.cc b/chrome/browser/ui/android/connection_info_popup_android.cc
index 3b7878e56249ce09685238752ce68b0bd68cce36..4be9e37327610745ab82de0cc4bf0fcf702017b6 100644
--- a/chrome/browser/ui/android/connection_info_popup_android.cc
+++ b/chrome/browser/ui/android/connection_info_popup_android.cc
@@ -30,13 +30,12 @@ using base::android::ScopedJavaLocalRef;
using content::CertStore;
using content::WebContents;
-static jobjectArray GetCertificateChain(JNIEnv* env,
- jobject obj,
- jobject java_web_contents) {
+static ScopedJavaLocalRef<jobjectArray>
+GetCertificateChain(JNIEnv* env, jobject obj, jobject java_web_contents) {
content::WebContents* web_contents =
content::WebContents::FromJavaWebContents(java_web_contents);
if (!web_contents)
- return NULL;
+ return ScopedJavaLocalRef<jobjectArray>();
int cert_id =
web_contents->GetController().GetVisibleEntry()->GetSSL().cert_id;
@@ -62,8 +61,7 @@ static jobjectArray GetCertificateChain(JNIEnv* env,
cert_chain.push_back(cert_bytes);
}
- // OK to release, JNI binding.
- return base::android::ToJavaArrayOfByteArray(env, cert_chain).Release();
+ return base::android::ToJavaArrayOfByteArray(env, cert_chain);
}
// static

Powered by Google App Engine
This is Rietveld 408576698