diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-03 23:20:59 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-03 23:20:59 +0000 |
commit | 0dea0a65b4cabd5910fb8747a0cb3935a27e6ec5 (patch) | |
tree | eaf31b951ecea22f0278d02b1f73edc7c99fc967 /webkit | |
parent | fb0a00f524b27ffe28a830cc44ce8135a41cdaad (diff) | |
download | chromium_src-0dea0a65b4cabd5910fb8747a0cb3935a27e6ec5.zip chromium_src-0dea0a65b4cabd5910fb8747a0cb3935a27e6ec5.tar.gz chromium_src-0dea0a65b4cabd5910fb8747a0cb3935a27e6ec5.tar.bz2 |
This CL adds macro used to track the creation and destruction
of HWNDs, in an attempt to detect potential double-delete.
A double-delete of a HWND might be responsible for the crasher
http://crbug.com/4714
Review URL: http://codereview.chromium.org/21018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.cc | 5 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index b1fc5ae..b024bac 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -13,6 +13,7 @@ #include "base/message_loop.h" #include "base/stats_counters.h" #include "base/string_util.h" +#include "base/win_util.h" #include "webkit/default_plugin/plugin_impl.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/webplugin.h" @@ -201,6 +202,7 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( WebPluginDelegateImpl::~WebPluginDelegateImpl() { if (::IsWindow(dummy_window_for_activation_)) { ::DestroyWindow(dummy_window_for_activation_); + TRACK_HWND_DESTRUCTION(dummy_window_for_activation_); } DestroyInstance(); @@ -447,6 +449,7 @@ bool WebPluginDelegateImpl::WindowedCreatePlugin() { 0, GetModuleHandle(NULL), 0); + TRACK_HWND_CREATION(windowed_handle_); if (windowed_handle_ == 0) return false; @@ -506,6 +509,7 @@ void WebPluginDelegateImpl::WindowedDestroyWindow() { } DestroyWindow(windowed_handle_); + TRACK_HWND_DESTRUCTION(windowed_handle_); windowed_handle_ = 0; } } @@ -658,6 +662,7 @@ bool WebPluginDelegateImpl::CreateDummyWindowForActivation() { 0, GetModuleHandle(NULL), 0); + TRACK_HWND_CREATION(dummy_window_for_activation_); if (dummy_window_for_activation_ == 0) return false; diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index c282699..845abf3 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -36,7 +36,7 @@ WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window, kWindowClassName, kWindowClassName, WS_POPUP, 0, 0, 0, 0, parent_window, NULL, GetModuleHandle(NULL), NULL); - + TRACK_HWND_CREATION(host->view_); win_util::SetWindowUserData(host->view_, host); host->webwidget_ = WebWidget::Create(delegate); @@ -58,6 +58,9 @@ LRESULT CALLBACK WebWidgetHost::WndProc(HWND hwnd, UINT message, WPARAM wparam, case WM_DESTROY: delete host; break; + case WM_NCDESTROY: + TRACK_HWND_DESTRUCTION(hwnd); + break; case WM_PAINT: { RECT rect; |