Bug 887533: Remove even more includes from dom/bindings. r=bz

This commit is contained in:
Kyle Huey 2013-08-22 22:17:11 -07:00
parent 79dd184c74
commit 4fd557dbb9
16 changed files with 41 additions and 29 deletions

View File

@ -8,9 +8,7 @@
#include "nsIDOMNodeList.h"
#include "nsWrapperCache.h"
class nsINode;
class nsIContent;
#include "nsIContent.h"
// IID for the nsINodeList interface
#define NS_INODELIST_IID \

View File

@ -23,12 +23,6 @@ class nsIAtom;
class nsINodeInfo;
class nsIDocument;
namespace mozilla {
namespace dom {
class Element;
} // namespace dom
} // namespace mozilla
/**
* Structure used as a key for caching Attrs in nsDOMAttributeMap's mAttributeCache.
*/
@ -211,5 +205,9 @@ private:
already_AddRefed<Attr> RemoveAttribute(nsINodeInfo* aNodeInfo);
};
// XXX khuey yes this is crazy. The bindings code needs to see this include,
// but if we pull it in at the top of the file we get a circular include
// problem.
#include "mozilla/dom/Element.h"
#endif /* nsDOMAttributeMap_h */

View File

@ -14,6 +14,7 @@
#include "nsIURI.h"
#include "nsIHttpChannel.h"
#include "nsIDocument.h"
#include "nsIContent.h"
#include "nsIStreamListener.h"
#include "nsWeakReference.h"
#include "jsapi.h"

View File

@ -19,8 +19,8 @@
#include "nsIHTMLCollection.h"
#include "nsHashKeys.h"
#include "nsRefPtrHashtable.h"
#include "nsGenericHTMLElement.h"
class nsGenericHTMLElement;
class nsIDocument;
class nsINode;

View File

@ -11,8 +11,8 @@
#include "mozilla/Attributes.h"
#include "mozilla/ErrorResult.h"
#include "nsWrapperCache.h"
#include "nsSVGElement.h"
class nsSVGElement;
class nsSVGViewBox;
namespace mozilla {

View File

@ -11,8 +11,7 @@
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/ErrorResult.h"
class nsSVGElement;
#include "nsSVGElement.h"
namespace mozilla {
// Alignment Types

View File

@ -16,10 +16,10 @@
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "nsAutoPtr.h"
#include "nsPIDOMWindow.h"
class nsGlobalWindow;
class nsIWebBrowserChrome;
class nsPIDOMWindow;
namespace mozilla {

View File

@ -11,13 +11,13 @@
class nsIDOMCRMFObject;
#endif
#include "nsPIDOMWindow.h"
#include "nsWrapperCache.h"
#include "mozilla/dom/TypedArray.h"
#define NS_DOMCRYPTO_CID \
{0x929d9320, 0x251e, 0x11d4, { 0x8a, 0x7c, 0x00, 0x60, 0x08, 0xc8, 0x44, 0xc3} }
class nsPIDOMWindow;
namespace mozilla {
class ErrorResult;

View File

@ -11,8 +11,7 @@
#include "nsWrapperCache.h"
#include "nsCOMPtr.h"
#include "nsString.h"
class nsPIDOMWindow;
#include "nsPIDOMWindow.h"
namespace mozilla {

View File

@ -12,8 +12,8 @@
#include "nsWrapperCache.h"
#include "nsIWeakReferenceUtils.h"
#include "nsAutoPtr.h"
#include "nsPIDOMWindow.h"
class nsPIDOMWindow;
class nsMimeType;
class nsPluginElement;

View File

@ -11,9 +11,9 @@
#include "nsWrapperCache.h"
#include "nsDOMNavigationTiming.h"
#include "nsContentUtils.h"
#include "nsIDOMWindow.h"
class nsITimedChannel;
class nsIDOMWindow;
class nsPerformance;
class JSObject;
struct JSContext;

View File

@ -8618,6 +8618,26 @@ class CGBindingRoot(CGThing):
jsImplemented = config.getDescriptors(webIDLFile=webIDLFile,
isJSImplemented=True)
# Python can't modify closed-over variables directly, so sneak
# our mutable value in as an entry in a dictionary.
needsDOMQS = { "value": any(d.hasXPConnectImpls for d in descriptors) }
# Only mainthread things can have hasXPConnectImpls
provider = config.getDescriptorProvider(False)
def checkForXPConnectImpls(type, descriptor=None, dictionary=None):
if needsDOMQS["value"]:
return
type = type.unroll()
if not type.isInterface() or not type.isGeckoInterface():
return
try:
typeDesc = provider.getDescriptor(type.inner.identifier.name)
except NoSuchDescriptorError:
return
needsDOMQS["value"] = typeDesc.hasXPConnectImpls
callForEachType(descriptors + callbackDescriptors, dictionaries,
mainCallbacks, checkForXPConnectImpls)
descriptorsWithPrototype = filter(lambda d: d.interface.hasInterfacePrototypeObject(),
descriptors)
traitsClasses = [CGPrototypeTraitsClass(d) for d in descriptorsWithPrototype]
@ -8703,9 +8723,6 @@ class CGBindingRoot(CGThing):
'mozilla/dom/Nullable.h',
'PrimitiveConversions.h',
'WrapperFactory.h',
# Have to include nsDOMQS.h to get fast arg unwrapping
# for old-binding things with castability.
'nsDOMQS.h'
] + (['WorkerPrivate.h',
'nsThreadUtils.h'] if hasWorkerStuff else [])
+ (['mozilla/Preferences.h'] if requiresPreferences else [])
@ -8714,6 +8731,8 @@ class CGBindingRoot(CGThing):
+ (['nsCxPusher.h'] if dictionaries else [])
+ (['AccessCheck.h'] if hasChromeOnly else [])
+ (['xpcprivate.h'] if isEventTarget else [])
+ (['nsPIDOMWindow.h'] if len(jsImplemented) != 0 else [])
+ (['nsDOMQS.h'] if needsDOMQS["value"] else [])
+ (['AtomList.h'] if requiresAtoms else []),
prefix,
curr,

View File

@ -20,8 +20,7 @@
#include "nsIDOMCameraManager.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
class nsPIDOMWindow;
#include "nsPIDOMWindow.h"
namespace mozilla {
class ErrorResult;

View File

@ -14,9 +14,9 @@
#include "mozilla/dom/PromiseBinding.h"
#include "nsWrapperCache.h"
#include "nsAutoPtr.h"
#include "nsPIDOMWindow.h"
struct JSContext;
class nsPIDOMWindow;
namespace mozilla {
namespace dom {

View File

@ -31,12 +31,12 @@
#include "nsIGeolocationProvider.h"
#include "nsIContentPermissionPrompt.h"
#include "nsIDOMWindow.h"
#include "DictionaryHelpers.h"
#include "PCOMContentPermissionRequestChild.h"
#include "mozilla/Attributes.h"
class nsGeolocationService;
class nsIDOMWindow;
namespace mozilla {
namespace dom {

View File

@ -30,14 +30,13 @@
#include "mozilla/ErrorResult.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsINode.h"
// dbeabbfa-6cb3-4f5c-aec2-dd558d9d681f
#define NS_ICSSDECLARATION_IID \
{ 0xdbeabbfa, 0x6cb3, 0x4f5c, \
{ 0xae, 0xc2, 0xdd, 0x55, 0x8d, 0x9d, 0x68, 0x1f } }
class nsINode;
class nsICSSDeclaration : public nsIDOMCSSStyleDeclaration,
public nsWrapperCache
{