diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 19:51:44 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-19 19:51:44 +0000 |
commit | 3c1ab636837feb7d9842fa6d701fea77638a7f46 (patch) | |
tree | f34a1ed0420bd79026603b5ae0a732e5ded6cb55 /chrome_frame/chrome_frame_automation.cc | |
parent | dcbb4d58a0f5526537b7398a51bd9518333e9c4a (diff) | |
download | chromium_src-3c1ab636837feb7d9842fa6d701fea77638a7f46.zip chromium_src-3c1ab636837feb7d9842fa6d701fea77638a7f46.tar.gz chromium_src-3c1ab636837feb7d9842fa6d701fea77638a7f46.tar.bz2 |
Make sure we have a valid tab proxy before trying to call it.
Got a crash while testing something else on a VM and my investigation led to that potential problem.
BUG=0
TEST=Try loading Chrome Frame on very slow machines (like a VM).
Review URL: http://codereview.chromium.org/651036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_automation.cc')
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index ae643c8..746340d 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -712,7 +712,14 @@ void ChromeFrameAutomationClient::InstallExtensionComplete( } void ChromeFrameAutomationClient::OnChromeFrameHostMoved() { - tab_->OnHostMoved(); + // Use a local var to avoid the small possibility of getting the tab_ + // member be cleared while we try to use it. + // Note that TabProxy is a RefCountedThreadSafe object, so we should be OK. + scoped_refptr<TabProxy> tab(tab_); + // There also is a possibility that tab_ has not been set yet, + // so we still need to test for NULL. + if (tab.get() != NULL) + tab->OnHostMoved(); } void ChromeFrameAutomationClient::LoadExpandedExtension( |