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

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: Rebased 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
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | android_webview/native/aw_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 64cd9a97e2cd90a849c6f7d0039a87ee3764b8d6..3638e4ec346bfe3918517a3f8d63c8ed552d40ad 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -283,10 +283,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) {
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | android_webview/native/aw_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698