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

Unified Diff: android_webview/native/aw_contents.cc

Issue 831523005: Remove most native WebContents references from Java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kept same error checking behavior for aw_contents.cc Created 5 years, 11 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: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 2a9a35f91f331150de1ec2da90f48a63b31fb181..6aeff3e9ee8fbf41bffc407fa36ddbc3a9aa6e2d 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -299,10 +299,14 @@ AwContents::~AwContents() {
}
}
-jlong AwContents::GetWebContents(JNIEnv* env, jobject obj) {
+base::android::ScopedJavaLocalRef<jobject>
+AwContents::GetWebContents(JNIEnv* env, jobject obj) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(web_contents_);
- return reinterpret_cast<intptr_t>(web_contents_.get());
+ if (!web_contents_)
+ return base::android::ScopedJavaLocalRef<jobject>();
+
+ return web_contents_->GetJavaWebContents();
}
void AwContents::Destroy(JNIEnv* env, jobject obj) {

Powered by Google App Engine
This is Rietveld 408576698