}
AwContents::~AwContents() {
- DCHECK(AwContents::FromWebContents(web_contents_.get()) == this);
+ DCHECK_EQ(this, AwContents::FromWebContents(web_contents_.get()));
DCHECK(!hardware_renderer_.get());
web_contents_->RemoveUserData(kAwContentsUserDataKey);
if (find_helper_.get())
AwContentsClientBridgeBase::Disassociate(web_contents_.get());
contents_client_bridge_.reset();
+ // Do not wait until the WebContents are deleted asynchronously to clear
+ // the delegate and stop sending callbacks.
+ web_contents_->SetDelegate(NULL);
+
// We do not delete AwContents immediately. Some applications try to delete
// Webview in ShouldOverrideUrlLoading callback, which is a sync IPC from
// Webkit.
ContentViewCore::FromWebContents(web_contents_.get());
if (cvc) {
cvc->PauseOrResumeGeolocation(paused);
- if (paused) {
- cvc->PauseVideo();
- }
}
}