зеркало из https://github.com/mozilla/gecko-dev.git
Fix for null pointer in full page plugins on Mac. bug 74789 a=av sr=shaver
This commit is contained in:
Родитель
85fb69863e
Коммит
d2614be8ea
|
@ -448,13 +448,17 @@ PluginViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
|
|||
nsEventStatus PR_CALLBACK
|
||||
HandlePluginEvent(nsGUIEvent *aEvent)
|
||||
{
|
||||
if( (*aEvent).message == NS_PLUGIN_ACTIVATE) {
|
||||
(nsIWidget*)((*aEvent).widget)->SetFocus();
|
||||
}
|
||||
#ifdef XP_MAC
|
||||
if (aEvent == nsnull || aEvent->widget == nsnull) //null pointer check
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
if( aEvent->message == NS_PLUGIN_ACTIVATE)
|
||||
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
|
||||
|
||||
#ifdef XP_MAC // on Mac, we store a pointer to this class as native data in the widget
|
||||
PluginViewerImpl * pluginViewer;
|
||||
(nsIWidget*)((*aEvent).widget)->GetClientData((PluginViewerImpl *)pluginViewer);
|
||||
return pluginViewer->mOwner->ProcessEvent(*aEvent);
|
||||
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
|
||||
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
|
||||
return pluginViewer->mOwner->ProcessEvent(*aEvent);
|
||||
#endif
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
|
|
@ -448,13 +448,17 @@ PluginViewerImpl::SetDOMDocument(nsIDOMDocument *aDocument)
|
|||
nsEventStatus PR_CALLBACK
|
||||
HandlePluginEvent(nsGUIEvent *aEvent)
|
||||
{
|
||||
if( (*aEvent).message == NS_PLUGIN_ACTIVATE) {
|
||||
(nsIWidget*)((*aEvent).widget)->SetFocus();
|
||||
}
|
||||
#ifdef XP_MAC
|
||||
if (aEvent == nsnull || aEvent->widget == nsnull) //null pointer check
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
if( aEvent->message == NS_PLUGIN_ACTIVATE)
|
||||
(nsIWidget*)(aEvent->widget)->SetFocus(); // send focus to child window
|
||||
|
||||
#ifdef XP_MAC // on Mac, we store a pointer to this class as native data in the widget
|
||||
PluginViewerImpl * pluginViewer;
|
||||
(nsIWidget*)((*aEvent).widget)->GetClientData((PluginViewerImpl *)pluginViewer);
|
||||
return pluginViewer->mOwner->ProcessEvent(*aEvent);
|
||||
(nsIWidget*)(aEvent->widget)->GetClientData((PluginViewerImpl *)pluginViewer);
|
||||
if (pluginViewer != nsnull && pluginViewer->mOwner != nsnull)
|
||||
return pluginViewer->mOwner->ProcessEvent(*aEvent);
|
||||
#endif
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче