summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 00:06:03 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 00:06:03 +0000
commit77700831c1d0a328a5fada182adfab6dd86d937e (patch)
treedec763158a668bb42eb20926c76e419463da9ad0 /chrome_frame
parent2a92cd9469247921bda75f3d5a00a67f7bfd78eb (diff)
downloadchromium_src-77700831c1d0a328a5fada182adfab6dd86d937e.zip
chromium_src-77700831c1d0a328a5fada182adfab6dd86d937e.tar.gz
chromium_src-77700831c1d0a328a5fada182adfab6dd86d937e.tar.bz2
Fix a chrome frame crasher reported on the crash server. It occurs while processing a call to SetPositionCookie while dereferencing
a NULL automation client pointer. Fixes bug http://code.google.com/p/chromium/issues/detail?id=42598 Bug=42598 Review URL: http://codereview.chromium.org/1763011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_active_document.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index caa4ffd..a7796d5 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -397,9 +397,13 @@ STDMETHODIMP ChromeActiveDocument::SaveHistory(IStream* stream) {
}
STDMETHODIMP ChromeActiveDocument::SetPositionCookie(DWORD position_cookie) {
- int index = static_cast<int>(position_cookie);
- navigation_info_.navigation_index = index;
- automation_client_->NavigateToIndex(index);
+ if (automation_client_.get()) {
+ int index = static_cast<int>(position_cookie);
+ navigation_info_.navigation_index = index;
+ automation_client_->NavigateToIndex(index);
+ } else {
+ DLOG(WARNING) << "Invalid automation client instance";
+ }
return S_OK;
}
@@ -810,6 +814,10 @@ void ChromeActiveDocument::OnOpenURL(int tab_handle,
void ChromeActiveDocument::OnAttachExternalTab(int tab_handle,
const IPC::AttachExternalTabParams& params) {
+ if (!automation_client_.get()) {
+ DLOG(WARNING) << "Invalid automation client instance";
+ return;
+ }
DWORD flags = 0;
if (params.user_gesture)
flags = NWMF_USERREQUESTED;
@@ -981,6 +989,8 @@ bool ChromeActiveDocument::ParseUrl(const std::wstring& url,
bool ChromeActiveDocument::LaunchUrl(const std::wstring& url,
bool is_new_navigation) {
+ DCHECK(automation_client_.get() != NULL);
+
url_.Allocate(url.c_str());
if (!is_new_navigation) {
@@ -1065,7 +1075,7 @@ HRESULT ChromeActiveDocument::SetPageFontSize(const GUID* cmd_group_guid,
VARIANT* in_args,
VARIANT* out_args) {
if (!automation_client_.get()) {
- NOTREACHED() << "Invalid automtion client";
+ NOTREACHED() << "Invalid automation client";
return E_FAIL;
}