Ensure WebContentsObserver.destroy is called
commit28f5f23899a3131bcd63bf73707479d8fa082c20
authorjdduke <jdduke@chromium.org>
Wed, 4 Mar 2015 23:41:13 +0000 (4 15:41 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 4 Mar 2015 23:41:58 +0000 (4 23:41 +0000)
tree09e5202456ac235bb84924241b5da9c779404eab
parentb18d23f7330a6d01dd7dda7f5bc4713fdc470afe
Ensure WebContentsObserver.destroy is called

When a Java-based WebContents instance is destroyed, it may yet have
Java-based WebContentsObserver instances. Previously, these instances
would always see a destroy (formerly detach) call, as they each had
a native counterpart.

With the introduction of the proxy WebContentsObserver, destroy was not
always called, as the remaining observers were simply cleared from the
observer list. Explicitly call WebContentsObserver.destroy for these
dangling instances, ensuring proper cleanup.

BUG=464076

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

Cr-Commit-Position: refs/heads/master@{#319162}
content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java