2008-04-22 Sam Weinig <sam@webkit.org>
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Apr 2008 21:38:56 +0000 (21:38 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Apr 2008 21:38:56 +0000 (21:38 +0000)
commit4bbaca154c35185ef30e39b31b8306f5a77406fe
treefedc4f65cad73923010eb8413cd6bc9f56333ffe
parent601c7493b64269da9c424fc339d82635fe4cc783
2008-04-22  Sam Weinig  <sam@webkit.org>

        Reviewed by Geoffrey Garen.

        Make DOMAbstractView have a weak reference to the Frame instead of ref'ing
        the DOMWindow.

        To ensure that the WindowScriptObject (which is a DOMAbstractView) stays valid
        after a navigation once the split window is completed, the DOMAbstractView must
        wrap the Frame instead of a DOMWindow since the DOMWindow will change.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/objc/DOMAbstractView.mm: Added.
        (-[DOMAbstractView dealloc]):
        (-[DOMAbstractView finalize]):
        (-[DOMAbstractView document]):
        (-[DOMAbstractView _disconnectFrame]):
        (-[DOMAbstractView WebCore::]):
        (-[DOMAbstractView _initWithFrame:WebCore::]):
        (+[DOMAbstractView _wrapAbstractView:WebCore::]):
        Add custom implementation to implement weak reference semantics.

        * bindings/objc/DOMAbstractViewFrame.h: Added.
        Declare the [DOMAbstractView _disconectFrame] selector.
        * bindings/objc/DOMInternal.h:
        Remove DOMRGBColor Internal category since it is now generated.

        * bindings/objc/DOMUtility.mm:
        (KJS::createDOMWrapper):
        Don't ever create a DOMAbstractView from a JSDOMWindow, only from JSDOMWindowWrapper.

        * bindings/scripts/CodeGeneratorObjC.pm:
        Generate internal header for IDLs that want custom implementations.

        * css/RGBColor.idl:
        Make this a PODType as it really is in the implementation.

        * page/AbstractView.idl:
        This now needs a custom objective-c binding implementation.

        * page/Frame.cpp:
        (WebCore::Frame::~Frame):
        disconnect the weak frame reference in the WindowScriptObject.

        * page/Frame.h:
        * page/gtk/FrameGtk.cpp:
        (WebCore::Frame::disconnectPlatformScriptObjects): Dummy implementation.
        * page/mac/FrameMac.mm:
        (WebCore::Frame::windowScriptObject): ASSERT that the windowScriptObject is a DOMAbstractView.
        (WebCore::Frame::disconnectPlatformScriptObjects): Disconnect the frame pointer from the windowScriptObject.
        * page/qt/FrameQt.cpp:
        (WebCore::Frame::disconnectPlatformScriptObjects): Dummy implementation.
        * page/win/FrameWin.cpp:
        (WebCore::Frame::disconnectPlatformScriptObjects): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOMAbstractView.mm [new file with mode: 0644]
WebCore/bindings/objc/DOMAbstractViewFrame.h [new file with mode: 0644]
WebCore/bindings/objc/DOMInternal.h
WebCore/bindings/objc/DOMUtility.mm
WebCore/bindings/scripts/CodeGeneratorObjC.pm
WebCore/css/RGBColor.idl
WebCore/page/AbstractView.idl
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/gtk/FrameGtk.cpp
WebCore/page/mac/FrameMac.mm
WebCore/page/qt/FrameQt.cpp
WebCore/page/win/FrameWin.cpp