Bug 829557. Part 1: When calling into plugin code, identify situations where it is safe (or unsafe) to reenter Gecko from plugin code. r=bsmedberg

When Gecko is reentered from unsafe call sites, we allow the reentry, but we
suppress execution of the refresh driver to minimize the danger.
In this patch, we treat all sites as unsafe.
This commit is contained in:
Robert O'Callahan
2013-02-28 00:50:27 +13:00
parent 1ebb331c24
commit e5e3b3660e
10 changed files with 82 additions and 38 deletions

View File

@@ -173,7 +173,8 @@ static bool ProcessFlashMessageDelayed(nsPluginNativeWindowOS2 * aWin,
if (msg == sWM_FLASHBOUNCEMSG) {
// See PluginWindowEvent::Run() below.
NS_TRY_SAFE_CALL_VOID((aWin->GetWindowProc())(hWnd, WM_USER_FLASH, mp1, mp2),
inst);
inst,
NS_PLUGIN_CALL_UNSAFE_TO_REENTER_GECKO);
return TRUE;
}
@@ -309,9 +310,11 @@ static MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM m
MRESULT res = (MRESULT)TRUE;
if (win->mPluginType == nsPluginType_Java_vm)
NS_TRY_SAFE_CALL_RETURN(res, ::WinDefWindowProc(hWnd, msg, mp1, mp2), inst);
NS_TRY_SAFE_CALL_RETURN(res, ::WinDefWindowProc(hWnd, msg, mp1, mp2), inst,
NS_PLUGIN_CALL_UNSAFE_TO_REENTER_GECKO);
else
NS_TRY_SAFE_CALL_RETURN(res, (win->GetWindowProc())(hWnd, msg, mp1, mp2), inst);
NS_TRY_SAFE_CALL_RETURN(res, (win->GetWindowProc())(hWnd, msg, mp1, mp2), inst,
NS_PLUGIN_CALL_UNSAFE_TO_REENTER_GECKO);
if (inst) {
// Popups are enabled (were enabled before the call to
@@ -397,7 +400,8 @@ NS_IMETHODIMP PluginWindowEvent::Run()
// is more generic.
NS_TRY_SAFE_CALL_VOID((win->GetWindowProc())
(hWnd, GetMsg(), GetWParam(), GetLParam()),
inst);
inst,
NS_PLUGIN_CALL_UNSAFE_TO_REENTER_GECKO);
Clear();
return NS_OK;