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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java

Issue 981703002: Ensure WebContentsObserver.destroy is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 5 years, 10 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 | « content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java
index fdae8f3a3afe3a0c9de2649107d28757a127c843..730379a49f4534b3e1c0ebc1be782735694f1c3f 100644
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java
@@ -224,7 +224,14 @@ class WebContentsObserverProxy extends WebContentsObserver {
// Java-based WebContents) are quite different, so we explicitly avoid
// calling it here.
ThreadUtils.assertOnUiThread();
+ for (mObserversIterator.rewind(); mObserversIterator.hasNext();) {
+ mObserversIterator.next().destroy();
+ }
+ // All observer destroy() implementations should result in their removal
+ // from the proxy.
+ assert mObservers.isEmpty();
mObservers.clear();
+
if (mNativeWebContentsObserverProxy != 0) {
nativeDestroy(mNativeWebContentsObserverProxy);
mNativeWebContentsObserverProxy = 0;
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698