Separated a DOMWrapperWorld's behavior of keeping wrappers alive from
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Apr 2010 00:29:03 +0000 (00:29 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Apr 2010 00:29:03 +0000 (00:29 +0000)
commitfeb5e6370786b32d4989ef4f76622480d81328ee
tree4e8bcac17d3d20f190004b7cdb05d9816938d29f
parentb2551595cce1a83097f7eb9546f1984398921d79
Separated a DOMWrapperWorld's behavior of keeping wrappers alive from
its own lifetime, so a DOMWrapperWorld's controller can throw away
its wrappers even before its refcount reaches 0.

Reviewed by Oliver Hunt.

WebCore:

* WebCore.base.exp:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::DOMWrapperWorld):
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(WebCore::DOMWrapperWorld::registerWorld):
(WebCore::DOMWrapperWorld::unregisterWorld):
* bindings/js/DOMWrapperWorld.h: Factored out DOMWrapperWorld registration
and unregistration into helper functions, so unregistering could be done manually.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::destroyWindowShell): Added an ASSERT to match
similar code.

WebKit/mac:

* WebView/WebScriptWorld.h:
* WebView/WebScriptWorld.mm:
(-[WebScriptWorld unregisterWorld]): Exported this function through WebKit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/bindings/js/DOMWrapperWorld.cpp
WebCore/bindings/js/DOMWrapperWorld.h
WebCore/bindings/js/ScriptController.cpp
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebScriptWorld.h
WebKit/mac/WebView/WebScriptWorld.mm