Skip to content

Commit

Permalink
Add last error to crash reports when CreateWindowEx() failed.
Browse files Browse the repository at this point in the history
BUG=974713
TEST=compile
R=sunnyps@chromium.org

Change-Id: Icb9bbb7896fbd2994c0e1936b798e48eb7ab4f13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666612
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Auto-Submit: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670338}
  • Loading branch information
zhenyao authored and Commit Bot committed Jun 19, 2019
1 parent 85114e7 commit f1d6992
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/gl/child_window_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/debug/alias.h"
#include "base/memory/weak_ptr.h"
#include "base/win/wrapped_window_proc.h"
#include "ui/gfx/win/hwnd_util.h"
Expand Down Expand Up @@ -96,7 +97,11 @@ void CreateWindowsOnThread(const gfx::Size& size,
reinterpret_cast<wchar_t*>(g_window_class), L"",
WS_CHILDWINDOW | WS_DISABLED | WS_VISIBLE, 0, 0, size.width(),
size.height(), *parent_window, nullptr, nullptr, nullptr);
CHECK(window);
if (!window) {
logging::SystemErrorCode error = logging::GetLastSystemErrorCode();
base::debug::Alias(&error);
CHECK(false);
}
*child_window = window;
event->Signal();
}
Expand Down

0 comments on commit f1d6992

Please sign in to comment.