Bug 885170 - Remove nsINode::GetClassInfo(); r=peterv

This commit is contained in:
Ms2ger 2013-07-24 09:31:06 +02:00
Родитель 8e82086f03
Коммит 8609abdb1f
7 изменённых файлов: 33 добавлений и 74 удалений

Просмотреть файл

@ -254,8 +254,8 @@ private:
// IID for the nsINode interface
#define NS_INODE_IID \
{ 0x5daa9e95, 0xe49c, 0x4b41, \
{ 0xb2, 0x02, 0xde, 0xa9, 0xd3, 0x06, 0x21, 0x17 } }
{ 0xe24a9ddc, 0x2979, 0x40e3, \
{ 0x82, 0xb0, 0x9d, 0xf8, 0xb0, 0x41, 0xe5, 0x6a } }
/**
* An internal interface that abstracts some DOMNode-related parts that both
@ -1494,12 +1494,6 @@ protected:
}
public:
// Optimized way to get classinfo.
virtual nsXPCClassInfo* GetClassInfo()
{
return nullptr;
}
// Makes nsINode object to keep aObject alive.
void BindObject(nsISupports* aObject);
// After calling UnbindObject nsINode object doesn't keep

Просмотреть файл

@ -6,21 +6,21 @@
#ifndef nsEventListenerManager_h__
#define nsEventListenerManager_h__
#include "nsEventListenerManager.h"
#include "jsapi.h"
#include "nsCOMPtr.h"
#include "nsIDOMEventListener.h"
#include "mozilla/dom/EventListenerBinding.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/MemoryReporting.h"
#include "nsAutoPtr.h"
#include "nsCOMArray.h"
#include "nsCOMPtr.h"
#include "nsCxPusher.h"
#include "nsIScriptContext.h"
#include "nsCycleCollectionParticipant.h"
#include "nsTObserverArray.h"
#include "nsGkAtoms.h"
#include "nsGUIEvent.h"
#include "nsIDOMEventListener.h"
#include "nsIJSEventListener.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/EventListenerBinding.h"
#include "nsIScriptContext.h"
#include "nsTObserverArray.h"
class nsIDOMEvent;
class nsIAtom;

Просмотреть файл

@ -7,19 +7,20 @@
#ifndef AudioContext_h_
#define AudioContext_h_
#include "nsDOMEventTargetHelper.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "EnableWebAudioCheck.h"
#include "nsAutoPtr.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/AudioContextBinding.h"
#include "MediaBufferDecoder.h"
#include "StreamBuffer.h"
#include "MediaStreamGraph.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/AudioContextBinding.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/TypedArray.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsDOMEventTargetHelper.h"
#include "nsHashKeys.h"
#include "nsTHashtable.h"
#include "StreamBuffer.h"
// X11 has a #define for CurrentTime. Unbelievable :-(.
// See content/media/DOMMediaStream.h for more fun!

Просмотреть файл

@ -7,23 +7,23 @@
#ifndef mozilla_dom_BindingUtils_h__
#define mozilla_dom_BindingUtils_h__
#include "jsfriendapi.h"
#include "jswrapper.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackObject.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/DOMJSProxyHandler.h"
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/workers/Workers.h"
#include "mozilla/ErrorResult.h"
#include "jsfriendapi.h"
#include "jswrapper.h"
#include "mozilla/Likely.h"
#include "nsIXPConnect.h"
#include "nsTraceRefcnt.h"
#include "qsObjectHelper.h"
#include "xpcpublic.h"
#include "nsTraceRefcnt.h"
#include "nsWrapperCacheInlines.h"
#include "mozilla/Likely.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/CallbackObject.h"
class nsPIDOMWindow;

Просмотреть файл

@ -885,12 +885,4 @@ xpc_qsAssertContextOK(JSContext *cx)
// This is what we're actually trying to assert here.
NS_ASSERTION(cx == topJSContext, "wrong context on XPCJSContextStack!");
}
void
xpcObjectHelper::AssertGetClassInfoResult()
{
MOZ_ASSERT(mXPCClassInfo ||
static_cast<nsINode*>(GetCanonical())->IsDOMBinding(),
"GetClassInfo() should only return null for new DOM bindings!");
}
#endif

Просмотреть файл

@ -9,19 +9,9 @@
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsIDOMNode.h"
#include "nsINode.h"
#include "nsWrapperCache.h"
#include "mozilla/TypeTraits.h"
template <typename T>
struct qsIsNode
{
static const bool value =
mozilla::IsBaseOf<nsINode, T>::value ||
mozilla::IsBaseOf<nsIDOMNode, T>::value;
};
class qsObjectHelper : public xpcObjectHelper
{
public:
@ -29,15 +19,14 @@ public:
inline
qsObjectHelper(T *aObject, nsWrapperCache *aCache)
: xpcObjectHelper(ToSupports(aObject), ToCanonicalSupports(aObject),
aCache, qsIsNode<T>::value)
aCache)
{}
template <class T>
inline
qsObjectHelper(nsCOMPtr<T>& aObject, nsWrapperCache *aCache)
: xpcObjectHelper(ToSupports(aObject.get()),
ToCanonicalSupports(aObject.get()), aCache,
qsIsNode<T>::value)
ToCanonicalSupports(aObject.get()), aCache)
{
if (mCanonical) {
// Transfer the strong reference.
@ -50,8 +39,7 @@ public:
inline
qsObjectHelper(nsRefPtr<T>& aObject, nsWrapperCache *aCache)
: xpcObjectHelper(ToSupports(aObject.get()),
ToCanonicalSupports(aObject.get()), aCache,
qsIsNode<T>::value)
ToCanonicalSupports(aObject.get()), aCache)
{
if (mCanonical) {
// Transfer the strong reference.

Просмотреть файл

@ -17,7 +17,6 @@
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsIClassInfo.h"
#include "nsINode.h"
#include "nsISupports.h"
#include "nsIXPCScriptable.h"
#include "nsWrapperCache.h"
@ -29,7 +28,6 @@ public:
: mCanonical(NULL)
, mObject(aObject)
, mCache(aCache)
, mIsNode(false)
{
if (!mCache) {
if (aObject)
@ -74,15 +72,7 @@ public:
nsXPCClassInfo *GetXPCClassInfo()
{
if (!mXPCClassInfo) {
if (mIsNode) {
mXPCClassInfo =
static_cast<nsINode*>(GetCanonical())->GetClassInfo();
#ifdef DEBUG
AssertGetClassInfoResult();
#endif
} else {
CallQueryInterface(mObject, getter_AddRefs(mXPCClassInfo));
}
CallQueryInterface(mObject, getter_AddRefs(mXPCClassInfo));
}
return mXPCClassInfo;
}
@ -118,11 +108,10 @@ public:
protected:
xpcObjectHelper(nsISupports *aObject, nsISupports *aCanonical,
nsWrapperCache *aCache, bool aIsNode)
nsWrapperCache *aCache)
: mCanonical(aCanonical)
, mObject(aObject)
, mCache(aCache)
, mIsNode(aIsNode)
{
if (!mCache && aObject)
CallQueryInterface(aObject, &mCache);
@ -134,15 +123,10 @@ protected:
private:
xpcObjectHelper(xpcObjectHelper& aOther) MOZ_DELETE;
#ifdef DEBUG
void AssertGetClassInfoResult();
#endif
nsISupports* mObject;
nsWrapperCache* mCache;
nsCOMPtr<nsIClassInfo> mClassInfo;
nsRefPtr<nsXPCClassInfo> mXPCClassInfo;
bool mIsNode;
};
#endif