summaryrefslogtreecommitdiffstats
path: root/ui/base/win/window_impl.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 22:00:16 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 22:00:16 +0000
commitbaa659f8dccc5df9e447f161cddcad63e001e26e (patch)
tree57a7b5ebae12cd3544d60ebecab6f2352c97869c /ui/base/win/window_impl.cc
parent89089dc5699b37edc03c5a5ce8c27445dc9b2b28 (diff)
downloadchromium_src-baa659f8dccc5df9e447f161cddcad63e001e26e.zip
chromium_src-baa659f8dccc5df9e447f161cddcad63e001e26e.tar.gz
chromium_src-baa659f8dccc5df9e447f161cddcad63e001e26e.tar.bz2
Adds more debugging code to WindowImpl. Crash data seems to indicate
the wndproc isn't getting called at all for this window. I'm curious to see if our windowproc is no longer registered. I'm also changing the HINSTNACE argument to RegisterClassEx to actually pass in a module. BUG=121084 TEST=none R=cpu@chromium.org Review URL: https://chromiumcodereview.appspot.com/10051005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/win/window_impl.cc')
-rw-r--r--ui/base/win/window_impl.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/ui/base/win/window_impl.cc b/ui/base/win/window_impl.cc
index 648f2b6..8221253 100644
--- a/ui/base/win/window_impl.cc
+++ b/ui/base/win/window_impl.cc
@@ -188,20 +188,29 @@ void WindowImpl::Init(HWND parent, const gfx::Rect& bounds) {
HWND hwnd = CreateWindowEx(window_ex_style_, name.c_str(), NULL,
window_style_, x, y, width, height,
parent, NULL, NULL, this);
- if (!hwnd_) {
+ if (!hwnd_ && GetLastError() == 0) {
base::debug::Alias(&destroyed);
base::debug::Alias(&hwnd);
- DWORD last_error = GetLastError();
- base::debug::Alias(&last_error);
bool got_create = got_create_;
base::debug::Alias(&got_create);
bool got_valid_hwnd = got_valid_hwnd_;
base::debug::Alias(&got_valid_hwnd);
+ WNDCLASSEX class_info;
+ memset(&class_info, 0, sizeof(WNDCLASSEX));
+ class_info.cbSize = sizeof(WNDCLASSEX);
+ BOOL got_class = GetClassInfoEx(
+ GetModuleHandle(NULL), name.c_str(), &class_info);
+ base::debug::Alias(&got_class);
+ bool procs_match = got_class && class_info.lpfnWndProc ==
+ base::win::WrappedWindowProc<&WindowImpl::WndProc>;
+ base::debug::Alias(&procs_match);
CHECK(false);
}
if (!destroyed)
destroyed_ = NULL;
+ CheckWindowCreated(hwnd_);
+
// The window procedure should have set the data for us.
CHECK_EQ(this, ui::GetWindowUserData(hwnd));
}
@@ -261,7 +270,7 @@ std::wstring WindowImpl::GetWindowClassName() {
base::win::WrappedWindowProc<&WindowImpl::WndProc>,
0,
0,
- NULL,
+ GetModuleHandle(NULL),
icon,
NULL,
reinterpret_cast<HBRUSH>(background + 1),