| Index: content/browser/android/web_contents_observer_android.cc
|
| diff --git a/content/browser/android/web_contents_observer_android.cc b/content/browser/android/web_contents_observer_android.cc
|
| index 235041be67422e2924b9bf106d613693048a5df0..03f1af66e5d24ba37217bddeb27b284293924b2b 100644
|
| --- a/content/browser/android/web_contents_observer_android.cc
|
| +++ b/content/browser/android/web_contents_observer_android.cc
|
| @@ -28,8 +28,10 @@ namespace content {
|
| WebContentsObserverAndroid::WebContentsObserverAndroid(
|
| JNIEnv* env,
|
| jobject obj,
|
| + ContentViewCore* content_view_core,
|
| WebContents* web_contents)
|
| : WebContentsObserver(web_contents),
|
| + content_view_core_(content_view_core),
|
| weak_java_observer_(env, obj){
|
| }
|
|
|
| @@ -40,7 +42,7 @@ jlong Init(JNIEnv* env, jobject obj, jlong native_content_view_core) {
|
| ContentViewCore* content_view_core =
|
| reinterpret_cast<ContentViewCore*>(native_content_view_core);
|
| WebContentsObserverAndroid* native_observer = new WebContentsObserverAndroid(
|
| - env, obj, content_view_core->GetWebContents());
|
| + env, obj, content_view_core, content_view_core->GetWebContents());
|
| return reinterpret_cast<intptr_t>(native_observer);
|
| }
|
|
|
| @@ -50,6 +52,8 @@ void WebContentsObserverAndroid::Destroy(JNIEnv* env, jobject obj) {
|
|
|
| void WebContentsObserverAndroid::WebContentsDestroyed(
|
| WebContents* web_contents) {
|
| + content_view_core_->OnDetachedFromWebContents(web_contents);
|
| +
|
| JNIEnv* env = AttachCurrentThread();
|
| ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env));
|
| if (obj.is_null()) {
|
|
|