diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-13 18:18:14 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-13 18:18:14 +0000 |
commit | dd4beb52162f4ac3e21c0a6eed670fcd36d2d8d6 (patch) | |
tree | 0b3918829d1a122d3af42693884616fe942e76e1 /chrome_frame | |
parent | 763423c29287ca2de6d6bc9a800bd571cd5e075d (diff) | |
download | chromium_src-dd4beb52162f4ac3e21c0a6eed670fcd36d2d8d6.zip chromium_src-dd4beb52162f4ac3e21c0a6eed670fcd36d2d8d6.tar.gz chromium_src-dd4beb52162f4ac3e21c0a6eed670fcd36d2d8d6.tar.bz2 |
Handling case where automation server is NULL when creating the active doc window.
I'm not sure why the server couldn't be created but we shouldn't crash.
BUG=48846
TEST=Fixes crash.
Review URL: http://codereview.chromium.org/2895010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 6 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index faab456..da3da63 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -519,6 +519,12 @@ HRESULT ChromeActiveDocument::ActiveXDocActivate(LONG verb) { SetFocus(); } else { m_hWnd = Create(parent_window, position_rect, 0, 0, WS_EX_CLIENTEDGE); + if (!IsWindow()) { + // This might happen if the automation server couldn't be + // instantiated. If so, a NOTREACHED() will have already been hit. + DLOG(ERROR) << "Failed to create Ax window"; + return AtlHresultFromLastError(); + } } ScopedComPtr<IWebBrowser2> web_browser2; diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 32b431c..dc0a955 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -467,7 +467,12 @@ END_MSG_MAP() BOOL& handled) { // NO_LINT ModifyStyle(0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0); url_fetcher_.put_notification_window(m_hWnd); - automation_client_->SetParentWindow(m_hWnd); + if (automation_client_.get()) { + automation_client_->SetParentWindow(m_hWnd); + } else { + NOTREACHED() << "No automation server"; + return -1; + } // Only fire the 'interactive' ready state if we aren't there already. if (ready_state_ < READYSTATE_INTERACTIVE) { ready_state_ = READYSTATE_INTERACTIVE; |