summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 19:06:33 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-19 19:06:33 +0000
commita62d09f5aa351a2d395a1ba74c53ae29bee712e8 (patch)
tree6b3a17895aa054067e559fb370e97aed2479ccca /chrome
parent24f49bd3da572b7c94a5b66b60e49a0685a9912c (diff)
downloadchromium_src-a62d09f5aa351a2d395a1ba74c53ae29bee712e8.zip
chromium_src-a62d09f5aa351a2d395a1ba74c53ae29bee712e8.tar.gz
chromium_src-a62d09f5aa351a2d395a1ba74c53ae29bee712e8.tar.bz2
Centralizes checking for non-null return from CreateWindow.
BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/6880034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/process_singleton_win.cc3
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc5
-rw-r--r--chrome/browser/ui/views/status_icons/status_tray_win.cc1
3 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index 2a2975c..b21610e 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -194,8 +194,7 @@ bool ProcessSingleton::Create() {
window_ = CreateWindow(chrome::kMessageWindowClass,
user_data_dir.value().c_str(),
0, 0, 0, 0, 0, HWND_MESSAGE, 0, hinst, 0);
- DCHECK(window_);
-
+ ui::CheckWindowCreated(window_);
ui::SetWindowUserData(window_, this);
return true;
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 9a92002..30cf793 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -444,7 +444,7 @@ HWND RenderWidgetHostViewWin::ReparentWindow(HWND window) {
MAKEINTATOM(window_class), 0,
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, 0, 0, ::GetParent(window), 0, GetModuleHandle(NULL), 0);
- DCHECK(parent);
+ ui::CheckWindowCreated(parent);
::SetParent(window, parent);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -1549,7 +1549,7 @@ gfx::PluginWindowHandle RenderWidgetHostViewWin::AcquireCompositingSurface() {
MAKEINTATOM(window_class), 0,
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_DISABLED,
0, 0, width, height, m_hWnd, 0, GetModuleHandle(NULL), 0);
- DCHECK(compositor_host_window_);
+ ui::CheckWindowCreated(compositor_host_window_);
return static_cast<gfx::PluginWindowHandle>(compositor_host_window_);
}
@@ -1742,6 +1742,7 @@ void RenderWidgetHostViewWin::EnsureTooltip() {
WS_EX_TRANSPARENT | l10n_util::GetExtendedTooltipStyles(),
TOOLTIPS_CLASS, NULL, TTS_NOPREFIX, 0, 0, 0, 0, m_hWnd, NULL,
NULL, NULL);
+ ui::CheckWindowCreated(tooltip_hwnd_);
ti.uFlags = TTF_TRANSPARENT;
ti.lpszText = LPSTR_TEXTCALLBACK;
}
diff --git a/chrome/browser/ui/views/status_icons/status_tray_win.cc b/chrome/browser/ui/views/status_icons/status_tray_win.cc
index 5eb7e22..5a6c5c7 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_win.cc
@@ -33,6 +33,7 @@ StatusTrayWin::StatusTrayWin()
// "TaskbarCreated".
window_ = CreateWindow(chrome::kStatusTrayWindowClass,
0, WS_POPUP, 0, 0, 0, 0, 0, 0, hinst, 0);
+ ui::CheckWindowCreated(window_);
ui::SetWindowUserData(window_, this);
}