Commit 0a3771cb authored by darin's avatar darin
Browse files

Reviewed by Don and Ken.

	- fixed 3136797 -- crash when Adobe SVG Viewer plug-in puts up modal dialog

        * Plugins.subproj/WebBaseNetscapePluginView.h: Add inSetWindow boolean.
        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView sendEvent:]): Don't send any events to a plug-in while it's
	inside NPP_SetWindow. We don't want to implement more general reentrancy protection, because
	it could cause trouble for plugins that can handle it correctly, but it's unlikely that any
	legitimate use would require reentrant calls while inside NPP_SetWindow, and that's the case
	that crashes for the SVG viewer plug-in when it presents its registration dialog.
        (-[WebBaseNetscapePluginView setWindow]): Set boolean.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 477551a4
2002-12-30 Darin Adler <darin@apple.com>
Reviewed by Don and Ken.
- fixed 3136797 -- crash when Adobe SVG Viewer plug-in puts up modal dialog
* Plugins.subproj/WebBaseNetscapePluginView.h: Add inSetWindow boolean.
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView sendEvent:]): Don't send any events to a plug-in while it's
inside NPP_SetWindow. We don't want to implement more general reentrancy protection, because
it could cause trouble for plugins that can handle it correctly, but it's unlikely that any
legitimate use would require reentrant calls while inside NPP_SetWindow, and that's the case
that crashes for the SVG viewer plug-in when it presents its registration dialog.
(-[WebBaseNetscapePluginView setWindow]): Set boolean.
2002-12-29 Darin Adler <darin@apple.com>
Reviewed by Don.
......
......@@ -30,8 +30,8 @@
NPP_t instanceStruct;
BOOL canRestart;
BOOL isHidden;
BOOL isStarted;
BOOL inSetWindow;
NSString *MIMEType;
NSURL *baseURL;
......
......@@ -259,6 +259,14 @@ - (BOOL)sendEvent:(EventRecord *)event
return NO;
}
// Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow.
// We probably don't want more general reentrancy protection; we are really
// protecting only against this one case, which actually comes up when
// you first install the SVG viewer plug-in.
if (inSetWindow) {
return NO;
}
BOOL defers = [[self controller] _defersCallbacks];
if (!defers) {
[[self controller] _setDefersCallbacks:YES];
......@@ -566,8 +574,15 @@ - (void)setWindow
PortState portState = [self saveAndSetPortState];
// Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow.
// We probably don't want more general reentrancy protection; we are really
// protecting only against this one case, which actually comes up when
// you first install the SVG viewer plug-in.
NPError npErr;
ASSERT(!inSetWindow);
inSetWindow = YES;
npErr = NPP_SetWindow(instance, &window);
inSetWindow = NO;
LOG(Plugins, "NPP_SetWindow: %d, port=0x%08x, window.x:%d window.y:%d",
npErr, (int)nPort.port, (int)window.x, (int)window.y);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment