Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 329053004: Fix race in BrowserAccessibilityManagerWin creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index e98ae71498b4dde47494c28b7803ffe67476adbe..60728e01f744ddafee492258aebe3069c36cd479 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -739,6 +739,9 @@ STDMETHODIMP BrowserAccessibilityWin::get_windowHandle(HWND* window_handle) {
return E_INVALIDARG;
*window_handle = manager()->ToBrowserAccessibilityManagerWin()->parent_hwnd();
+ if (!*window_handle)
+ return E_FAIL;
+
return S_OK;
}
@@ -992,6 +995,8 @@ STDMETHODIMP BrowserAccessibilityWin::get_imagePosition(
if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) {
HWND parent_hwnd =
manager()->ToBrowserAccessibilityManagerWin()->parent_hwnd();
+ if (!parent_hwnd)
+ return E_FAIL;
POINT top_left = {0, 0};
::ClientToScreen(parent_hwnd, &top_left);
*x = GetLocation().x() + top_left.x;

Powered by Google App Engine
This is Rietveld 408576698