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

Unified Diff: chrome/browser/android/web_contents_factory.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: Nontrivial cases 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/android/web_contents_factory.cc
diff --git a/chrome/browser/android/web_contents_factory.cc b/chrome/browser/android/web_contents_factory.cc
index 3f3e086d3d63c51d6a2e18201a8afd46dd07e4f5..5df6ca82a788a7fe9f335a3c80a6c4828f2fbf2a 100644
--- a/chrome/browser/android/web_contents_factory.cc
+++ b/chrome/browser/android/web_contents_factory.cc
@@ -12,15 +12,18 @@
#include "content/public/browser/web_contents.h"
#include "jni/WebContentsFactory_jni.h"
-static jobject CreateWebContents(
- JNIEnv* env, jclass clazz, jboolean incognito, jboolean initially_hidden) {
+static ScopedJavaLocalRef<jobject> CreateWebContents(
+ JNIEnv* env,
+ jclass clazz,
+ jboolean incognito,
+ jboolean initially_hidden) {
Profile* profile = g_browser_process->profile_manager()->GetLastUsedProfile();
if (incognito)
profile = profile->GetOffTheRecordProfile();
content::WebContents::CreateParams params(profile);
params.initially_hidden = static_cast<bool>(initially_hidden);
- return content::WebContents::Create(params)->GetJavaWebContents().Release();
+ return content::WebContents::Create(params)->GetJavaWebContents();
}
bool RegisterWebContentsFactory(JNIEnv* env) {

Powered by Google App Engine
This is Rietveld 408576698