summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webplugin_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 18:19:44 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 18:19:44 +0000
commitf2eefdabd9adf6c31676a401b4fc01e4e9218cbe (patch)
tree108efd9f9abbd08201b4623e6f509ea445cf8ccf /webkit/glue/webplugin_impl.cc
parent2b2d1697cd3cd6303b372949565bb8ac87741589 (diff)
downloadchromium_src-f2eefdabd9adf6c31676a401b4fc01e4e9218cbe.zip
chromium_src-f2eefdabd9adf6c31676a401b4fc01e4e9218cbe.tar.gz
chromium_src-f2eefdabd9adf6c31676a401b4fc01e4e9218cbe.tar.bz2
Ensure we check the page pointer before using it after we come out of NPP_HandleEvent, as it might have gone away depending on JavaScript that was executed by the plugin.
BUG=9955 Review URL: http://codereview.chromium.org/75026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webplugin_impl.cc')
-rw-r--r--webkit/glue/webplugin_impl.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index 24748cc..1407b4d 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -863,9 +863,12 @@ void WebPluginImpl::handleMouseEvent(WebCore::MouseEvent* event) {
if (!delegate_->HandleEvent(&np_event, &cursor))
event->setDefaultHandled();
+ WebCore::Page* page = parent_view->frame()->page();
+ if (!page)
+ return;
+
ChromeClientImpl* chrome_client =
- static_cast<ChromeClientImpl*>(
- parent_view->frame()->page()->chrome()->client());
+ static_cast<ChromeClientImpl*>(page->chrome()->client());
// A windowless plugin can change the cursor in response to the WM_MOUSEMOVE
// event. We need to reflect the changed cursor in the frame view as the