summaryrefslogtreecommitdiffstats
path: root/ui/keyboard/keyboard_controller_proxy.cc
diff options
context:
space:
mode:
authorzverre@yandex-team.ru <zverre@yandex-team.ru@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-09 13:35:58 +0000
committerzverre@yandex-team.ru <zverre@yandex-team.ru@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-09 13:35:58 +0000
commit12a46832039868de4466ec286a3c5942be7b74da (patch)
tree3ce9f21f6ad7e081268f614510b94930f4ebaac0 /ui/keyboard/keyboard_controller_proxy.cc
parent7e1de9858cfe4dc01fb7881097258d458918b3d1 (diff)
downloadchromium_src-12a46832039868de4466ec286a3c5942be7b74da.zip
chromium_src-12a46832039868de4466ec286a3c5942be7b74da.tar.gz
chromium_src-12a46832039868de4466ec286a3c5942be7b74da.tar.bz2
We have a problem in the process on destroying WebContentsImpl because
each WebContentsObserver first NULLs its web_contents_ pointer and performs cleanup code after that. This could work if we guaranteed that every WebContentsObserver doesn't directly or indirectly affect any other WebContentsObserver. But actually WebContentsObservers can do anything and also affect each other. And if one WebContentsObserver already NULLed its web_contents_ pointer (e.g. ZoomController) other WebContentsObserver (e.g. InterstitialPageImpl) calls it (indirectly in this case) we have problems and result depends on ordering of WebContentsObservers in the list of observers. The solution splits that process into two phases. First we let each WebContentsObserver to perform their cleanup code and at that point they can freely call each other, we completely don't care about the ordering. We can call this phase as untrusted phase because we deal with some cleanup code that can do anything. After that we make second pass and NULL each web_contents_ pointer and this phase is trusted because we call only private implementation of WebContentsObserver that we definitely can trust. BUG=363564 Review URL: https://codereview.chromium.org/257153003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/keyboard/keyboard_controller_proxy.cc')
-rw-r--r--ui/keyboard/keyboard_controller_proxy.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc
index 4a0dd4f..2ade09d 100644
--- a/ui/keyboard/keyboard_controller_proxy.cc
+++ b/ui/keyboard/keyboard_controller_proxy.cc
@@ -68,7 +68,7 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate,
}
// Overridden from content::WebContentsObserver:
- virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE {
+ virtual void WebContentsDestroyed() OVERRIDE {
delete this;
}