Changeset 84736 in webkit


Ignore:
Timestamp:
Apr 22, 2011 9:41:54 PM (13 years ago)
Author:
ggaren@apple.com
Message:

2011-04-22 Geoffrey Garen <ggaren@apple.com>

Rolled back in r84725 and r84728 with appcache crash fixed.

Reviewed by Oliver Hunt.

Removed a use of markDOMObjectWrapper: DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=59260

  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::visitChildren): No need to mark explicitly, since we use the opaque roots system now.
  • bindings/js/JSNavigatorCustom.cpp: Ditto.
  • bindings/scripts/CodeGeneratorJS.pm: Added autogeneration for objects whose opaque roots are frames.
  • css/StyleMedia.h: (WebCore::StyleMedia::frame): Added an accessor for the sake of GC.
  • css/StyleMedia.idl:
  • loader/appcache/DOMApplicationCache.idl:
  • page/BarInfo.idl:
  • page/Console.idl:
  • page/DOMSelection.idl:
  • page/Geolocation.idl:
  • page/History.idl:
  • page/Location.idl:
  • page/Navigator.idl:
  • page/Screen.idl:
  • storage/Storage.idl: Updated to use the opaque roots system.
Location:
trunk/Source/WebCore
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84732 r84736  
     12011-04-22  Geoffrey Garen  <ggaren@apple.com>
     2       
     3        Rolled back in r84725 and r84728 with appcache crash fixed.
     4
     5        Reviewed by Oliver Hunt.
     6
     7        Removed a use of markDOMObjectWrapper: DOMWindow
     8        https://bugs.webkit.org/show_bug.cgi?id=59260
     9
     10        * bindings/js/JSDOMWindowCustom.cpp:
     11        (WebCore::JSDOMWindow::visitChildren): No need to mark explicitly, since
     12        we use the opaque roots system now.
     13
     14        * bindings/js/JSNavigatorCustom.cpp: Ditto.
     15
     16        * bindings/scripts/CodeGeneratorJS.pm: Added autogeneration for objects
     17        whose opaque roots are frames.
     18
     19        * css/StyleMedia.h:
     20        (WebCore::StyleMedia::frame): Added an accessor for the sake of GC.
     21
     22        * css/StyleMedia.idl:
     23        * loader/appcache/DOMApplicationCache.idl:
     24        * page/BarInfo.idl:
     25        * page/Console.idl:
     26        * page/DOMSelection.idl:
     27        * page/Geolocation.idl:
     28        * page/History.idl:
     29        * page/Location.idl:
     30        * page/Navigator.idl:
     31        * page/Screen.idl:
     32        * storage/Storage.idl: Updated to use the opaque roots system.
     33
    1342011-04-22  Nate Chapin  <japhet@chromium.org>
    235
     
    73106        * svg/animation/SVGSMILElement.cpp:
    74107        (WebCore::SVGSMILElement::insertedIntoDocument): Ditto.
     108
     1092011-04-22  Geoffrey Garen  <ggaren@apple.com>
     110
     111        Mac build fix.
     112
     113        * page/DOMWindow.h:
     114        (WebCore::DOMWindow::optionalApplicationCache): Restored this function,
     115        which is used after all.
    75116
    761172011-04-22  Geoffrey Garen  <ggaren@apple.com>
  • trunk/Source/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp

    r65077 r84736  
    4242
    4343namespace WebCore {
     44
     45static inline bool isObservable(JSDOMApplicationCache* jsDOMApplicationCache, DOMApplicationCache* domApplicationCache)
     46{
     47    if (!jsDOMApplicationCache->hasCustomProperties())
     48        return true;
     49    if (domApplicationCache->hasEventListeners())
     50        return true;
     51    return false;
     52}
     53
     54bool JSDOMApplicationCacheOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
     55{
     56    JSDOMApplicationCache* jsDOMApplicationCache = static_cast<JSDOMApplicationCache*>(handle.get().asCell());
     57    DOMApplicationCache* domApplicationCache = jsDOMApplicationCache->impl();
     58    Frame* frame = jsDOMApplicationCache->impl()->frame();
     59    if (!frame)
     60        return false;
     61    return isObservable(jsDOMApplicationCache, domApplicationCache) && visitor.containsOpaqueRoot(frame);
     62}
    4463
    4564#if ENABLE(APPLICATION_CACHE_DYNAMIC_ENTRIES)
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r84731 r84736  
    7878
    7979    impl()->visitJSEventListeners(visitor);
    80 
    81     JSGlobalData& globalData = *Heap::heap(this)->globalData();
    82 
    83     markDOMObjectWrapper(visitor, globalData, impl()->optionalConsole());
    84     markDOMObjectWrapper(visitor, globalData, impl()->optionalHistory());
    85     markDOMObjectWrapper(visitor, globalData, impl()->optionalLocationbar());
    86     markDOMObjectWrapper(visitor, globalData, impl()->optionalMenubar());
    87     markDOMObjectWrapper(visitor, globalData, impl()->optionalNavigator());
    88     markDOMObjectWrapper(visitor, globalData, impl()->optionalPersonalbar());
    89     markDOMObjectWrapper(visitor, globalData, impl()->optionalScreen());
    90     markDOMObjectWrapper(visitor, globalData, impl()->optionalScrollbars());
    91     markDOMObjectWrapper(visitor, globalData, impl()->optionalSelection());
    92     markDOMObjectWrapper(visitor, globalData, impl()->optionalStatusbar());
    93     markDOMObjectWrapper(visitor, globalData, impl()->optionalToolbar());
    94     markDOMObjectWrapper(visitor, globalData, impl()->optionalLocation());
    95     markDOMObjectWrapper(visitor, globalData, impl()->optionalMedia());
    96 #if ENABLE(DOM_STORAGE)
    97     markDOMObjectWrapper(visitor, globalData, impl()->optionalSessionStorage());
    98     markDOMObjectWrapper(visitor, globalData, impl()->optionalLocalStorage());
    99 #endif
    100 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
    101     markDOMObjectWrapper(visitor, globalData, impl()->optionalApplicationCache());
    102 #endif
     80    if (Frame* frame = impl()->frame())
     81        visitor.addOpaqueRoot(frame);
    10382}
    10483
  • trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp

    r84731 r84736  
    3333using namespace JSC;
    3434
    35 void JSNavigator::visitChildren(SlotVisitor& visitor)
    36 {
    37     Base::visitChildren(visitor);
    38 
    39     JSGlobalData& globalData = *Heap::heap(this)->globalData();
    40 
    41     markDOMObjectWrapper(visitor, globalData, impl()->optionalGeolocation());
    42 }
    43 
    4435#if ENABLE(MEDIA_STREAM)
    4536JSValue JSNavigator::webkitGetUserMedia(ExecState* exec)
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r84731 r84736  
    21272127    }
    21282128
    2129     if ($dataNode->extendedAttributes->{"CustomIsReachable"} && !$dataNode->extendedAttributes->{"CustomFinalize"}) {
    2130         push(@implContent, "void JS${implType}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
    2131         push(@implContent, "{\n");
    2132         push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
    2133         push(@implContent, "    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n");
    2134         push(@implContent, "    uncacheWrapper(world, js${implType}->impl(), js${implType});\n");
    2135         push(@implContent, "}\n");
     2129    if ($dataNode->extendedAttributes->{"CustomIsReachable"}) {
     2130        if ($dataNode->extendedAttributes->{"CustomIsReachable"} eq "Frame") {
     2131            push(@implContent, "bool JS${implType}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)\n");
     2132            push(@implContent, "{\n");
     2133            push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
     2134            push(@implContent, "    if (!js${implType}->hasCustomProperties())\n");
     2135            push(@implContent, "        return false;\n");
     2136            push(@implContent, "    Frame* frame = js${implType}->impl()->frame();\n");
     2137            push(@implContent, "    if (!frame)\n");
     2138            push(@implContent, "        return false;\n");
     2139            push(@implContent, "    return visitor.containsOpaqueRoot(frame);\n");
     2140            push(@implContent, "}\n\n");
     2141        }
     2142
     2143        if (!$dataNode->extendedAttributes->{"CustomFinalize"}) {
     2144            push(@implContent, "void JS${implType}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
     2145            push(@implContent, "{\n");
     2146            push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
     2147            push(@implContent, "    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n");
     2148            push(@implContent, "    uncacheWrapper(world, js${implType}->impl(), js${implType});\n");
     2149            push(@implContent, "}\n\n");
     2150        }
    21362151    }
    21372152
  • trunk/Source/WebCore/css/StyleMedia.h

    r84731 r84736  
    4141    }
    4242
     43    Frame* frame() { return m_frame; }
    4344    void disconnectFrame() { m_frame = 0; }
    4445
  • trunk/Source/WebCore/css/StyleMedia.idl

    r84731 r84736  
    2626
    2727module view {
    28     interface StyleMedia {
     28    interface [
     29        CustomIsReachable=Frame
     30    ] StyleMedia {
    2931        readonly attribute DOMString type;
    3032        boolean matchMedium(in DOMString mediaquery);
  • trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl

    r84731 r84736  
    3030        EventTarget,
    3131        OmitConstructor,
    32         DontCheckEnums
     32        DontCheckEnums,
     33        CustomIsReachable
    3334    ] DOMApplicationCache {
    3435        // update status
  • trunk/Source/WebCore/page/BarInfo.idl

    r84731 r84736  
    2929module window {
    3030
    31     interface [OmitConstructor] BarInfo {
     31    interface [
     32        CustomIsReachable=Frame,
     33        OmitConstructor
     34    ] BarInfo {
    3235        readonly attribute boolean visible;
    3336    };
  • trunk/Source/WebCore/page/Console.idl

    r84731 r84736  
    2929module window {
    3030
    31     interface [OmitConstructor] Console {
     31    interface [
     32        CustomIsReachable=Frame,
     33        OmitConstructor
     34    ] Console {
    3235
    3336        [CustomArgumentHandling] void debug();
  • trunk/Source/WebCore/page/DOMSelection.idl

    r84731 r84736  
    3232    // This is based off of Mozilla's Selection interface
    3333    // https://developer.mozilla.org/En/DOM/Selection
    34     interface [OmitConstructor] DOMSelection {
     34    interface [
     35        CustomIsReachable=Frame,
     36        OmitConstructor
     37    ] DOMSelection {
    3538        readonly attribute Node anchorNode;
    3639        readonly attribute long anchorOffset;
  • trunk/Source/WebCore/page/DOMWindow.h

    r84731 r84736  
    341341        void finishedLoading();
    342342
    343         // These functions are used for GC marking. See JSDOMWindow::visitChildren(SlotVisitor&) in JSDOMWindowCustom.cpp.
    344         Screen* optionalScreen() const { return m_screen.get(); }
    345         DOMSelection* optionalSelection() const { return m_selection.get(); }
    346         History* optionalHistory() const { return m_history.get(); }
    347         Crypto* optionalCrypto() const { return m_crypto.get(); }
    348         BarInfo* optionalLocationbar() const { return m_locationbar.get(); }
    349         BarInfo* optionalMenubar() const { return m_menubar.get(); }
    350         BarInfo* optionalPersonalbar() const { return m_personalbar.get(); }
    351         BarInfo* optionalScrollbars() const { return m_scrollbars.get(); }
    352         BarInfo* optionalStatusbar() const { return m_statusbar.get(); }
    353         BarInfo* optionalToolbar() const { return m_toolbar.get(); }
    354         Console* optionalConsole() const { return m_console.get(); }
    355         Navigator* optionalNavigator() const { return m_navigator.get(); }
    356         Location* optionalLocation() const { return m_location.get(); }
    357         StyleMedia* optionalMedia() const { return m_media.get(); }
    358 
    359343        using RefCounted<DOMWindow>::ref;
    360344        using RefCounted<DOMWindow>::deref;
     
    378362        Storage* sessionStorage(ExceptionCode&) const;
    379363        Storage* localStorage(ExceptionCode&) const;
    380         Storage* optionalSessionStorage() const { return m_sessionStorage.get(); }
    381         Storage* optionalLocalStorage() const { return m_localStorage.get(); }
    382364#endif
    383365
     
    429411#if ENABLE(WEB_TIMING)
    430412        Performance* performance() const;
    431         Performance* optionalPerformance() const { return m_performance.get(); }
    432413#endif
    433414
  • trunk/Source/WebCore/page/Geolocation.idl

    r84731 r84736  
    2626module core {
    2727
    28     interface [Conditional=GEOLOCATION, OmitConstructor] Geolocation {
     28    interface [
     29        Conditional=GEOLOCATION,
     30        CustomIsReachable=Frame,
     31        OmitConstructor
     32    ] Geolocation {
    2933        [Custom] void getCurrentPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
    3034
  • trunk/Source/WebCore/page/History.idl

    r84731 r84736  
    3232        DelegatingGetOwnPropertySlot,
    3333        DelegatingPutFunction,
     34        CustomIsReachable=Frame,
    3435        CustomDeleteProperty,
    3536        CustomGetPropertyNames,
  • trunk/Source/WebCore/page/Location.idl

    r84731 r84736  
    3535        DelegatingGetOwnPropertySlot,
    3636        DelegatingPutFunction,
     37        CustomIsReachable=Frame,
    3738        CustomDeleteProperty,
    3839        CustomGetPropertyNames,
  • trunk/Source/WebCore/page/Navigator.h

    r84731 r84736  
    5858
    5959    Geolocation* geolocation() const;
    60     // This is used for GC marking.
    61     Geolocation* optionalGeolocation() const { return m_geolocation.get(); }
    6260
    6361#if ENABLE(DOM_STORAGE)
  • trunk/Source/WebCore/page/Navigator.idl

    r84731 r84736  
    2121
    2222    interface [
    23         CustomMarkFunction,
     23        CustomIsReachable=Frame,
    2424        OmitConstructor
    2525    ] Navigator {
  • trunk/Source/WebCore/page/Screen.idl

    r84731 r84736  
    3030module window {
    3131
    32     interface [OmitConstructor] Screen {
     32    interface [
     33        CustomIsReachable=Frame,
     34        OmitConstructor
     35    ] Screen {
    3336        readonly attribute unsigned long height;
    3437        readonly attribute unsigned long width;
  • trunk/Source/WebCore/storage/Storage.idl

    r84731 r84736  
    2828    interface [
    2929        HasNameGetter,
     30        CustomIsReachable=Frame,
    3031        CustomDeleteProperty,
    3132        CustomGetPropertyNames,
Note: See TracChangeset for help on using the changeset viewer.