WebCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Dec 2006 07:38:18 +0000 (07:38 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Dec 2006 07:38:18 +0000 (07:38 +0000)
commit62d55a9b51cb717365e31306cad116d896f2d1d9
tree1c61ce3a0e3f556489bf726a9e0c44546411d75d
parentb1fff3b070474e5185d25a9671ae72f311a34a4c
WebCore:

        Reviewed by Eric Seidel.

        Fixed <rdar://problem/4740328> Safari crash on quit in _NPN_ReleaseObject
        from KJS::Bindings::CInstance::~CInstance

        No testcase because we can't open and close windows in DumpRenderTree.

        * loader/FrameLoader.cpp: Removed closeDocument helper function because
        its only purpose was to call didCloseDocument, which is gone now.
        (WebCore::FrameLoader::detachFromParent): closeDocument => closeURL,
        since didCloseDocument is gone now.

        * loader/FrameLoaderClient.h: Removed didCloseDocument because it proved
        unnecessary and harmful.

        * loader/mac/FrameLoaderMac.mm:
        (WebCore::FrameLoader::transitionToCommitted): closeDocument => closeURL,
        since didCloseDocument is gone now.

WebKit:

        Reviewed by Eric Seidel.

        Fixed <rdar://problem/4740328> Safari crash on quit in _NPN_ReleaseObject
        from KJS::Bindings::CInstance::~CInstance

        The essence of this change is that WebKit shouldn't meddle in plug-in
        lifetime, since WebCore already manages it. The rest is details.

        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView removeTrackingRect]): Autorelease our window
        instead of releasing it, since we might hold the last reference to our window,
        and releasing it immediately would crash AppKit.
        (-[WebBaseNetscapePluginView resetTrackingRect]):

        * Plugins/WebNetscapePluginEmbeddedView.h:
        * Plugins/WebNetscapePluginEmbeddedView.m:
        (-[WebNetscapePluginEmbeddedView dataSource]): Use our DOMElement to access
        our WebFrame, since we don't keep around a direct pointer to our WebFrame
        anymore.

        * Plugins/WebNullPluginView.h:
        * Plugins/WebNullPluginView.m:
        (-[WebNullPluginView initWithFrame:error:DOMElement:]):
        (-[WebNullPluginView dealloc]):
        (-[WebNullPluginView viewDidMoveToWindow]): Use our DOMElement to access
        our WebFrame, as above.

        * WebCoreSupport/WebFrameBridge.mm: Don't call _addPlugInView because it
        doesn't exist anymore. Do pass a DOMElement to WebNullPluginView's initializer,
        so it can access its frame like WebNetscapePluginEmbeddedView does.
        (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]):
        (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]):

        * WebCoreSupport/WebFrameLoaderClient.h:
        * WebCoreSupport/WebFrameLoaderClient.mm: Removed didCloseDocument. It had
        two purposes -- one unnecessary, one harmful:
        (1) NULL out plug-ins' weak references to their frames. Unnecessary. Having
        plug-ins access their frames through their DOM elements solves this problem.
        (2) Unload plug-ins. Harmful. If a plug-in unloads before WebCore is done
        with it, WebCore will access unmapped memory. Also unnecessary. WebCore
        Widgets take care of calling -removeFromSuperview on their NSViews, which
        is sufficient for stopping plug-ins.

        * WebKit.xcodeproj/project.pbxproj: Made WebNullPluginView.m ObjC++.

        * WebView/WebFrame.mm: Removed _addPlugInView, since it was only used to
        call -setWebFrame, which is gone.
        (-[WebFramePrivate dealloc]):
        * WebView/WebFrameInternal.h: Removed plugInViews, since it was only used
        by _addPlugInView, which is gone.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoaderClient.h
WebCore/loader/mac/FrameLoaderMac.mm
WebKit/ChangeLog
WebKit/Plugins/WebBaseNetscapePluginView.mm
WebKit/Plugins/WebNetscapePluginEmbeddedView.h
WebKit/Plugins/WebNetscapePluginEmbeddedView.m
WebKit/Plugins/WebNullPluginView.h
WebKit/Plugins/WebNullPluginView.m
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/WebCoreSupport/WebFrameLoaderClient.h
WebKit/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameInternal.h