Fix the crash when swap the WebContents with power save blocker.

BUG=383939

Review URL: https://codereview.chromium.org/331353008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282904 0039d316-1c4b-4281-b951-d872f2087c98
parent 2df37901
......@@ -272,6 +272,15 @@ void ContentViewCoreImpl::OnJavaContentViewCoreDestroyed(JNIEnv* env,
jobject obj) {
DCHECK(env->IsSameObject(java_ref_.get(env).obj(), obj));
java_ref_.reset();
// Java peer has gone, ContentViewCore is not functional and waits to
// be destroyed with WebContents.
// We need to reset WebContentsViewAndroid's reference, otherwise, there
// could have call in when swapping the WebContents,
// see http://crbug.com/383939 .
DCHECK(web_contents_);
static_cast<WebContentsViewAndroid*>(
static_cast<WebContentsImpl*>(web_contents_)->GetView())->
SetContentViewCore(NULL);
}
void ContentViewCoreImpl::InitWebContents() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment