2011-04-24 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Apr 2011 00:47:17 +0000 (00:47 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Apr 2011 00:47:17 +0000 (00:47 +0000)
        Reviewed by Sam Weinig.

        Removed a use of markDOMObjectWrapper: WebGL, XHR, workers; plus, more autogeneration
        https://bugs.webkit.org/show_bug.cgi?id=59307

        * WebCore.xcodeproj/project.pbxproj: Added Blob.idl, so it's easier to edit.

        * bindings/js/JSCSSRuleCustom.cpp:
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        * bindings/js/JSCanvasRenderingContextCustom.cpp:
        * bindings/js/JSDOMApplicationCacheCustom.cpp: Autogenerate these instead
        of hand-coding them.

        * bindings/js/JSDOMBinding.h:
        (WebCore::root): Moved some GC helpers here from JSNodeCustom.h, because
        they're reasonably generic.

        * bindings/js/JSDOMImplementationCustom.cpp:
        * bindings/js/JSDOMStringMapCustom.cpp:
        * bindings/js/JSDOMTokenListCustom.cpp:
        * bindings/js/JSHTMLCollectionCustom.cpp:
        * bindings/js/JSMediaListCustom.cpp: Autogenerate these instead of
        hand-coding them.

        * bindings/js/JSMessageChannelCustom.cpp:
        (WebCore::JSMessageChannel::visitChildren):
        * bindings/js/JSMessagePortCustom.cpp:
        (WebCore::JSMessagePort::visitChildren): Use addOpaqueRoot instead of
        markDOMObjectWrapper. This is one of the few cases where a DOM object is
        considered a stand-alone root. It's not as efficient as the shared root
        case, but workers and message ports are very rare objects, so it's no
        big deal.

        * bindings/js/JSNamedNodeMapCustom.cpp: Autogenerate!

        * bindings/js/JSNodeCustom.h: Moved to JSDOMBinding.h.

        * bindings/js/JSSharedWorkerCustom.cpp:
        (WebCore::JSSharedWorker::visitChildren): Use addOpaqueRoot instead of
        markDOMObjectWrapper, as above. Once again, a stand-alone root.

        * bindings/js/JSStyleSheetCustom.cpp:
        * bindings/js/JSStyleSheetListCustom.cpp: Autogenerate!

        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        (WebCore::JSWebGLRenderingContext::visitChildren): Use the opaque roots
        system for marking WebGL contexts and their associated satellite objects.

        * bindings/js/JSWorkerContextCustom.cpp:
        (WebCore::JSWorkerContext::visitChildren):
        * bindings/js/JSXMLHttpRequestCustom.cpp: Use addOpaqueRoot instead of
        markDOMObjectWrapper, as above. Once again, stand-alone roots.

        (WebCore::JSXMLHttpRequest::visitChildren):
        * bindings/js/JSXMLHttpRequestUploadCustom.cpp: No need to mark our owner
        XHR because it is not reachable from us.

        * bindings/scripts/CodeGeneratorJS.pm: Added autogeneration support for a
        bunch of repetitive cases of isReachableFromOpaqueRoots callbacks.

        * css/CSSRule.idl:
        * css/CSSStyleDeclaration.idl:
        * css/MediaList.idl:
        * css/StyleMedia.idl:
        * css/StyleSheet.idl:
        * css/StyleSheetList.idl:
        * dom/DOMImplementation.idl:
        * dom/DOMStringMap.idl:
        * dom/MessagePort.idl:
        * dom/NamedNodeMap.idl:
        * fileapi/Blob.idl:
        * html/DOMTokenList.idl: Opt in to autogeneration.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContext): Standardized on PassOwnPtr/OwnPtr
        usage, to reduce human error and make ownership rules more obvious.

        * html/HTMLCollection.idl:
        * html/canvas/ArrayBuffer.idl: Opt in to autogeneration.

        * html/canvas/CanvasRenderingContext.cpp:
        * html/canvas/CanvasRenderingContext.h:
        (WebCore::CanvasRenderingContext::ref):
        (WebCore::CanvasRenderingContext::deref):
        * html/canvas/CanvasRenderingContext2D.h:
        (WebCore::CanvasRenderingContext2D::create):
        (WebCore::CanvasRenderingContext2D::state): Standardized on PassOwnPtr/OwnPtr
        usage, to reduce human error and make ownership rules more obvious.

        Inlined some functions to match our standard idiom and to make the code
        in the header document itself.

        * html/canvas/CanvasRenderingContext.idl: Opt in to autogeneration.

        * html/canvas/OESStandardDerivatives.cpp:
        (WebCore::OESStandardDerivatives::OESStandardDerivatives):
        (WebCore::OESStandardDerivatives::create):
        * html/canvas/OESStandardDerivatives.h:
        * html/canvas/OESStandardDerivatives.idl:
        * html/canvas/OESTextureFloat.cpp:
        (WebCore::OESTextureFloat::OESTextureFloat):
        (WebCore::OESTextureFloat::create):
        * html/canvas/OESTextureFloat.h:
        * html/canvas/OESTextureFloat.idl:
        * html/canvas/OESVertexArrayObject.cpp:
        (WebCore::OESVertexArrayObject::OESVertexArrayObject):
        (WebCore::OESVertexArrayObject::create):
        * html/canvas/OESVertexArrayObject.h:
        * html/canvas/OESVertexArrayObject.idl:
        * html/canvas/WebGLExtension.cpp:
        (WebCore::WebGLExtension::WebGLExtension):
        * html/canvas/WebGLExtension.h:
        (WebCore::WebGLExtension::ref):
        (WebCore::WebGLExtension::deref):
        (WebCore::WebGLExtension::context):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::~WebGLRenderingContext):
        (WebCore::WebGLRenderingContext::getExtension):
        * html/canvas/WebGLRenderingContext.h:
        * html/canvas/WebKitLoseContext.cpp:
        (WebCore::WebKitLoseContext::WebKitLoseContext):
        (WebCore::WebKitLoseContext::create):
        (WebCore::WebKitLoseContext::loseContext):
        * html/canvas/WebKitLoseContext.h:
        * html/canvas/WebKitLoseContext.idl: Updated the ownership model for WebGL
        canavs rendering contexts to match the model for 2D canvas rendering
        contexts. This makes garbage collection a lot more straightforward, but
        it also makes the behavior of these objects more reliable. (Previously,
        satellite objects would magically stop working when the last reference
        to their owner object was dropped. Now, satellite objects keep their owner
        alive through reference counting.)

        * 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:
        * page/WorkerNavigator.idl:
        * plugins/DOMMimeTypeArray.h:
        (WebCore::DOMMimeTypeArray::frame):
        * plugins/DOMMimeTypeArray.idl:
        * plugins/DOMPluginArray.h:
        (WebCore::DOMPluginArray::frame):
        * plugins/DOMPluginArray.idl:
        * storage/Storage.idl:
        * workers/WorkerLocation.idl: Opt in to autogeneration.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::~XMLHttpRequest):
        * xml/XMLHttpRequest.h:
        * xml/XMLHttpRequestUpload.cpp:
        (WebCore::XMLHttpRequestUpload::scriptExecutionContext):
        * xml/XMLHttpRequestUpload.h:
        (WebCore::XMLHttpRequestUpload::create):
        (WebCore::XMLHttpRequestUpload::ref):
        (WebCore::XMLHttpRequestUpload::deref):
        (WebCore::XMLHttpRequestUpload::xmlHttpRequest):
        (WebCore::XMLHttpRequestUpload::toXMLHttpRequestUpload):
        * xml/XMLHttpRequestUpload.idl: Updated the ownership model for XHR and
        its associated upload object to match the model for canvas. This makes
        garbage collection a lot more straightforward, but it also makes the
        behavior of these objects more reliable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

80 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMImplementationCustom.cpp
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSDOMTokenListCustom.cpp
Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
Source/WebCore/bindings/js/JSMediaListCustom.cpp
Source/WebCore/bindings/js/JSMessageChannelCustom.cpp
Source/WebCore/bindings/js/JSMessagePortCustom.cpp
Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.h
Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/css/CSSRule.idl
Source/WebCore/css/CSSStyleDeclaration.idl
Source/WebCore/css/MediaList.idl
Source/WebCore/css/StyleMedia.idl
Source/WebCore/css/StyleSheet.idl
Source/WebCore/css/StyleSheetList.idl
Source/WebCore/dom/DOMImplementation.idl
Source/WebCore/dom/DOMStringMap.idl
Source/WebCore/dom/MessagePort.idl
Source/WebCore/dom/NamedNodeMap.idl
Source/WebCore/fileapi/Blob.idl
Source/WebCore/html/DOMTokenList.idl
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLCollection.idl
Source/WebCore/html/canvas/ArrayBuffer.idl
Source/WebCore/html/canvas/CanvasRenderingContext.cpp
Source/WebCore/html/canvas/CanvasRenderingContext.h
Source/WebCore/html/canvas/CanvasRenderingContext.idl
Source/WebCore/html/canvas/CanvasRenderingContext2D.h
Source/WebCore/html/canvas/OESStandardDerivatives.cpp
Source/WebCore/html/canvas/OESStandardDerivatives.h
Source/WebCore/html/canvas/OESStandardDerivatives.idl
Source/WebCore/html/canvas/OESTextureFloat.cpp
Source/WebCore/html/canvas/OESTextureFloat.h
Source/WebCore/html/canvas/OESTextureFloat.idl
Source/WebCore/html/canvas/OESVertexArrayObject.cpp
Source/WebCore/html/canvas/OESVertexArrayObject.h
Source/WebCore/html/canvas/OESVertexArrayObject.idl
Source/WebCore/html/canvas/WebGLExtension.cpp
Source/WebCore/html/canvas/WebGLExtension.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.h
Source/WebCore/html/canvas/WebKitLoseContext.cpp
Source/WebCore/html/canvas/WebKitLoseContext.h
Source/WebCore/html/canvas/WebKitLoseContext.idl
Source/WebCore/loader/appcache/DOMApplicationCache.idl
Source/WebCore/page/BarInfo.idl
Source/WebCore/page/Console.idl
Source/WebCore/page/DOMSelection.idl
Source/WebCore/page/Geolocation.idl
Source/WebCore/page/History.idl
Source/WebCore/page/Location.idl
Source/WebCore/page/Navigator.idl
Source/WebCore/page/Screen.idl
Source/WebCore/page/WorkerNavigator.idl
Source/WebCore/plugins/DOMMimeTypeArray.h
Source/WebCore/plugins/DOMMimeTypeArray.idl
Source/WebCore/plugins/DOMPluginArray.h
Source/WebCore/plugins/DOMPluginArray.idl
Source/WebCore/storage/Storage.idl
Source/WebCore/workers/WorkerLocation.idl
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequest.h
Source/WebCore/xml/XMLHttpRequestUpload.cpp
Source/WebCore/xml/XMLHttpRequestUpload.h
Source/WebCore/xml/XMLHttpRequestUpload.idl

index 32ca0e0..d0f90ef 100644 (file)
@@ -1,3 +1,172 @@
+2011-04-24  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Removed a use of markDOMObjectWrapper: WebGL, XHR, workers; plus, more autogeneration
+        https://bugs.webkit.org/show_bug.cgi?id=59307
+
+        * WebCore.xcodeproj/project.pbxproj: Added Blob.idl, so it's easier to edit.
+
+        * bindings/js/JSCSSRuleCustom.cpp:
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        * bindings/js/JSCanvasRenderingContextCustom.cpp:
+        * bindings/js/JSDOMApplicationCacheCustom.cpp: Autogenerate these instead
+        of hand-coding them.
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::root): Moved some GC helpers here from JSNodeCustom.h, because
+        they're reasonably generic.
+
+        * bindings/js/JSDOMImplementationCustom.cpp:
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        * bindings/js/JSDOMTokenListCustom.cpp:
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        * bindings/js/JSMediaListCustom.cpp: Autogenerate these instead of
+        hand-coding them.
+
+        * bindings/js/JSMessageChannelCustom.cpp:
+        (WebCore::JSMessageChannel::visitChildren):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::JSMessagePort::visitChildren): Use addOpaqueRoot instead of
+        markDOMObjectWrapper. This is one of the few cases where a DOM object is
+        considered a stand-alone root. It's not as efficient as the shared root
+        case, but workers and message ports are very rare objects, so it's no
+        big deal.
+
+        * bindings/js/JSNamedNodeMapCustom.cpp: Autogenerate!
+
+        * bindings/js/JSNodeCustom.h: Moved to JSDOMBinding.h.
+
+        * bindings/js/JSSharedWorkerCustom.cpp:
+        (WebCore::JSSharedWorker::visitChildren): Use addOpaqueRoot instead of
+        markDOMObjectWrapper, as above. Once again, a stand-alone root.
+
+        * bindings/js/JSStyleSheetCustom.cpp:
+        * bindings/js/JSStyleSheetListCustom.cpp: Autogenerate!
+
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::JSWebGLRenderingContext::visitChildren): Use the opaque roots
+        system for marking WebGL contexts and their associated satellite objects.
+
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::visitChildren):
+        * bindings/js/JSXMLHttpRequestCustom.cpp: Use addOpaqueRoot instead of
+        markDOMObjectWrapper, as above. Once again, stand-alone roots.
+
+        (WebCore::JSXMLHttpRequest::visitChildren):
+        * bindings/js/JSXMLHttpRequestUploadCustom.cpp: No need to mark our owner
+        XHR because it is not reachable from us.
+
+        * bindings/scripts/CodeGeneratorJS.pm: Added autogeneration support for a
+        bunch of repetitive cases of isReachableFromOpaqueRoots callbacks.
+
+        * css/CSSRule.idl:
+        * css/CSSStyleDeclaration.idl:
+        * css/MediaList.idl:
+        * css/StyleMedia.idl:
+        * css/StyleSheet.idl:
+        * css/StyleSheetList.idl:
+        * dom/DOMImplementation.idl:
+        * dom/DOMStringMap.idl:
+        * dom/MessagePort.idl:
+        * dom/NamedNodeMap.idl:
+        * fileapi/Blob.idl:
+        * html/DOMTokenList.idl: Opt in to autogeneration.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::getContext): Standardized on PassOwnPtr/OwnPtr
+        usage, to reduce human error and make ownership rules more obvious.
+
+        * html/HTMLCollection.idl:
+        * html/canvas/ArrayBuffer.idl: Opt in to autogeneration.
+
+        * html/canvas/CanvasRenderingContext.cpp:
+        * html/canvas/CanvasRenderingContext.h:
+        (WebCore::CanvasRenderingContext::ref):
+        (WebCore::CanvasRenderingContext::deref):
+        * html/canvas/CanvasRenderingContext2D.h:
+        (WebCore::CanvasRenderingContext2D::create):
+        (WebCore::CanvasRenderingContext2D::state): Standardized on PassOwnPtr/OwnPtr
+        usage, to reduce human error and make ownership rules more obvious.
+        
+        Inlined some functions to match our standard idiom and to make the code
+        in the header document itself.
+
+        * html/canvas/CanvasRenderingContext.idl: Opt in to autogeneration.
+
+        * html/canvas/OESStandardDerivatives.cpp:
+        (WebCore::OESStandardDerivatives::OESStandardDerivatives):
+        (WebCore::OESStandardDerivatives::create):
+        * html/canvas/OESStandardDerivatives.h:
+        * html/canvas/OESStandardDerivatives.idl:
+        * html/canvas/OESTextureFloat.cpp:
+        (WebCore::OESTextureFloat::OESTextureFloat):
+        (WebCore::OESTextureFloat::create):
+        * html/canvas/OESTextureFloat.h:
+        * html/canvas/OESTextureFloat.idl:
+        * html/canvas/OESVertexArrayObject.cpp:
+        (WebCore::OESVertexArrayObject::OESVertexArrayObject):
+        (WebCore::OESVertexArrayObject::create):
+        * html/canvas/OESVertexArrayObject.h:
+        * html/canvas/OESVertexArrayObject.idl:
+        * html/canvas/WebGLExtension.cpp:
+        (WebCore::WebGLExtension::WebGLExtension):
+        * html/canvas/WebGLExtension.h:
+        (WebCore::WebGLExtension::ref):
+        (WebCore::WebGLExtension::deref):
+        (WebCore::WebGLExtension::context):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::~WebGLRenderingContext):
+        (WebCore::WebGLRenderingContext::getExtension):
+        * html/canvas/WebGLRenderingContext.h:
+        * html/canvas/WebKitLoseContext.cpp:
+        (WebCore::WebKitLoseContext::WebKitLoseContext):
+        (WebCore::WebKitLoseContext::create):
+        (WebCore::WebKitLoseContext::loseContext):
+        * html/canvas/WebKitLoseContext.h:
+        * html/canvas/WebKitLoseContext.idl: Updated the ownership model for WebGL
+        canavs rendering contexts to match the model for 2D canvas rendering
+        contexts. This makes garbage collection a lot more straightforward, but
+        it also makes the behavior of these objects more reliable. (Previously,
+        satellite objects would magically stop working when the last reference
+        to their owner object was dropped. Now, satellite objects keep their owner
+        alive through reference counting.)
+
+        * 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:
+        * page/WorkerNavigator.idl:
+        * plugins/DOMMimeTypeArray.h:
+        (WebCore::DOMMimeTypeArray::frame):
+        * plugins/DOMMimeTypeArray.idl:
+        * plugins/DOMPluginArray.h:
+        (WebCore::DOMPluginArray::frame):
+        * plugins/DOMPluginArray.idl:
+        * storage/Storage.idl:
+        * workers/WorkerLocation.idl: Opt in to autogeneration.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::~XMLHttpRequest):
+        * xml/XMLHttpRequest.h:
+        * xml/XMLHttpRequestUpload.cpp:
+        (WebCore::XMLHttpRequestUpload::scriptExecutionContext):
+        * xml/XMLHttpRequestUpload.h:
+        (WebCore::XMLHttpRequestUpload::create):
+        (WebCore::XMLHttpRequestUpload::ref):
+        (WebCore::XMLHttpRequestUpload::deref):
+        (WebCore::XMLHttpRequestUpload::xmlHttpRequest):
+        (WebCore::XMLHttpRequestUpload::toXMLHttpRequestUpload):
+        * xml/XMLHttpRequestUpload.idl: Updated the ownership model for XHR and
+        its associated upload object to match the model for canvas. This makes
+        garbage collection a lot more straightforward, but it also makes the
+        behavior of these objects more reliable.
+
 2011-04-24  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r84759.
index 88c2d42..4abb250 100644 (file)
                14947FFC12F80CD200A0F631 /* DocumentOrderedMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentOrderedMap.h; sourceTree = "<group>"; };
                14993BE30B2F2B1C0050497F /* FocusController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FocusController.cpp; sourceTree = "<group>"; };
                14993BE40B2F2B1C0050497F /* FocusController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FocusController.h; sourceTree = "<group>"; };
+               14A98E05136386A200C9FED2 /* Blob.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Blob.idl; path = ../../../webkit/Source/WebCore/fileapi/Blob.idl; sourceTree = SOURCE_ROOT; };
                14C9A5E90B3D105F005A0232 /* Settings.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Settings.cpp; sourceTree = "<group>"; };
                14CD8D81106B529000A46D23 /* JSSharedWorkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSharedWorkerCustom.cpp; sourceTree = "<group>"; };
                14CF787109F587CA00EB3665 /* CSSValue.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSValue.idl; sourceTree = "<group>"; };
                                976D6C74122B8A3D001FD1F7 /* AsyncFileWriterClient.h */,
                                976D6C59122B8A3D001FD1F7 /* Blob.cpp */,
                                976D6C5A122B8A3D001FD1F7 /* Blob.h */,
+                               14A98E05136386A200C9FED2 /* Blob.idl */,
                                976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */,
                                976D6C60122B8A3D001FD1F7 /* BlobURL.h */,
                                89878539122CA064003AABDA /* DirectoryEntry.cpp */,
index 4eb3095..7e8817a 100644 (file)
@@ -48,14 +48,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSCSSRuleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSCSSRule* jsCSSRule = static_cast<JSCSSRule*>(handle.get().asCell());
-    if (!jsCSSRule->hasCustomProperties())
-        return false;
-    return markStack.containsOpaqueRoot(root(jsCSSRule->impl()));
-}
-
 void JSCSSRule::visitChildren(SlotVisitor& visitor)
 {
     Base::visitChildren(visitor);
index 4bd3d68..0f1bb21 100644 (file)
@@ -44,12 +44,6 @@ using namespace WTF;
 
 namespace WebCore {
 
-bool JSCSSStyleDeclarationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell());
-    return markStack.containsOpaqueRoot(root(jsCSSStyleDeclaration->impl()));
-}
-
 void JSCSSStyleDeclaration::visitChildren(SlotVisitor& visitor)
 {
     Base::visitChildren(visitor);
index ab21065..53506e5 100644 (file)
@@ -39,14 +39,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSCanvasRenderingContextOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSCanvasRenderingContext* jsCanvasRenderingContext = static_cast<JSCanvasRenderingContext*>(handle.get().asCell());
-    if (!jsCanvasRenderingContext->hasCustomProperties())
-        return false;
-    return markStack.containsOpaqueRoot(root(jsCanvasRenderingContext->impl()->canvas()));
-}
-
 void JSCanvasRenderingContext::visitChildren(SlotVisitor& visitor)
 {
     Base::visitChildren(visitor);
index 0aee530..263f2f9 100644 (file)
@@ -42,25 +42,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-static inline bool isObservable(JSDOMApplicationCache* jsDOMApplicationCache, DOMApplicationCache* domApplicationCache)
-{
-    if (jsDOMApplicationCache->hasCustomProperties())
-        return true;
-    if (domApplicationCache->hasEventListeners())
-        return true;
-    return false;
-}
-
-bool JSDOMApplicationCacheOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
-{
-    JSDOMApplicationCache* jsDOMApplicationCache = static_cast<JSDOMApplicationCache*>(handle.get().asCell());
-    DOMApplicationCache* domApplicationCache = jsDOMApplicationCache->impl();
-    Frame* frame = jsDOMApplicationCache->impl()->frame();
-    if (!frame)
-        return false;
-    return isObservable(jsDOMApplicationCache, domApplicationCache) && visitor.containsOpaqueRoot(frame);
-}
-
 #if ENABLE(APPLICATION_CACHE_DYNAMIC_ENTRIES)
 
 JSValue JSDOMApplicationCache::hasItem(ExecState* exec)
index bd15fea..e03f612 100644 (file)
@@ -26,6 +26,8 @@
 #include "JSDOMWrapper.h"
 #include "DOMWrapperWorld.h"
 #include "Document.h"
+#include "Element.h"
+#include "StyleBase.h"
 #include <heap/Weak.h>
 #include <runtime/Completion.h>
 #include <runtime/Lookup.h>
@@ -39,6 +41,7 @@ namespace JSC {
 
 namespace WebCore {
 
+    class CSSValue;
     class Document;
     class Frame;
     class JSNode;
@@ -199,6 +202,28 @@ namespace WebCore {
         return createWrapper<WrapperClass>(exec, globalObject, domObject);
     }
 
+    inline void* root(Node* node)
+    {
+        if (node->inDocument())
+            return node->document();
+
+        while (node->parentNode())
+            node = node->parentNode();
+        return node;
+    }
+
+    inline void* root(StyleBase* styleBase)
+    {
+        while (styleBase->parent())
+            styleBase = styleBase->parent();
+
+        if (Node* node = styleBase->node())
+            return root(node);
+        return styleBase;
+    }
+
+    HashMap<CSSValue*, void*>& cssValueRoots();
+
     const JSC::HashTable* getHashTableForGlobalData(JSC::JSGlobalData&, const JSC::HashTable* staticTable);
 
     void reportException(JSC::ExecState*, JSC::JSValue exception);
index d02a3f8..8865849 100644 (file)
@@ -29,12 +29,4 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSDOMImplementationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
-{
-    JSDOMImplementation* jsDOMImplementation = static_cast<JSDOMImplementation*>(handle.get().asCell());
-    if (!jsDOMImplementation->hasCustomProperties())
-        return false;
-    return visitor.containsOpaqueRoot(jsDOMImplementation->impl()->document());
-}
-
 }
index 9b389ef..0c34836 100644 (file)
@@ -35,14 +35,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSDOMStringMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
-{
-    JSDOMStringMap* jsDOMStringMap = static_cast<JSDOMStringMap*>(handle.get().asCell());
-    if (!jsDOMStringMap->hasCustomProperties())
-        return false;
-    return visitor.containsOpaqueRoot(root(jsDOMStringMap->impl()->element()));
-}
-
 bool JSDOMStringMap::canGetItemsForName(ExecState*, DOMStringMap* impl, const Identifier& propertyName)
 {
     return impl->contains(identifierToAtomicString(propertyName));
index 540c330..01fbb70 100644 (file)
@@ -34,15 +34,4 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSDOMTokenListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
-{
-    JSDOMTokenList* jsDOMTokenList = static_cast<JSDOMTokenList*>(handle.get().asCell());
-    if (!jsDOMTokenList->hasCustomProperties())
-        return false;
-    Element* element = jsDOMTokenList->impl()->element();
-    if (!element)
-        return false;
-    return visitor.containsOpaqueRoot(root(element));
-}
-
 } // namespace WebCore
index 6f4bc1e..622a15a 100644 (file)
@@ -37,14 +37,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSHTMLCollectionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSHTMLCollection* jsHTMLCollection = static_cast<JSHTMLCollection*>(handle.get().asCell());
-    if (!jsHTMLCollection->hasCustomProperties())
-        return false;
-    return markStack.containsOpaqueRoot(root(jsHTMLCollection->impl()->base()));
-}
-
 static JSValue getNamedItems(ExecState* exec, JSHTMLCollection* collection, const Identifier& propertyName)
 {
     Vector<RefPtr<Node> > namedItems;
index dcf7f1f..5c7299e 100644 (file)
@@ -33,12 +33,4 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSMediaListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSMediaList* jsMediaList = static_cast<JSMediaList*>(handle.get().asCell());
-    if (!jsMediaList->hasCustomProperties())
-        return false;
-    return markStack.containsOpaqueRoot(root(jsMediaList->impl()));
-}
-
 } // namespace WebCore
index 0a0efbe..6e8aa1a 100644 (file)
@@ -38,10 +38,10 @@ void JSMessageChannel::visitChildren(SlotVisitor& visitor)
     Base::visitChildren(visitor);
 
     if (MessagePort* port = m_impl->port1())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), port);
+        visitor.addOpaqueRoot(port);
 
     if (MessagePort* port = m_impl->port2())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), port);
+        visitor.addOpaqueRoot(port);
 }
 
 EncodedJSValue JSC_HOST_CALL JSMessageChannelConstructor::constructJSMessageChannel(ExecState* exec)
index a849876..1bea4f7 100644 (file)
@@ -46,8 +46,8 @@ void JSMessagePort::visitChildren(SlotVisitor& visitor)
     Base::visitChildren(visitor);
 
     // If we have a locally entangled port, we can directly mark it as reachable. Ports that are remotely entangled are marked in-use by markActiveObjectsForContext().
-    if (MessagePort* entangledPort = m_impl->locallyEntangledPort())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), entangledPort);
+    if (MessagePort* port = m_impl->locallyEntangledPort())
+        visitor.addOpaqueRoot(port);
 
     m_impl->visitJSEventListeners(visitor);
 }
index f83d74f..1a36e33 100644 (file)
@@ -35,17 +35,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
-{
-    JSNamedNodeMap* jsNamedNodeMap = static_cast<JSNamedNodeMap*>(handle.get().asCell());
-    if (!jsNamedNodeMap->hasCustomProperties())
-        return false;
-    Element* element = jsNamedNodeMap->impl()->element();
-    if (!element)
-        return false;
-    return visitor.containsOpaqueRoot(root(element));
-}
-
 bool JSNamedNodeMap::canGetItemsForName(ExecState*, NamedNodeMap* impl, const Identifier& propertyName)
 {
     return impl->getNamedItem(identifierToString(propertyName));
index 5464ce3..54c1a77 100644 (file)
@@ -32,8 +32,6 @@
 
 namespace WebCore {
 
-class CSSValue;
-
 inline JSDOMWrapper* getInlineCachedWrapper(DOMWrapperWorld* world, Node* node)
 {
     if (!world->isNormal())
@@ -73,28 +71,6 @@ inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject,
     return createWrapper(exec, globalObject, node);
 }
 
-static inline void* root(Node* node)
-{
-    if (node->inDocument())
-        return node->document();
-
-    while (node->parentNode())
-        node = node->parentNode();
-    return node;
-}
-
-static inline void* root(StyleBase* styleBase)
-{
-    while (styleBase->parent())
-        styleBase = styleBase->parent();
-
-    if (Node* node = styleBase->node())
-        return root(node);
-    return styleBase;
-}
-
-HashMap<CSSValue*, void*>& cssValueRoots();
-
 }
 
 #endif // JSDOMNodeCustom_h
index 34b9c3c..3023bb2 100644 (file)
@@ -48,7 +48,7 @@ void JSSharedWorker::visitChildren(SlotVisitor& visitor)
     Base::visitChildren(visitor);
 
     if (MessagePort* port = impl()->port())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), port);
+        visitor.addOpaqueRoot(port);
 }
 
 EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(ExecState* exec)
index 2e8a420..8341da6 100644 (file)
@@ -35,14 +35,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSStyleSheetOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSStyleSheet* jsStyleSheet = static_cast<JSStyleSheet*>(handle.get().asCell());
-    if (!jsStyleSheet->hasCustomProperties())
-        return false;
-    return markStack.containsOpaqueRoot(root(jsStyleSheet->impl()));
-}
-
 void JSStyleSheet::visitChildren(SlotVisitor& visitor)
 {
     Base::visitChildren(visitor);
index 1305906..a2c8b67 100644 (file)
@@ -35,17 +35,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSStyleSheetListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, MarkStack& markStack)
-{
-    JSStyleSheetList* jsStyleSheetList = static_cast<JSStyleSheetList*>(handle.get().asCell());
-    if (!jsStyleSheetList->hasCustomProperties())
-        return false;
-    Document* document = jsStyleSheetList->impl()->document();
-    if (!document)
-        return false;
-    return markStack.containsOpaqueRoot(document);
-}
-
 bool JSStyleSheetList::canGetItemsForName(ExecState*, StyleSheetList* styleSheetList, const Identifier& propertyName)
 {
     return styleSheetList->getNamedItem(identifierToString(propertyName));
index 617c4ab..5efc61a 100644 (file)
@@ -195,10 +195,7 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
 void JSWebGLRenderingContext::visitChildren(SlotVisitor& visitor)
 {
     Base::visitChildren(visitor);
-
-    WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl());
-    for (int i = 0; i < context->getNumberOfExtensions(); ++i)
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), context->getExtensionNumber(i));
+    visitor.addOpaqueRoot(impl());
 }
 
 JSValue JSWebGLRenderingContext::getAttachedShaders(ExecState* exec)
index 53c6b98..5d3b5ff 100644 (file)
@@ -61,8 +61,10 @@ void JSWorkerContext::visitChildren(SlotVisitor& visitor)
 
     visitActiveObjectsForContext(visitor, globalData, scriptExecutionContext());
 
-    markDOMObjectWrapper(visitor, globalData, impl()->optionalLocation());
-    markDOMObjectWrapper(visitor, globalData, impl()->optionalNavigator());
+    if (WorkerLocation* location = impl()->optionalLocation())
+        visitor.addOpaqueRoot(location);
+    if (WorkerNavigator* navigator = impl()->optionalNavigator())
+        visitor.addOpaqueRoot(navigator);
 
     impl()->visitJSEventListeners(visitor);
 }
index 8dd1761..6486a4c 100644 (file)
@@ -59,17 +59,17 @@ void JSXMLHttpRequest::visitChildren(SlotVisitor& visitor)
     Base::visitChildren(visitor);
 
     if (XMLHttpRequestUpload* upload = m_impl->optionalUpload())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), upload);
+        visitor.addOpaqueRoot(upload);
 
     if (Document* responseDocument = m_impl->optionalResponseXML())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), responseDocument);
+        visitor.addOpaqueRoot(responseDocument);
 
     if (ArrayBuffer* responseArrayBuffer = m_impl->optionalResponseArrayBuffer())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), responseArrayBuffer);
+        visitor.addOpaqueRoot(responseArrayBuffer);
 
 #if ENABLE(XHR_RESPONSE_BLOB)
     if (Blob* responseBlob = m_impl->optionalResponseBlob())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), responseBlob);
+        visitor.addOpaqueRoot(responseBlob);
 #endif
 
     m_impl->visitJSEventListeners(visitor);
index 6b80bb4..04c5f63 100644 (file)
@@ -41,14 +41,4 @@ using namespace JSC;
 
 namespace WebCore {
 
-void JSXMLHttpRequestUpload::visitChildren(SlotVisitor& visitor)
-{
-    Base::visitChildren(visitor);
-
-    if (XMLHttpRequest* xmlHttpRequest = m_impl->associatedXMLHttpRequest())
-        markDOMObjectWrapper(visitor, *Heap::heap(this)->globalData(), xmlHttpRequest);
-
-    m_impl->visitJSEventListeners(visitor);
-}
-
 } // namespace WebCore
index bacd81d..2fe6de7 100644 (file)
@@ -914,7 +914,7 @@ sub GenerateHeader
         push(@headerContent, "}\n\n");
     }
 
-    if ($dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"CustomFinalize"}) {
+    if ($dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"CustomFinalize"}) {
         push(@headerContent, "class JS${implType}Owner : public JSC::WeakHandleOwner {\n");
         push(@headerContent, "    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);\n");
         push(@headerContent, "    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);\n");
@@ -2126,28 +2126,61 @@ sub GenerateImplementation
         }
     }
 
-    if ($dataNode->extendedAttributes->{"CustomIsReachable"}) {
-        if ($dataNode->extendedAttributes->{"CustomIsReachable"} eq "Frame") {
-            push(@implContent, "bool JS${implType}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
-            push(@implContent, "    if (!js${implType}->hasCustomProperties())\n");
-            push(@implContent, "        return false;\n");
-            push(@implContent, "    Frame* frame = js${implType}->impl()->frame();\n");
-            push(@implContent, "    if (!frame)\n");
-            push(@implContent, "        return false;\n");
-            push(@implContent, "    return visitor.containsOpaqueRoot(frame);\n");
-            push(@implContent, "}\n\n");
+    if ($dataNode->extendedAttributes->{"GenerateIsReachable"}) {
+        push(@implContent, "static inline bool isObservable(JS${implType}* js${implType})\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    if (js${implType}->hasCustomProperties())\n");
+        push(@implContent, "        return true;\n");
+        if ($eventTarget) {
+            push(@implContent, "    if (js${implType}->impl()->hasEventListeners())\n");
+            push(@implContent, "        return true;\n");
         }
+        push(@implContent, "    return false;\n");
+        push(@implContent, "}\n\n");
 
-        if (!$dataNode->extendedAttributes->{"CustomFinalize"}) {
-            push(@implContent, "void JS${implType}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
-            push(@implContent, "    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n");
-            push(@implContent, "    uncacheWrapper(world, js${implType}->impl(), js${implType});\n");
-            push(@implContent, "}\n\n");
+        my $rootString;
+        if ($dataNode->extendedAttributes->{"GenerateIsReachable"} eq "Impl") {
+            $rootString  = "    ${implType}* root = js${implType}->impl();\n";
+        } elsif ($dataNode->extendedAttributes->{"GenerateIsReachable"} eq "ImplContext") {
+            $rootString  = "    WebGLRenderingContext* root = js${implType}->impl()->context();\n";
+        } elsif ($dataNode->extendedAttributes->{"GenerateIsReachable"} eq "ImplFrame") {
+            $rootString  = "    Frame* root = js${implType}->impl()->frame();\n";
+            $rootString .= "    if (!root)\n";
+            $rootString .= "        return false;\n";
+        } elsif ($dataNode->extendedAttributes->{"GenerateIsReachable"} eq "ImplDocument") {
+            $rootString  = "    Document* root = js${implType}->impl()->document();\n";
+            $rootString .= "    if (!root)\n";
+            $rootString .= "        return false;\n";
+        } elsif ($dataNode->extendedAttributes->{"GenerateIsReachable"} eq "ImplElementRoot") {
+            $rootString  = "    Element* element = js${implType}->impl()->element();\n";
+            $rootString .= "    if (!element)\n";
+            $rootString .= "        return false;\n";
+            $rootString .= "    void* root = WebCore::root(element);\n";
+        } elsif ($interfaceName eq "CanvasRenderingContext") {
+            $rootString  = "    void* root = WebCore::root(js${implType}->impl()->canvas());\n";
+        } elsif ($interfaceName eq "HTMLCollection") {
+            $rootString  = "    void* root = WebCore::root(js${implType}->impl()->base());\n";
+        } else {
+            $rootString  = "    void* root = WebCore::root(js${implType}->impl());\n";
         }
+
+        push(@implContent, "bool JS${implType}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
+        push(@implContent, "    if (!isObservable(js${implType}))\n");
+        push(@implContent, "        return false;\n");
+        push(@implContent, $rootString);
+        push(@implContent, "    return visitor.containsOpaqueRoot(root);\n");
+        push(@implContent, "}\n\n");
+    }
+
+    if ($dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"CustomIsReachable"} && !$dataNode->extendedAttributes->{"CustomFinalize"}) {
+        push(@implContent, "void JS${implType}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    JS${implType}* js${implType} = static_cast<JS${implType}*>(handle.get().asCell());\n");
+        push(@implContent, "    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n");
+        push(@implContent, "    uncacheWrapper(world, js${implType}->impl(), js${implType});\n");
+        push(@implContent, "}\n\n");
     }
 
     if ((!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !$dataNode->extendedAttributes->{"CustomToJS"}) {
index ef78783..825bc6c 100644 (file)
@@ -23,7 +23,7 @@ module css {
     // Introduced in DOM Level 2:
     interface [
         CustomMarkFunction,
-        CustomIsReachable,
+        GenerateIsReachable,
         CustomToJS,
         Polymorphic
     ] CSSRule {
index 6002256..2753332 100644 (file)
@@ -23,7 +23,7 @@ module css {
     // Introduced in DOM Level 2:
     interface [
         CustomMarkFunction,
-        CustomIsReachable,
+        GenerateIsReachable=ImplRoot,
         DelegatingPutFunction,
         HasNameGetter,
         HasIndexGetter
index 4d344e3..e8df0f9 100644 (file)
@@ -27,7 +27,7 @@ module stylesheets {
 
     // Introduced in DOM Level 2:
     interface [
-        CustomIsReachable,
+        GenerateIsReachable,
         HasIndexGetter
     ] MediaList {
 
index e5cf267..db86fe3 100644 (file)
@@ -26,7 +26,7 @@
 
 module view {
     interface [
-        CustomIsReachable=Frame
+        GenerateIsReachable=ImplFrame
     ] StyleMedia {
         readonly attribute DOMString type;
         boolean matchMedium(in DOMString mediaquery);
index 904510e..d3c7359 100644 (file)
@@ -23,7 +23,7 @@ module stylesheets {
     // Introduced in DOM Level 2:
     interface [
         CustomMarkFunction,
-        CustomIsReachable,
+        GenerateIsReachable,
         CustomToJS,
         Polymorphic
     ] StyleSheet {
index b01b4ee..babfc75 100644 (file)
@@ -22,7 +22,7 @@ module stylesheets {
 
     // Introduced in DOM Level 2:
     interface [
-        CustomIsReachable,
+        GenerateIsReachable=ImplDocument,
         HasIndexGetter,
         HasNameGetter
     ] StyleSheetList {
index bbcf4c1..e8ac594 100644 (file)
@@ -21,7 +21,7 @@
 module core {
 
     interface [
-        CustomIsReachable
+        GenerateIsReachable=ImplDocument
     ] DOMImplementation {
 
         // DOM Level 1
index 4e75979..3546518 100644 (file)
@@ -26,7 +26,7 @@
 module core {
 
     interface [
-        CustomIsReachable,
+        GenerateIsReachable=ImplElementRoot,
         HasNameGetter,
         CustomDeleteProperty,
         CustomGetPropertyNames,
index 7bde45e..ef23a47 100644 (file)
@@ -28,6 +28,7 @@ module events {
 
     interface [
         CustomMarkFunction,
+        GenerateIsReachable=Impl,
         EventTarget,
         NoStaticTables
     ] MessagePort {
index 4a7800c..801eb14 100644 (file)
@@ -21,7 +21,7 @@
 module core {
 
     interface [
-        CustomIsReachable,
+        GenerateIsReachable=ImplElementRoot,
         CustomMarkFunction,
         HasIndexGetter,
         HasNameGetter
index 8511c8e..c03d2d3 100644 (file)
@@ -31,6 +31,7 @@
 module html {
 
     interface [
+        GenerateIsReachable=Impl,
         NoStaticTables
     ] Blob {
         readonly attribute unsigned long long size;
index 33afb5a..f94491c 100644 (file)
@@ -25,7 +25,7 @@
 module core {
 
     interface [
-        CustomIsReachable,
+        GenerateIsReachable=ImplElementRoot,
         GenerateConstructor,
         HasIndexGetter
     ] DOMTokenList {
index b99cc89..774526b 100644 (file)
@@ -164,7 +164,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas
             if (Settings* settings = document()->settings())
                 usesDashbardCompatibilityMode = settings->usesDashboardBackwardCompatibilityMode();
 #endif
-            m_context = adoptPtr(new CanvasRenderingContext2D(this, document()->inQuirksMode(), usesDashbardCompatibilityMode));
+            m_context = CanvasRenderingContext2D::create(this, document()->inQuirksMode(), usesDashbardCompatibilityMode);
 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || (ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING))
             if (m_context) {
                 // Need to make sure a RenderLayer and compositing layer get created for the Canvas
index 0d9d1af..ca18a74 100644 (file)
@@ -25,7 +25,7 @@ module html {
         HasNameGetter,
         CustomCall,
         CustomToJS,
-        CustomIsReachable,
+        GenerateIsReachable,
         Polymorphic
     ] HTMLCollection {
         readonly attribute unsigned long length;
index 6f63e65..4ea917c 100644 (file)
@@ -26,6 +26,7 @@
 module html {
 
     interface [
+        GenerateIsReachable=Impl,
         CanBeConstructed,
         CustomConstructFunction,
         NoStaticTables,
index c814c66..1bb33ed 100644 (file)
@@ -41,16 +41,6 @@ CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas)
 {
 }
 
-void CanvasRenderingContext::ref()
-{
-    m_canvas->ref();
-}
-
-void CanvasRenderingContext::deref()
-{
-    m_canvas->deref(); 
-}
-
 void CanvasRenderingContext::checkOrigin(const CanvasPattern* pattern)
 {
     if (canvas()->originClean() && pattern && !pattern->originClean())
index a143596..a22773a 100644 (file)
@@ -27,7 +27,7 @@
 #define CanvasRenderingContext_h
 
 #include "GraphicsLayer.h"
-
+#include "HTMLCanvasElement.h"
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/StringHash.h>
@@ -44,13 +44,10 @@ class WebGLObject;
 class CanvasRenderingContext {
     WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); WTF_MAKE_FAST_ALLOCATED;
 public:
-    CanvasRenderingContext(HTMLCanvasElement*);
     virtual ~CanvasRenderingContext() { }
 
-    // Ref and deref the m_canvas
-    void ref();
-    void deref();
-
+    void ref() { m_canvas->ref(); }
+    void deref() { m_canvas->deref(); }
     HTMLCanvasElement* canvas() const { return m_canvas; }
 
     virtual bool is2d() const { return false; }
@@ -65,6 +62,7 @@ public:
 #endif
 
 protected:
+    CanvasRenderingContext(HTMLCanvasElement*);
     void checkOrigin(const CanvasPattern*);
     void checkOrigin(const HTMLCanvasElement*);
     void checkOrigin(const HTMLImageElement*);
index e5e1887..b53bdce 100644 (file)
@@ -27,7 +27,7 @@ module html {
 
     interface [
         CustomMarkFunction,
-        CustomIsReachable,
+        GenerateIsReachable,
         CustomToJS,
         InterfaceUUID=98fb48ae-7216-489c-862b-8e1217fc4443,
         ImplementationUUID=ab4f0781-152f-450e-9546-5b3987491a54
index fbaec9e..a1b5651 100644 (file)
@@ -67,8 +67,10 @@ typedef int ExceptionCode;
 
 class CanvasRenderingContext2D : public CanvasRenderingContext {
 public:
-    CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
-
+    static PassOwnPtr<CanvasRenderingContext2D> create(HTMLCanvasElement* canvas, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode)
+    {
+        return adoptPtr(new CanvasRenderingContext2D(canvas, usesCSSCompatibilityParseMode, usesDashboardCompatibilityMode));
+    }
     virtual ~CanvasRenderingContext2D();
 
     virtual bool is2d() const { return true; }
@@ -261,12 +263,6 @@ private:
         Font m_font;
         bool m_realizedFont;
     };
-    Path m_path;
-
-    State& state() { return m_stateStack.last(); }
-    const State& state() const { return m_stateStack.last(); }
-
-    void applyShadow();
 
     enum CanvasDidDrawOption {
         CanvasDidDrawApplyNone = 0,
@@ -276,6 +272,15 @@ private:
         CanvasDidDrawApplyAll = 0xffffffff
     };
 
+    CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
+
+    Path m_path;
+
+    State& state() { return m_stateStack.last(); }
+    const State& state() const { return m_stateStack.last(); }
+
+    void applyShadow();
+
     void didDraw(const FloatRect&, unsigned options = CanvasDidDrawApplyAll);
 
     GraphicsContext* drawingContext() const;
index 5bd3163..a91c193 100644 (file)
@@ -31,7 +31,8 @@
 
 namespace WebCore {
 
-OESStandardDerivatives::OESStandardDerivatives() : WebGLExtension()
+OESStandardDerivatives::OESStandardDerivatives(WebGLRenderingContext* context)
+    : WebGLExtension(context)
 {
 }
 
@@ -44,9 +45,9 @@ WebGLExtension::ExtensionName OESStandardDerivatives::getName() const
     return OESStandardDerivativesName;
 }
 
-PassRefPtr<OESStandardDerivatives> OESStandardDerivatives::create()
+PassOwnPtr<OESStandardDerivatives> OESStandardDerivatives::create(WebGLRenderingContext* context)
 {
-    return adoptRef(new OESStandardDerivatives);
+    return adoptPtr(new OESStandardDerivatives(context));
 }
 
 } // namespace WebCore
index c74e24f..af2ea14 100644 (file)
 #define OESStandardDerivatives_h
 
 #include "WebGLExtension.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
 class OESStandardDerivatives : public WebGLExtension {
 public:
-    static PassRefPtr<OESStandardDerivatives> create();
+    static PassOwnPtr<OESStandardDerivatives> create(WebGLRenderingContext*);
 
     virtual ~OESStandardDerivatives();
     virtual ExtensionName getName() const;
 
 private:
-    OESStandardDerivatives();
+    OESStandardDerivatives(WebGLRenderingContext*);
 };
 
 } // namespace WebCore
index 6c0f788..f1d4740 100644 (file)
  */
 
 module html {
-    interface [Conditional=WEBGL, OmitConstructor, DontCheckEnums] OESStandardDerivatives {
+    interface [
+        Conditional=WEBGL,
+        GenerateIsReachable=ImplContext,
+        OmitConstructor,
+        DontCheckEnums
+    ] OESStandardDerivatives {
         const unsigned int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
     };
 }
index 9518764..3ba150b 100644 (file)
@@ -31,7 +31,8 @@
 
 namespace WebCore {
 
-OESTextureFloat::OESTextureFloat() : WebGLExtension()
+OESTextureFloat::OESTextureFloat(WebGLRenderingContext* context)
+    : WebGLExtension(context)
 {
 }
 
@@ -44,9 +45,9 @@ WebGLExtension::ExtensionName OESTextureFloat::getName() const
     return OESTextureFloatName;
 }
 
-PassRefPtr<OESTextureFloat> OESTextureFloat::create()
+PassOwnPtr<OESTextureFloat> OESTextureFloat::create(WebGLRenderingContext* context)
 {
-    return adoptRef(new OESTextureFloat);
+    return adoptPtr(new OESTextureFloat(context));
 }
 
 } // namespace WebCore
index c99bb2f..21da31c 100644 (file)
 #define OESTextureFloat_h
 
 #include "WebGLExtension.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
 class OESTextureFloat : public WebGLExtension {
 public:
-    static PassRefPtr<OESTextureFloat> create();
+    static PassOwnPtr<OESTextureFloat> create(WebGLRenderingContext*);
 
     virtual ~OESTextureFloat();
     virtual ExtensionName getName() const;
 
 private:
-    OESTextureFloat();
+    OESTextureFloat(WebGLRenderingContext*);
 };
 
 } // namespace WebCore
index 3319fd9..950c355 100644 (file)
  */
 
 module html {
-    interface [Conditional=WEBGL, OmitConstructor] OESTextureFloat {
+    interface [
+        Conditional=WEBGL,
+        GenerateIsReachable=ImplContext,
+        OmitConstructor
+    ] OESTextureFloat {
     };
 }
index 5fb71c8..a26d706 100644 (file)
@@ -36,8 +36,7 @@
 namespace WebCore {
 
 OESVertexArrayObject::OESVertexArrayObject(WebGLRenderingContext* context)
-    : WebGLExtension()
-    , m_context(context)
+    : WebGLExtension(context)
 {
 }
 
@@ -50,9 +49,9 @@ WebGLExtension::ExtensionName OESVertexArrayObject::getName() const
     return OESVertexArrayObjectName;
 }
 
-PassRefPtr<OESVertexArrayObject> OESVertexArrayObject::create(WebGLRenderingContext* context)
+PassOwnPtr<OESVertexArrayObject> OESVertexArrayObject::create(WebGLRenderingContext* context)
 {
-    return adoptRef(new OESVertexArrayObject(context));
+    return adoptPtr(new OESVertexArrayObject(context));
 }
 
 PassRefPtr<WebGLVertexArrayObjectOES> OESVertexArrayObject::createVertexArrayOES()
index d9792da..796e9c6 100644 (file)
@@ -30,9 +30,7 @@
 #include "GraphicsTypes3D.h"
 #include "WebGLExtension.h"
 #include "WebGLVertexArrayObjectOES.h"
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/UnusedParam.h>
 
 namespace WebCore {
@@ -42,7 +40,7 @@ class WebGLVertexArrayObjectOES;
 
 class OESVertexArrayObject : public WebGLExtension {
 public:
-    static PassRefPtr<OESVertexArrayObject> create(WebGLRenderingContext*);
+    static PassOwnPtr<OESVertexArrayObject> create(WebGLRenderingContext*);
 
     virtual ~OESVertexArrayObject();
     virtual ExtensionName getName() const;
@@ -54,8 +52,6 @@ public:
 
 private:
     OESVertexArrayObject(WebGLRenderingContext*);
-    
-    WebGLRenderingContext* m_context;
 };
 
 } // namespace WebCore
index 911ebbc..8f272d8 100644 (file)
  */
 
 module html {
-    interface [Conditional=WEBGL, OmitConstructor, DontCheckEnums] OESVertexArrayObject {
+    interface [
+        Conditional=WEBGL, 
+        GenerateIsReachable=ImplContext,
+        OmitConstructor, 
+        DontCheckEnums
+    ] OESVertexArrayObject {
         const unsigned int VERTEX_ARRAY_BINDING_OES = 0x85B5;
         
         [StrictTypeChecking] WebGLVertexArrayObjectOES createVertexArrayOES();
index 64b0bf5..bf62eec 100644 (file)
@@ -31,7 +31,8 @@
 
 namespace WebCore {
 
-WebGLExtension::WebGLExtension()
+WebGLExtension::WebGLExtension(WebGLRenderingContext* context)
+    : m_context(context)
 {
 }
 
index 9a6753f..1966367 100644 (file)
 #ifndef WebGLExtension_h
 #define WebGLExtension_h
 
-#include <wtf/RefCounted.h>
+#include "WebGLRenderingContext.h"
 
 namespace WebCore {
 
-class WebGLExtension : public RefCounted<WebGLExtension> {
+class WebGLExtension {
 public:
     // Extension names are needed to properly wrap instances in JavaScript objects.
     enum ExtensionName {
@@ -40,11 +40,16 @@ public:
         OESVertexArrayObjectName,
     };
 
+    void ref() { m_context->ref(); }
+    void deref() { m_context->deref(); }
+    WebGLRenderingContext* context() { return m_context; }
+
     virtual ~WebGLExtension();
     virtual ExtensionName getName() const = 0;
 
 protected:
-    WebGLExtension();
+    WebGLExtension(WebGLRenderingContext*);
+    WebGLRenderingContext* m_context;
 };
 
 } // namespace WebCore
index fdeacee..6d95386 100644 (file)
@@ -474,8 +474,6 @@ WebGLRenderingContext::~WebGLRenderingContext()
 {
     detachAndRemoveAllObjects();
     m_context->setContextLostCallback(0);
-    if (m_webkitLoseContext)
-        m_webkitLoseContext->contextDestroyed();
 }
 
 void WebGLRenderingContext::markContextChanged()
@@ -1959,7 +1957,7 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
         && m_context->getExtensions()->supports("GL_OES_standard_derivatives")) {
         if (!m_oesStandardDerivatives) {
             m_context->getExtensions()->ensureEnabled("GL_OES_standard_derivatives");
-            m_oesStandardDerivatives = OESStandardDerivatives::create();
+            m_oesStandardDerivatives = OESStandardDerivatives::create(this);
         }
         return m_oesStandardDerivatives.get();
     }
@@ -1967,7 +1965,7 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
         && m_context->getExtensions()->supports("GL_OES_texture_float")) {
         if (!m_oesTextureFloat) {
             m_context->getExtensions()->ensureEnabled("GL_OES_texture_float");
-            m_oesTextureFloat = OESTextureFloat::create();
+            m_oesTextureFloat = OESTextureFloat::create(this);
         }
         return m_oesTextureFloat.get();
     }
@@ -4796,37 +4794,6 @@ void WebGLRenderingContext::restoreStatesAfterVertexAttrib0Simulation()
     m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, objectOrZero(m_boundArrayBuffer.get()));
 }
 
-int WebGLRenderingContext::getNumberOfExtensions()
-{
-    return (m_oesVertexArrayObject ? 1 : 0) + (m_oesStandardDerivatives ? 1 : 0) + (m_webkitLoseContext ? 1 : 0) + (m_oesTextureFloat ? 1 : 0);
-}
-
-WebGLExtension* WebGLRenderingContext::getExtensionNumber(int i)
-{
-    if (m_oesVertexArrayObject) {
-        if (!i)
-            return m_oesVertexArrayObject.get();
-        --i;
-    }
-    if (m_oesStandardDerivatives) {
-        if (!i)
-            return m_oesStandardDerivatives.get();
-        --i;
-    }
-    if (m_webkitLoseContext) {
-        if (!i)
-            return m_webkitLoseContext.get();
-        --i;
-    }
-    if (m_oesTextureFloat) {
-        if (!i)
-            return m_oesTextureFloat.get();
-        --i;
-    }
-    // Similar tests for other extensions would go here.
-    return 0;
-}
-
 WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity)
     : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity]))
     , m_capacity(capacity)
index 9cff0da..7792314 100644 (file)
@@ -293,10 +293,6 @@ public:
     
     unsigned getMaxVertexAttribs() const { return m_maxVertexAttribs; }
 
-    // Helpers for JSC bindings.
-    int getNumberOfExtensions();
-    WebGLExtension* getExtensionNumber(int i);
-
   private:
     friend class WebGLObject;
     friend class OESVertexArrayObject;
@@ -465,10 +461,10 @@ public:
     bool m_isDepthStencilSupported;
 
     // Enabled extension objects.
-    RefPtr<OESTextureFloat> m_oesTextureFloat;
-    RefPtr<OESStandardDerivatives> m_oesStandardDerivatives;
-    RefPtr<OESVertexArrayObject> m_oesVertexArrayObject;
-    RefPtr<WebKitLoseContext> m_webkitLoseContext;
+    OwnPtr<OESTextureFloat> m_oesTextureFloat;
+    OwnPtr<OESStandardDerivatives> m_oesStandardDerivatives;
+    OwnPtr<OESVertexArrayObject> m_oesVertexArrayObject;
+    OwnPtr<WebKitLoseContext> m_webkitLoseContext;
 
     // Helpers for getParameter and others
     WebGLGetInfo getBooleanParameter(GC3Denum);
index c594e32..2e2672e 100644 (file)
@@ -34,8 +34,7 @@
 namespace WebCore {
 
 WebKitLoseContext::WebKitLoseContext(WebGLRenderingContext* context)
-    : WebGLExtension()
-    , m_context(context)
+    : WebGLExtension(context)
 {
 }
 
@@ -48,15 +47,14 @@ WebGLExtension::ExtensionName WebKitLoseContext::getName() const
     return WebKitLoseContextName;
 }
 
-PassRefPtr<WebKitLoseContext> WebKitLoseContext::create(WebGLRenderingContext* context)
+PassOwnPtr<WebKitLoseContext> WebKitLoseContext::create(WebGLRenderingContext* context)
 {
-    return adoptRef(new WebKitLoseContext(context));
+    return adoptPtr(new WebKitLoseContext(context));
 }
 
 void WebKitLoseContext::loseContext()
 {
-    if (m_context)
-        m_context->forceLostContext();
+    m_context->forceLostContext();
 }
 
 } // namespace WebCore
index b713bef..a409997 100644 (file)
@@ -27,8 +27,7 @@
 #define WebKitLoseContext_h
 
 #include "WebGLExtension.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
@@ -36,18 +35,15 @@ class WebGLRenderingContext;
 
 class WebKitLoseContext : public WebGLExtension {
 public:
-    static PassRefPtr<WebKitLoseContext> create(WebGLRenderingContext*);
+    static PassOwnPtr<WebKitLoseContext> create(WebGLRenderingContext*);
 
     virtual ~WebKitLoseContext();
     virtual ExtensionName getName() const;
 
     void loseContext();
-    void contextDestroyed() { m_context = 0; }
 
 private:
     WebKitLoseContext(WebGLRenderingContext*);
-
-    WebGLRenderingContext* m_context;
 };
 
 } // namespace WebCore
index 83fc909..e81de81 100644 (file)
  */
 
 module html {
-    interface [Conditional=WEBGL, OmitConstructor] WebKitLoseContext {
+    interface [
+        Conditional=WEBGL,
+        GenerateIsReachable=ImplContext,
+        OmitConstructor
+    ] WebKitLoseContext {
         [StrictTypeChecking] void loseContext();
     };
 }
index 55d5514..eebf784 100644 (file)
@@ -30,7 +30,7 @@ module offline {
         EventTarget,
         OmitConstructor,
         DontCheckEnums,
-        CustomIsReachable
+        GenerateIsReachable=ImplFrame
     ] DOMApplicationCache {
         // update status
         const unsigned short UNCACHED = 0;
index e350722..2f036c1 100644 (file)
@@ -29,7 +29,7 @@
 module window {
 
     interface [
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         OmitConstructor
     ] BarInfo {
         readonly attribute boolean visible;
index 421a5e5..226bf0c 100644 (file)
@@ -29,7 +29,7 @@
 module window {
 
     interface [
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         OmitConstructor
     ] Console {
 
index 71eb8ac..06ab7db 100644 (file)
@@ -32,7 +32,7 @@ module window {
     // This is based off of Mozilla's Selection interface
     // https://developer.mozilla.org/En/DOM/Selection
     interface [
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         OmitConstructor
     ] DOMSelection {
         readonly attribute Node anchorNode;
index 651c57a..612b43c 100644 (file)
@@ -27,7 +27,7 @@ module core {
 
     interface [
         Conditional=GEOLOCATION, 
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         OmitConstructor
     ] Geolocation {
         [Custom] void getCurrentPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
index b352a03..1cf9ce5 100644 (file)
@@ -31,7 +31,7 @@ module window {
 #endif
         DelegatingGetOwnPropertySlot,
         DelegatingPutFunction,
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         CustomDeleteProperty,
         CustomGetPropertyNames,
         OmitConstructor
index ecdbf09..982e7a9 100644 (file)
@@ -34,7 +34,7 @@ module window {
 #endif
         DelegatingGetOwnPropertySlot,
         DelegatingPutFunction,
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         CustomDeleteProperty,
         CustomGetPropertyNames,
         CustomDefineGetter,
index 71162d0..2eaf0a1 100644 (file)
@@ -20,7 +20,7 @@
 module window {
 
     interface [
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         OmitConstructor
     ] Navigator {
         readonly attribute DOMString appCodeName;
index c77051b..4471617 100644 (file)
@@ -30,7 +30,7 @@
 module window {
 
     interface [
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         OmitConstructor
     ] Screen {
         readonly attribute unsigned long height;
index ec75f8a..1544f15 100644 (file)
@@ -30,6 +30,7 @@ module threads {
 
     interface [
         Conditional=WORKERS,
+        GenerateIsReachable=Impl,
         NoStaticTables,
         OmitConstructor
     ] WorkerNavigator {
index ed078bb..54fff7b 100644 (file)
@@ -37,6 +37,7 @@ public:
     static PassRefPtr<DOMMimeTypeArray> create(Frame* frame) { return adoptRef(new DOMMimeTypeArray(frame)); }
     ~DOMMimeTypeArray();
 
+    Frame* frame() { return m_frame; }
     void disconnectFrame() { m_frame = 0; }
 
     unsigned length() const;
index 8b79a7e..3f073ce 100644 (file)
@@ -21,6 +21,7 @@
 module window {
 
     interface [
+        GenerateIsReachable=ImplFrame,
         HasNameGetter,
         HasIndexGetter
     ] DOMMimeTypeArray {
index cc70572..0b1f2ba 100644 (file)
@@ -37,6 +37,7 @@ public:
     static PassRefPtr<DOMPluginArray> create(Frame* frame) { return adoptRef(new DOMPluginArray(frame)); }
     ~DOMPluginArray();
 
+    Frame* frame() { return m_frame; }
     void disconnectFrame() { m_frame = 0; }
 
     unsigned length() const;
index 4c0d64c..1c95387 100644 (file)
@@ -21,7 +21,8 @@
 module window {
 
     interface [
-        HasNameGetter, 
+        GenerateIsReachable=ImplFrame,
+        HasNameGetter,
         HasIndexGetter
     ] DOMPluginArray {
         readonly attribute unsigned long length;
index bc1056f..d33095e 100644 (file)
@@ -27,7 +27,7 @@ module storage {
 
     interface [
         HasNameGetter,
-        CustomIsReachable=Frame,
+        GenerateIsReachable=ImplFrame,
         CustomDeleteProperty,
         CustomGetPropertyNames,
         DelegatingPutFunction,
index 429d522..9a733fb 100644 (file)
@@ -30,6 +30,7 @@ module threads {
 
     interface [
         Conditional=WORKERS,
+        GenerateIsReachable=Impl,
         NoStaticTables
     ] WorkerLocation {
         readonly attribute DOMString href;
index 41d8afb..ed1e215 100644 (file)
@@ -194,9 +194,6 @@ XMLHttpRequest::XMLHttpRequest(ScriptExecutionContext* context)
 
 XMLHttpRequest::~XMLHttpRequest()
 {
-    if (m_upload)
-        m_upload->disconnectXMLHttpRequest();
-
 #ifndef NDEBUG
     xmlHttpRequestCounter.decrement();
 #endif
index cca8c36..da777e7 100644 (file)
@@ -178,7 +178,7 @@ private:
     void networkError();
     void abortError();
 
-    RefPtr<XMLHttpRequestUpload> m_upload;
+    OwnPtr<XMLHttpRequestUpload> m_upload;
 
     KURL m_url;
     String m_method;
index 739082d..f279c4b 100644 (file)
@@ -43,10 +43,7 @@ XMLHttpRequestUpload::XMLHttpRequestUpload(XMLHttpRequest* xmlHttpRequest)
 
 ScriptExecutionContext* XMLHttpRequestUpload::scriptExecutionContext() const
 {
-    XMLHttpRequest* xmlHttpRequest = associatedXMLHttpRequest();
-    if (!xmlHttpRequest)
-        return 0;
-    return xmlHttpRequest->scriptExecutionContext();
+    return m_xmlHttpRequest->scriptExecutionContext();
 }
 
 EventTargetData* XMLHttpRequestUpload::eventTargetData()
index 984d86a..f74fe15 100644 (file)
 #include "EventListener.h"
 #include "EventNames.h"
 #include "EventTarget.h"
+#include "XMLHttpRequest.h"
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/AtomicStringHash.h>
 
@@ -42,17 +43,18 @@ namespace WebCore {
     class ScriptExecutionContext;
     class XMLHttpRequest;
 
-    class XMLHttpRequestUpload : public RefCounted<XMLHttpRequestUpload>, public EventTarget {
+    class XMLHttpRequestUpload : public EventTarget {
     public:
-        static PassRefPtr<XMLHttpRequestUpload> create(XMLHttpRequest* xmlHttpRequest)
+        static PassOwnPtr<XMLHttpRequestUpload> create(XMLHttpRequest* xmlHttpRequest)
         {
-            return adoptRef(new XMLHttpRequestUpload(xmlHttpRequest));
+            return adoptPtr(new XMLHttpRequestUpload(xmlHttpRequest));
         }
 
-        virtual XMLHttpRequestUpload* toXMLHttpRequestUpload() { return this; }
+        void ref() { m_xmlHttpRequest->ref(); }
+        void deref() { m_xmlHttpRequest->deref(); }
+        XMLHttpRequest* xmlHttpRequest() const { return m_xmlHttpRequest; }
 
-        XMLHttpRequest* associatedXMLHttpRequest() const { return m_xmlHttpRequest; }
-        void disconnectXMLHttpRequest() { m_xmlHttpRequest = 0; }
+        virtual XMLHttpRequestUpload* toXMLHttpRequestUpload() { return this; }
 
         ScriptExecutionContext* scriptExecutionContext() const;
 
@@ -62,9 +64,6 @@ namespace WebCore {
         DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart);
         DEFINE_ATTRIBUTE_EVENT_LISTENER(progress);
 
-        using RefCounted<XMLHttpRequestUpload>::ref;
-        using RefCounted<XMLHttpRequestUpload>::deref;
-
     private:
         XMLHttpRequestUpload(XMLHttpRequest*);
 
index 5a18567..84f1f73 100644 (file)
@@ -29,7 +29,7 @@
 module xml {
 
     interface [
-        CustomMarkFunction,
+        GenerateIsReachable=Impl,
         EventTarget,
         NoStaticTables
     ] XMLHttpRequestUpload {