Title: [155229] trunk/Source
Revision
155229
Author
akl...@apple.com
Date
2013-09-06 19:28:26 -0700 (Fri, 06 Sep 2013)

Log Message

Don't include Document.h from JSDOMBinding.h
<https://webkit.org/b/120909>

Reviewed by Anders Carlsson.

Move DOMConstructorWithDocument out of JSDOMBinding.h to its own header.
This was the only part of JSDOMBinding.h that needed Document's definition.

This reduces the include dependency graph of many bindings files.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMConstructorWithDocument.h:
* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/CodeGeneratorGObject.pm:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (155228 => 155229)


--- trunk/Source/WebCore/ChangeLog	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/ChangeLog	2013-09-07 02:28:26 UTC (rev 155229)
@@ -1,3 +1,22 @@
+2013-09-06  Andreas Kling  <akl...@apple.com>
+
+        Don't include Document.h from JSDOMBinding.h
+        <https://webkit.org/b/120909>
+
+        Reviewed by Anders Carlsson.
+
+        Move DOMConstructorWithDocument out of JSDOMBinding.h to its own header.
+        This was the only part of JSDOMBinding.h that needed Document's definition.
+
+        This reduces the include dependency graph of many bindings files.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/DOMConstructorWithDocument.h:
+        * bindings/js/JSDOMBinding.cpp:
+        * bindings/js/JSDOMBinding.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/CodeGeneratorGObject.pm:
+
 2013-09-06  Ryosuke Niwa  <rn...@webkit.org>
 
         Range::ownerDocument should return Document&

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (155228 => 155229)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2013-09-07 02:28:26 UTC (rev 155229)
@@ -4636,6 +4636,7 @@
 		B55D5AA91191325000BCC315 /* JSSQLTransactionSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA71191325000BCC315 /* JSSQLTransactionSyncCustom.cpp */; };
 		B562DB6017D3CD630010AF96 /* HTMLElementTypeHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5E17D3CD560010AF96 /* HTMLElementTypeHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B562DB6117D3CD660010AF96 /* SVGElementTypeHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		B56576E817DA94E200A56BDC /* DOMConstructorWithDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = B56576E717DA94E200A56BDC /* DOMConstructorWithDocument.h */; };
 		B58CEB6911913607002A6790 /* JSDatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6711913607002A6790 /* JSDatabaseSync.h */; };
 		B58CEB6A11913607002A6790 /* JSDatabaseSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */; };
 		B58CEB6D1191361C002A6790 /* JSSQLTransactionSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */; };
@@ -11447,6 +11448,7 @@
 		B562DB5E17D3CD560010AF96 /* HTMLElementTypeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTMLElementTypeHelpers.h; sourceTree = "<group>"; };
 		B562DB5F17D3CD560010AF96 /* SVGElementTypeHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGElementTypeHelpers.h; sourceTree = "<group>"; };
 		B56576E417DA599F00A56BDC /* JSMainThreadExecStateInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecStateInstrumentation.h; sourceTree = "<group>"; };
+		B56576E717DA94E200A56BDC /* DOMConstructorWithDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMConstructorWithDocument.h; sourceTree = "<group>"; };
 		B58CEB6711913607002A6790 /* JSDatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseSync.h; sourceTree = "<group>"; };
 		B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSync.cpp; sourceTree = "<group>"; };
 		B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSync.h; sourceTree = "<group>"; };
@@ -19106,6 +19108,7 @@
 				BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */,
 				312D67B01535691F00563D0D /* Dictionary.cpp */,
 				316023EF1532C40C00D50FF4 /* Dictionary.h */,
+				B56576E717DA94E200A56BDC /* DOMConstructorWithDocument.h */,
 				BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */,
 				BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */,
 				BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */,
@@ -23925,6 +23928,7 @@
 				C5160EEB1004543A00A7CEE2 /* StorageAreaImpl.h in Headers */,
 				C5102ECF0FD9EF8C00FAFF04 /* StorageAreaSync.h in Headers */,
 				51E0BABB0DA5547100A9E417 /* StorageEvent.h in Headers */,
+				B56576E817DA94E200A56BDC /* DOMConstructorWithDocument.h in Headers */,
 				C5EBDD84105EDDEC0056816F /* StorageEventDispatcher.h in Headers */,
 				51E0BB380DA5ACB600A9E417 /* StorageMap.h in Headers */,
 				C50D0E830FF4272900AC2644 /* StorageNamespace.h in Headers */,

Added: trunk/Source/WebCore/bindings/js/DOMConstructorWithDocument.h (0 => 155229)


--- trunk/Source/WebCore/bindings/js/DOMConstructorWithDocument.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/js/DOMConstructorWithDocument.h	2013-09-07 02:28:26 UTC (rev 155229)
@@ -0,0 +1,53 @@
+/*
+ *  Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+
+#ifndef DOMConstructorWithDocument_h
+#define DOMConstructorWithDocument_h
+
+#include "Document.h"
+#include "JSDOMBinding.h"
+
+namespace WebCore {
+
+// Constructors using this base class depend on being in a Document and
+// can never be used from a WorkerGlobalScope.
+class DOMConstructorWithDocument : public DOMConstructorObject {
+    typedef DOMConstructorObject Base;
+public:
+    Document* document() const
+    {
+        return toDocument(scriptExecutionContext());
+    }
+
+protected:
+    DOMConstructorWithDocument(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
+        : DOMConstructorObject(structure, globalObject)
+    {
+    }
+
+    void finishCreation(JSDOMGlobalObject* globalObject)
+    {
+        Base::finishCreation(globalObject->vm());
+        ASSERT(globalObject->scriptExecutionContext()->isDocument());
+    }
+};
+
+} // namespace WebCore
+
+#endif // DOMConstructorWithDocument_h

Modified: trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -29,6 +29,7 @@
 #include "AudioContext.h"
 
 #include "AudioBuffer.h"
+#include "Document.h"
 #include "JSAudioBuffer.h"
 #include "JSAudioContext.h"
 #include "JSOfflineAudioContext.h"

Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -24,6 +24,7 @@
 
 #include "BindingSecurity.h"
 #include "CachedScript.h"
+#include "DOMConstructorWithDocument.h"
 #include "DOMObjectHashTableMap.h"
 #include "DOMStringList.h"
 #include "ExceptionCode.h"

Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h	2013-09-07 02:28:26 UTC (rev 155229)
@@ -28,11 +28,9 @@
 #include "JSDOMGlobalObject.h"
 #include "JSDOMWrapper.h"
 #include "DOMWrapperWorld.h"
-#include "Document.h"
 #include "ScriptWrappable.h"
 #include "ScriptWrappableInlines.h"
 #include "WebCoreTypedArrayController.h"
-#include <heap/SlotVisitor.h>
 #include <heap/Weak.h>
 #include <heap/WeakInlines.h>
 #include <runtime/Error.h>
@@ -60,8 +58,11 @@
 class DOMStringList;
 
     class CachedScript;
+    class Document;
     class Frame;
+    class HTMLDocument;
     class KURL;
+    class Node;
 
     typedef int ExceptionCode;
 
@@ -82,29 +83,6 @@
         }
     };
 
-    // Constructors using this base class depend on being in a Document and
-    // can never be used from a WorkerGlobalScope.
-    class DOMConstructorWithDocument : public DOMConstructorObject {
-        typedef DOMConstructorObject Base;
-    public:
-        Document* document() const
-        {
-            return toDocument(scriptExecutionContext());
-        }
-
-    protected:
-        DOMConstructorWithDocument(JSC::Structure* structure, JSDOMGlobalObject* globalObject)
-            : DOMConstructorObject(structure, globalObject)
-        {
-        }
-
-        void finishCreation(JSDOMGlobalObject* globalObject)
-        {
-            Base::finishCreation(globalObject->vm());
-            ASSERT(globalObject->scriptExecutionContext()->isDocument());
-        }
-    };
-    
     JSC::Structure* getCachedDOMStructure(JSDOMGlobalObject*, const JSC::ClassInfo*);
     JSC::Structure* cacheDOMStructure(JSDOMGlobalObject*, JSC::Structure*, const JSC::ClassInfo*);
 

Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -32,6 +32,7 @@
 
 #include "JSErrorHandler.h"
 
+#include "Document.h"
 #include "ErrorEvent.h"
 #include "Event.h"
 #include "EventNames.h"

Modified: trunk/Source/WebCore/bindings/js/JSImageConstructor.h (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSImageConstructor.h	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSImageConstructor.h	2013-09-07 02:28:26 UTC (rev 155229)
@@ -20,6 +20,7 @@
 #ifndef JSImageConstructor_h
 #define JSImageConstructor_h
 
+#include "DOMConstructorWithDocument.h"
 #include "JSDOMBinding.h"
 #include "JSDocument.h"
 

Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h	2013-09-07 02:28:26 UTC (rev 155229)
@@ -28,7 +28,6 @@
 
 #include "JSDOMBinding.h"
 #include <runtime/Completion.h>
-#include <runtime/Executable.h>
 #ifndef NDEBUG
 #include <wtf/MainThread.h>
 #endif

Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h	2013-09-07 02:28:26 UTC (rev 155229)
@@ -29,6 +29,7 @@
 
 #include "InspectorInstrumentation.h"
 #include "JSMainThreadExecState.h"
+#include <runtime/Executable.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -34,6 +34,7 @@
 
 #include "JSSharedWorker.h"
 
+#include "Document.h"
 #include "JSDOMGlobalObject.h"
 #include "JSDOMWindowCustom.h"
 #include "SharedWorker.h"

Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -30,6 +30,7 @@
 
 #include "JSWorker.h"
 
+#include "Document.h"
 #include "JSDOMGlobalObject.h"
 #include "JSMessagePortCustom.h"
 #include "Worker.h"

Modified: trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -34,6 +34,7 @@
 
 #include "PageScriptDebugServer.h"
 
+#include "Document.h"
 #include "EventLoop.h"
 #include "Frame.h"
 #include "FrameView.h"

Modified: trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -32,6 +32,7 @@
 #include "config.h"
 #include "ScriptCachedFrameData.h"
 
+#include "Document.h"
 #include "Frame.h"
 #include "GCController.h"
 #include "Page.h"

Modified: trunk/Source/WebCore/bindings/js/ScriptEventListener.h (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/ScriptEventListener.h	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/ScriptEventListener.h	2013-09-07 02:28:26 UTC (rev 155229)
@@ -43,6 +43,7 @@
     class EventListener;
     class Frame;
     class Node;
+    class QualifiedName;
 
     PassRefPtr<JSLazyEventListener> createAttributeEventListener(Node*, const QualifiedName&, const AtomicString& value);
     PassRefPtr<JSLazyEventListener> createAttributeEventListener(Frame*, const QualifiedName&, const AtomicString& value);

Modified: trunk/Source/WebCore/bindings/js/ScriptState.cpp (155228 => 155229)


--- trunk/Source/WebCore/bindings/js/ScriptState.cpp	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/js/ScriptState.cpp	2013-09-07 02:28:26 UTC (rev 155229)
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "ScriptState.h"
 
+#include "Document.h"
 #include "Frame.h"
 #include "JSDOMWindowBase.h"
 #include "Node.h"

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (155228 => 155229)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2013-09-07 02:28:26 UTC (rev 155229)
@@ -1425,6 +1425,7 @@
     $implIncludes{"WebKitDOMPrivate.h"} = 1;
     $implIncludes{"gobject/ConvertToUTF8String.h"} = 1;
     $implIncludes{"${className}Private.h"} = 1;
+    $implIncludes{"Document.h"} = 1;
     $implIncludes{"JSMainThreadExecState.h"} = 1;
     $implIncludes{"ExceptionCode.h"} = 1;
     $implIncludes{"CSSImportRule.h"} = 1;

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (155228 => 155229)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2013-09-07 02:28:26 UTC (rev 155229)
@@ -1005,6 +1005,9 @@
 
     if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
         $headerIncludes{"JSDOMBinding.h"} = 1;
+        if ($interface->extendedAttributes->{"NamedConstructor"}) {
+            $headerIncludes{"DOMConstructorWithDocument.h"} = 1;
+        }
         GenerateConstructorDeclaration(\@headerContent, $className, $interface, $interfaceName);
     }
 

Modified: trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (155228 => 155229)


--- trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm	2013-09-07 02:08:06 UTC (rev 155228)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm	2013-09-07 02:28:26 UTC (rev 155229)
@@ -48,6 +48,7 @@
 #import <_javascript_Core/SourceCode.h>
 #import <_javascript_Core/StrongInlines.h>
 #import <WebCore/CookieJar.h>
+#import <WebCore/Document.h>
 #import <WebCore/DocumentLoader.h>
 #import <WebCore/Frame.h>
 #import <WebCore/FrameLoader.h>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to