Reviewed by Kevin Decker.
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Feb 2010 19:16:21 +0000 (19:16 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Feb 2010 19:16:21 +0000 (19:16 +0000)
commit9aa5d1d88d180e41c4c1649ff3a103da65118212
tree9560a41372b50c3ad81ff1fdc605348785c43b6e
parenta650d191090630e0d833a94f4ea8e54bd5c4aa04
    Reviewed by Kevin Decker.

        <rdar://problem/7130641> Browser objects identity is not preserved by Safari

        Test: plugins/netscape-browser-object-identity.html

        * bridge/runtime_root.h: (JSC::Bindings::RootObject::addInvalidationCallback):
        RootObject can now call out during invalidation, making it possible for other code to know
        when this happens.

        * bridge/runtime_root.cpp:
        (JSC::Bindings::RootObject::InvalidationCallback::~InvalidationCallback): Empty destructor,
        in cpp file since it's virtual.
        (JSC::Bindings::RootObject::invalidate): Invoke invalidation callbacks.

        * bridge/NP_jsobject.cpp:
        (ObjectMap): Keep a JSObject->NPObject map for each RootObject. It somewhat cleaner to
        keep it outside RootObject, because (1) it is agnostic of what kinds of objects can wrap
        JSObject, and (2) out of process NPAPI implementation also keeps its corresponding map
        separately, due to supporting per-instance granularity (as opposed to per-RootObject here).
        (jsDeallocate): Remove the corresponding map entry.
        (_NPN_CreateScriptObject): Try to fetch existing object from the map, incrementing refcount.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@54783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/plugins/netscape-browser-object-identity-expected.txt [new file with mode: 0644]
LayoutTests/plugins/netscape-browser-object-identity.html [new file with mode: 0644]
LayoutTests/plugins/script-tests/netscape-browser-object-identity.js [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bridge/NP_jsobject.cpp
WebCore/bridge/runtime_root.cpp
WebCore/bridge/runtime_root.h
WebKit/mac/ChangeLog
WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
WebKit/mac/Plugins/Hosted/ProxyInstance.mm
WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp