Skip to content
  • commit-queue@webkit.org's avatar
    Store MutationObserver callback in a hidden property for V8 · f61a46a8
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=102555
    
    Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-11-20
    Reviewed by Adam Barth.
    
    .:
    
    Test for reference cycle leaks with mutation observers. There doesn't seem
    to be a way to check this for v8, but if you manually run you can see if it
    leaks observers.
    
    * ManualTests/leak-cycle-observer-wrapper.html: Added.
    
    Source/WebCore:
    
    To prevent circular reference leaks we should store the MutationObserver
    callback in a hidden property on the wrapper of the observer.
    
    This is done by extending the code generator to support a new owner
    argument to ::create() that lets you set the owner of the callback where
    the hidden property should be stored.
    
    Test: ManualTests/leak-cycle-observer-wrapper.html
    
    * bindings/scripts/CodeGeneratorV8.pm:
    (GenerateCallbackHeader):
    (GenerateCallbackImplementation):
    * bindings/scripts/test/V8/V8TestCallback.cpp: rebaselined.
    * bindings/scripts/test/V8/V8TestCallback.h: rebaselined.
    * bindings/v8/V8HiddenPropertyName.h:
    * bindings/v8/custom/V8MutationObserverCustom.cpp:
    (WebCore::V8MutationObserver::constructorCallback):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f61a46a8