Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser.webcontents; | 5 package org.chromium.content.browser.webcontents; |
| 6 | 6 |
| 7 import org.chromium.base.ObserverList; | 7 import org.chromium.base.ObserverList; |
| 8 import org.chromium.base.ObserverList.RewindableIterator; | 8 import org.chromium.base.ObserverList.RewindableIterator; |
| 9 import org.chromium.base.ThreadUtils; | 9 import org.chromium.base.ThreadUtils; |
| 10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 public void destroy() { | 241 public void destroy() { |
| 242 // Super destruction semantics (removing the observer from the | 242 // Super destruction semantics (removing the observer from the |
| 243 // Java-based WebContents) are quite different, so we explicitly avoid | 243 // Java-based WebContents) are quite different, so we explicitly avoid |
| 244 // calling it here. | 244 // calling it here. |
| 245 ThreadUtils.assertOnUiThread(); | 245 ThreadUtils.assertOnUiThread(); |
| 246 for (mObserversIterator.rewind(); mObserversIterator.hasNext();) { | 246 for (mObserversIterator.rewind(); mObserversIterator.hasNext();) { |
| 247 mObserversIterator.next().destroy(); | 247 mObserversIterator.next().destroy(); |
| 248 } | 248 } |
| 249 // All observer destroy() implementations should result in their removal | 249 // All observer destroy() implementations should result in their removal |
| 250 // from the proxy. | 250 // from the proxy. |
| 251 assert mObservers.isEmpty(); | 251 // TODO(crbug.com/667437) |
| 252 // assert mObservers.isEmpty(); | |
|
boliu
2016/11/23 17:20:22
also is this being fixed?
agrieve
2016/11/23 17:55:39
Looks like there's action on the bug.
| |
| 252 mObservers.clear(); | 253 mObservers.clear(); |
| 253 | 254 |
| 254 if (mNativeWebContentsObserverProxy != 0) { | 255 if (mNativeWebContentsObserverProxy != 0) { |
| 255 nativeDestroy(mNativeWebContentsObserverProxy); | 256 nativeDestroy(mNativeWebContentsObserverProxy); |
| 256 mNativeWebContentsObserverProxy = 0; | 257 mNativeWebContentsObserverProxy = 0; |
| 257 } | 258 } |
| 258 } | 259 } |
| 259 | 260 |
| 260 private native long nativeInit(WebContentsImpl webContents); | 261 private native long nativeInit(WebContentsImpl webContents); |
| 261 private native void nativeDestroy(long nativeWebContentsObserverProxy); | 262 private native void nativeDestroy(long nativeWebContentsObserverProxy); |
| 262 } | 263 } |
| OLD | NEW |