diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 19:38:30 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 19:38:30 +0000 |
commit | a3153c47d3b5308e7a55c0924a0baa1a6e02dcd0 (patch) | |
tree | b37c85641aef8df14c732e4b187444e040a11555 /base/win_util.h | |
parent | a93e517bfe25f11b2c4cc7d69f386424b93a2efa (diff) | |
download | chromium_src-a3153c47d3b5308e7a55c0924a0baa1a6e02dcd0.zip chromium_src-a3153c47d3b5308e7a55c0924a0baa1a6e02dcd0.tar.gz chromium_src-a3153c47d3b5308e7a55c0924a0baa1a6e02dcd0.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
Note: this CL was previously committed and reverted because it broke the sandbox integration module.
Review URL: http://codereview.chromium.org/21032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win_util.h')
-rw-r--r-- | base/win_util.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/base/win_util.h b/base/win_util.h index 317c332..f6ce1c2 100644 --- a/base/win_util.h +++ b/base/win_util.h @@ -10,6 +10,8 @@ #include <string> +#include "base/tracked.h" + namespace win_util { // NOTE: Keep these in order so callers can do things like @@ -102,6 +104,22 @@ std::wstring FormatMessage(unsigned messageid); // Uses the last Win32 error to generate a human readable message string. std::wstring FormatLastWin32Error(); +// These 2 methods are used to track HWND creation/destruction to investigate +// a mysterious crasher http://crbugs.com/4714 (crasher in on NCDestroy) that +// might be caused by a multiple delete of an HWND. +void NotifyHWNDCreation(const tracked_objects::Location& from_here, HWND hwnd); +void NotifyHWNDDestruction(const tracked_objects::Location& from_here, + HWND hwnd); + +#ifdef NDEBUG +#define TRACK_HWND_CREATION(hwnd) +#define TRACK_HWND_DESTRUCTION(hwnd) +#else +#define TRACK_HWND_CREATION(hwnd) win_util::NotifyHWNDCreation(FROM_HERE, hwnd) +#define TRACK_HWND_DESTRUCTION(hwnd) \ + win_util::NotifyHWNDDestruction(FROM_HERE, hwnd) +#endif + } // namespace win_util #endif // BASE_WIN_UTIL_H__ |