Bug 1028588 - Fix dangerous public destructors in content/ - r=khuey

This commit is contained in:
Benoit Jacob 2014-06-24 22:09:15 -04:00
parent b149e693e3
commit c4cf67d20f
97 changed files with 318 additions and 106 deletions

View File

@ -1192,7 +1192,6 @@ class DestinationInsertionPointList : public nsINodeList
{
public:
DestinationInsertionPointList(Element* aElement);
virtual ~DestinationInsertionPointList();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DestinationInsertionPointList)
@ -1207,6 +1206,8 @@ public:
virtual uint32_t Length() const;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
protected:
virtual ~DestinationInsertionPointList();
nsRefPtr<Element> mParent;
nsCOMArray<nsIContent> mDestinationPoints;
};

View File

@ -78,6 +78,8 @@ public:
}
private:
~nsChildContentList() {}
// The node whose children make up the list (weak reference)
nsINode* mNode;
};
@ -117,8 +119,6 @@ public:
{
}
~nsNodeWeakReference();
// nsISupports
NS_DECL_ISUPPORTS
@ -132,6 +132,8 @@ public:
}
private:
~nsNodeWeakReference();
nsINode* mNode;
};
@ -155,6 +157,8 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS(nsNodeSupportsWeakRefTearoff)
private:
~nsNodeSupportsWeakRefTearoff() {}
nsCOMPtr<nsINode> mNode;
};
@ -173,7 +177,6 @@ class FragmentOrElement : public nsIContent
public:
FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
virtual ~FragmentOrElement();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -293,6 +296,8 @@ public:
void* aData);
protected:
virtual ~FragmentOrElement();
/**
* Copy attributes and state to another element
* @param aDest the object to copy to

View File

@ -185,6 +185,9 @@ public:
{ }
NS_DECL_THREADSAFE_ISUPPORTS
protected:
~nsDOMFile() {}
};
class nsDOMFileCC : public nsDOMFileBase
@ -206,6 +209,9 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMFileCC, nsIDOMFile)
protected:
~nsDOMFileCC() {}
};
class nsDOMFileFile : public nsDOMFile
@ -307,6 +313,8 @@ public:
void SetPath(const nsAString& aFullPath);
protected:
~nsDOMFileFile() {}
// Create slice
nsDOMFileFile(const nsDOMFileFile* aOther, uint64_t aStart, uint64_t aLength,
const nsAString& aContentType)
@ -387,6 +395,8 @@ public:
NS_IMETHOD_(bool) IsMemoryFile(void) MOZ_OVERRIDE;
protected:
~nsDOMMemoryFile() {}
// Create slice
nsDOMMemoryFile(const nsDOMMemoryFile* aOther, uint64_t aStart,
uint64_t aLength, const nsAString& aContentType)
@ -455,6 +465,8 @@ protected:
class nsDOMFileList MOZ_FINAL : public nsIDOMFileList,
public nsWrapperCache
{
~nsDOMFileList() {}
public:
nsDOMFileList(nsISupports *aParent) : mParent(aParent)
{

View File

@ -31,7 +31,6 @@ class nsHostObjectProtocolHandler : public nsIProtocolHandler
{
public:
nsHostObjectProtocolHandler();
virtual ~nsHostObjectProtocolHandler() {}
NS_DECL_ISUPPORTS
// nsIProtocolHandler methods, except for GetScheme which is only defined
@ -55,6 +54,9 @@ public:
static nsIPrincipal* GetDataEntryPrincipal(const nsACString& aUri);
static void Traverse(const nsACString& aUri, nsCycleCollectionTraversalCallback& aCallback);
protected:
virtual ~nsHostObjectProtocolHandler() {}
private:
static void Init(void);
};

View File

@ -165,11 +165,12 @@ private:
mRef = aRef;
}
}
virtual ~DocumentLoadNotification() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
private:
virtual ~DocumentLoadNotification() {}
virtual void SetTo(Element* aTo) { }
nsString mRef;

View File

@ -30,12 +30,13 @@ namespace dom {
class Attr MOZ_FINAL : public nsIAttribute,
public nsIDOMAttr
{
virtual ~Attr() {}
public:
Attr(nsDOMAttributeMap* aAttrMap,
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
const nsAString& aValue,
bool aNsAware);
virtual ~Attr() {}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS

View File

@ -27,6 +27,10 @@ class DocumentType;
class DOMImplementation MOZ_FINAL : public nsIDOMDOMImplementation
, public nsWrapperCache
{
~DOMImplementation()
{
}
public:
DOMImplementation(nsIDocument* aOwner,
nsIGlobalObject* aScriptObject,
@ -41,10 +45,6 @@ public:
SetIsDOMBinding();
}
~DOMImplementation()
{
}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMImplementation)

View File

@ -25,9 +25,11 @@ class DOMParser MOZ_FINAL : public nsIDOMParser,
public nsWrapperCache
{
typedef mozilla::dom::GlobalObject GlobalObject;
virtual ~DOMParser();
public:
DOMParser();
virtual ~DOMParser();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(DOMParser,

View File

@ -46,6 +46,8 @@ protected:
class DOMPoint MOZ_FINAL : public DOMPointReadOnly
{
~DOMPoint() {}
public:
DOMPoint(nsISupports* aParent, double aX = 0.0, double aY = 0.0,
double aZ = 0.0, double aW = 1.0)

View File

@ -25,10 +25,11 @@ struct DOMPointInit;
class DOMQuad MOZ_FINAL : public nsWrapperCache
{
~DOMQuad();
public:
DOMQuad(nsISupports* aParent, CSSPoint aPoints[4]);
DOMQuad(nsISupports* aParent);
~DOMQuad();
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)

View File

@ -26,12 +26,13 @@ namespace dom {
class DOMRectReadOnly : public nsISupports
, public nsWrapperCache
{
protected:
virtual ~DOMRectReadOnly() {}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectReadOnly)
virtual ~DOMRectReadOnly() {}
DOMRectReadOnly(nsISupports* aParent)
: mParent(aParent)
{
@ -146,6 +147,8 @@ protected:
class DOMRectList MOZ_FINAL : public nsIDOMClientRectList,
public nsWrapperCache
{
~DOMRectList() {}
public:
DOMRectList(nsISupports *aParent) : mParent(aParent)
{

View File

@ -17,12 +17,14 @@ namespace dom {
class DOMStringList : public nsISupports,
public nsWrapperCache
{
protected:
virtual ~DOMStringList();
public:
DOMStringList()
{
SetIsDOMBinding();
}
virtual ~DOMStringList();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList)

View File

@ -518,6 +518,7 @@ public:
}
private:
~AsyncVerifyRedirectCallbackFwr() {}
nsRefPtr<EventSource> mEventSource;
};

View File

@ -88,6 +88,8 @@ public:
}
private:
~ImportLoader() {}
// If a new referrer LinkElement was added, let's
// see if we are already finished and if so fire
// the right event.
@ -129,6 +131,9 @@ private:
class ImportManager MOZ_FINAL : public nsISupports
{
typedef nsRefPtrHashtable<nsURIHashKey, ImportLoader> ImportMap;
~ImportManager() {}
public:
ImportManager() {}

View File

@ -115,6 +115,13 @@ private:
};
} // namespace dom
template<>
struct HasDangerousPublicDestructor<dom::NodeIterator>
{
static const bool value = true;
};
} // namespace mozilla
#endif // mozilla_dom_NodeIterator_h

View File

@ -20,7 +20,6 @@ class ResponsiveImageSelector : public nsISupports
public:
NS_DECL_ISUPPORTS
ResponsiveImageSelector(nsIContent *aContent);
virtual ~ResponsiveImageSelector();
// Given a srcset string, parse and replace current candidates (does not
// replace default source)
@ -34,6 +33,9 @@ public:
already_AddRefed<nsIURI> GetSelectedImageURL();
double GetSelectedImageDensity();
protected:
virtual ~ResponsiveImageSelector();
private:
// Append a candidate unless its selector is duplicated by a higher priority
// candidate

View File

@ -24,7 +24,6 @@ public:
{
SetIsDOMBinding();
}
virtual ~StyleSheetList() {}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
@ -41,6 +40,9 @@ public:
bool dummy = false;
return IndexedGetter(aIndex, dummy);
}
protected:
virtual ~StyleSheetList() {}
};
} // namespace dom

View File

@ -24,6 +24,8 @@ public:
nsresult Init();
private:
~ThirdPartyUtil() {}
nsresult IsThirdPartyInternal(const nsCString& aFirstDomain,
nsIURI* aSecondURI, bool* aResult);
static already_AddRefed<nsIURI> GetURIFromWindow(nsIDOMWindow* aWin);

View File

@ -25,6 +25,8 @@ namespace dom {
class TreeWalker MOZ_FINAL : public nsIDOMTreeWalker, public nsTraversal
{
virtual ~TreeWalker();
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSIDOMTREEWALKER
@ -32,7 +34,6 @@ public:
TreeWalker(nsINode *aRoot,
uint32_t aWhatToShow,
const NodeFilterHolder &aFilter);
virtual ~TreeWalker();
NS_DECL_CYCLE_COLLECTION_CLASS(TreeWalker)

View File

@ -38,7 +38,7 @@ class nsCCUncollectableMarker MOZ_FINAL : public nsIObserver
private:
nsCCUncollectableMarker() {}
~nsCCUncollectableMarker() {}
};
namespace mozilla {

View File

@ -30,9 +30,11 @@ class nsCSPContext : public nsIContentSecurityPolicy
NS_DECL_NSICONTENTSECURITYPOLICY
NS_DECL_NSISERIALIZABLE
protected:
virtual ~nsCSPContext();
public:
nsCSPContext();
virtual ~nsCSPContext();
nsresult SendReports(nsISupports* aBlockedContentSource,
nsIURI* aOriginalURI,
@ -76,6 +78,8 @@ class CSPViolationReportListener : public nsIStreamListener
public:
CSPViolationReportListener();
protected:
virtual ~CSPViolationReportListener();
};
@ -92,6 +96,8 @@ class CSPReportRedirectSink MOZ_FINAL : public nsIChannelEventSink,
public:
CSPReportRedirectSink();
protected:
virtual ~CSPReportRedirectSink();
};

View File

@ -25,9 +25,12 @@ public:
NS_DECL_NSICHANNELEVENTSINK
CSPService();
virtual ~CSPService();
static bool sCSPEnabled;
static bool sNewBackendEnabled;
protected:
virtual ~CSPService();
private:
// Maps origins to app status.
nsDataHashtable<nsCStringHashKey, uint16_t> mAppStatusCache;

View File

@ -21,9 +21,10 @@ public:
NS_DECL_NSICHANNELPOLICY
nsChannelPolicy();
virtual ~nsChannelPolicy();
protected:
virtual ~nsChannelPolicy();
/* Represents the type of content being loaded in the channel per
* nsIContentPolicy, e.g. TYPE_IMAGE, TYPE_SCRIPT
*/

View File

@ -68,12 +68,12 @@ public:
// ensures that the image data is only created when an image drop is allowed.
class nsContentAreaDragDropDataProvider : public nsIFlavorDataProvider
{
virtual ~nsContentAreaDragDropDataProvider() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIFLAVORDATAPROVIDER
virtual ~nsContentAreaDragDropDataProvider() {}
nsresult SaveURIToFile(nsAString& inSourceURIString,
nsIFile* inDestFile, bool isPrivate);
};

View File

@ -83,7 +83,6 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS(nsContentIterator)
explicit nsContentIterator(bool aPre);
virtual ~nsContentIterator();
// nsIContentIterator interface methods ------------------------------
@ -106,6 +105,7 @@ public:
virtual nsresult PositionAt(nsINode* aCurNode);
protected:
virtual ~nsContentIterator();
// Recursively get the deepest first/last child of aRoot. This will return
// aRoot itself if it has no children.

View File

@ -42,7 +42,6 @@ public:
{
SetIsDOMBinding();
}
virtual ~nsBaseContentList();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -100,6 +99,8 @@ public:
mElements.SetCapacity(aCapacity);
}
protected:
virtual ~nsBaseContentList();
/**
* To be called from non-destructor locations (e.g. unlink) that want to
* remove from caches. Cacheable subclasses should override.

View File

@ -21,7 +21,10 @@ class nsContentPolicy : public nsIContentPolicy
NS_DECL_NSICONTENTPOLICY
nsContentPolicy();
protected:
virtual ~nsContentPolicy();
private:
//Array of policies
nsCategoryCache<nsIContentPolicy> mPolicies;

View File

@ -328,6 +328,8 @@ class DOMEventListenerManagersHashReporter MOZ_FINAL : public nsIMemoryReporter
{
MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
~DOMEventListenerManagersHashReporter() {}
public:
NS_DECL_ISUPPORTS
@ -392,6 +394,8 @@ EventListenerManagerHashClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry)
class SameOriginChecker MOZ_FINAL : public nsIChannelEventSink,
public nsIInterfaceRequestor
{
~SameOriginChecker() {}
NS_DECL_ISUPPORTS
NS_DECL_NSICHANNELEVENTSINK
NS_DECL_NSIINTERFACEREQUESTOR

View File

@ -921,6 +921,8 @@ public:
NS_DECL_NSICHANNELEVENTSINK
private:
~nsCORSPreflightListener() {}
void AddResultToCache(nsIRequest* aRequest);
nsCOMPtr<nsIChannel> mOuterChannel;

View File

@ -62,6 +62,8 @@ public:
nsresult Init(nsIChannel* aChannel, bool aAllowDataURI = false);
private:
~nsCORSListenerProxy() {}
nsresult UpdateChannel(nsIChannel* aChannel, bool aAllowDataURI = false);
nsresult CheckRequestApproved(nsIRequest* aRequest);

View File

@ -90,7 +90,6 @@ public:
typedef mozilla::ErrorResult ErrorResult;
nsDOMAttributeMap(Element *aContent);
virtual ~nsDOMAttributeMap();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap)
@ -177,6 +176,9 @@ public:
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
protected:
virtual ~nsDOMAttributeMap();
private:
nsCOMPtr<Element> mContent;

View File

@ -67,6 +67,8 @@ public:
NS_FORWARD_NSIIPCSERIALIZABLEINPUTSTREAM(mSerializableInputStream->)
private:
~DataOwnerAdapter() {}
DataOwnerAdapter(DataOwner* aDataOwner,
nsIInputStream* aStream)
: mDataOwner(aDataOwner), mStream(aStream),
@ -638,6 +640,8 @@ MOZ_DEFINE_MALLOC_SIZE_OF(DOMMemoryFileDataOwnerMallocSizeOf)
class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL
: public nsIMemoryReporter
{
~nsDOMMemoryFileDataOwnerMemoryReporter() {}
public:
NS_DECL_THREADSAFE_ISUPPORTS

View File

@ -31,13 +31,14 @@ using mozilla::dom::MutationObservingInfo;
class nsDOMMutationRecord : public nsISupports,
public nsWrapperCache
{
virtual ~nsDOMMutationRecord() {}
public:
nsDOMMutationRecord(nsIAtom* aType, nsISupports* aOwner)
: mType(aType), mAttrNamespace(NullString()), mPrevValue(NullString()), mOwner(aOwner)
{
SetIsDOMBinding();
}
virtual ~nsDOMMutationRecord() {}
nsISupports* GetParentObject() const
{
@ -269,6 +270,9 @@ private:
class nsMutationReceiver : public nsMutationReceiverBase
{
protected:
virtual ~nsMutationReceiver() { Disconnect(false); }
public:
nsMutationReceiver(nsINode* aTarget, nsDOMMutationObserver* aObserver);
@ -280,8 +284,6 @@ public:
aParent->AddClone(this);
}
virtual ~nsMutationReceiver() { Disconnect(false); }
nsMutationReceiver* GetParent()
{
return static_cast<nsMutationReceiver*>(mParent.get());
@ -347,7 +349,6 @@ public:
{
SetIsDOMBinding();
}
virtual ~nsDOMMutationObserver();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationObserver)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_MUTATION_OBSERVER_IID)
@ -417,6 +418,8 @@ public:
static void Shutdown();
protected:
virtual ~nsDOMMutationObserver();
friend class nsMutationReceiver;
friend class nsAutoMutationBatch;
nsMutationReceiver* GetReceiverFor(nsINode* aNode, bool aMayCreate);

View File

@ -19,7 +19,6 @@ class nsDOMSerializer MOZ_FINAL : public nsIDOMSerializer,
{
public:
nsDOMSerializer();
virtual ~nsDOMSerializer();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMSerializer)
@ -55,6 +54,8 @@ public:
}
private:
virtual ~nsDOMSerializer();
nsDOMSerializer(nsISupports* aOwner) : mOwner(aOwner)
{
MOZ_ASSERT(aOwner);

View File

@ -24,14 +24,15 @@
class nsDataDocumentContentPolicy MOZ_FINAL : public nsIContentPolicy
{
~nsDataDocumentContentPolicy()
{}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSICONTENTPOLICY
nsDataDocumentContentPolicy()
{}
~nsDataDocumentContentPolicy()
{}
};

View File

@ -5560,7 +5560,8 @@ namespace {
class ProcessStackRunner MOZ_FINAL : public nsIRunnable
{
public:
~ProcessStackRunner() {}
public:
ProcessStackRunner(bool aIsBaseQueue = false)
: mIsBaseQueue(aIsBaseQueue)
{
@ -9330,6 +9331,7 @@ namespace {
* the CSSLoader's style cache
*/
class StubCSSLoaderObserver MOZ_FINAL : public nsICSSLoaderObserver {
~StubCSSLoaderObserver() {}
public:
NS_IMETHOD
StyleSheetLoaded(CSSStyleSheet*, bool, nsresult)

View File

@ -394,9 +394,10 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Registry)
Registry();
virtual ~Registry();
protected:
virtual ~Registry();
typedef nsClassHashtable<mozilla::dom::CustomElementHashKey,
mozilla::dom::CustomElementDefinition>
DefinitionMap;
@ -538,6 +539,8 @@ protected:
class PendingLoad : public ExternalResourceLoad,
public nsIStreamListener
{
~PendingLoad() {}
public:
PendingLoad(nsDocument* aDisplayDocument) :
mDisplayDocument(aDisplayDocument)
@ -569,6 +572,7 @@ protected:
class LoadgroupCallbacks MOZ_FINAL : public nsIInterfaceRequestor
{
~LoadgroupCallbacks() {}
public:
LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks)
: mCallbacks(aOtherCallbacks)
@ -591,6 +595,7 @@ protected:
class _i##Shim MOZ_FINAL : public nsIInterfaceRequestor, \
public _i \
{ \
~_i##Shim() {} \
public: \
_i##Shim(nsIInterfaceRequestor* aIfreq, _i* aRealPtr) \
: mIfReq(aIfreq), mRealPtr(aRealPtr) \

View File

@ -66,13 +66,14 @@ class nsDocumentEncoder : public nsIDocumentEncoder
{
public:
nsDocumentEncoder();
virtual ~nsDocumentEncoder();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsDocumentEncoder)
NS_DECL_NSIDOCUMENTENCODER
protected:
virtual ~nsDocumentEncoder();
void Initialize(bool aClearCachedSerializer = true);
nsresult SerializeNodeStart(nsINode* aNode, int32_t aStartOffset,
int32_t aEndOffset, nsAString& aStr,

View File

@ -31,6 +31,8 @@ class nsFormData : public nsIDOMFormData,
public nsFormSubmission,
public nsWrapperCache
{
~nsFormData() {}
public:
nsFormData(nsISupports* aOwner = nullptr);

View File

@ -137,6 +137,8 @@ public:
nsFrameLoader* mFrameLoader; // WEAK
private:
~nsContentView() {}
nsresult Update(const ViewConfig& aConfig);
ViewID mScrollId;
@ -158,9 +160,9 @@ class nsFrameLoader MOZ_FINAL : public nsIFrameLoader,
protected:
nsFrameLoader(mozilla::dom::Element* aOwner, bool aNetworkCreated);
public:
~nsFrameLoader();
public:
bool AsyncScrollEnabled() const
{
return !!(mRenderMode & RENDER_MODE_ASYNC_SCROLL);

View File

@ -1209,6 +1209,8 @@ namespace dom {
class MessageManagerReporter MOZ_FINAL : public nsIMemoryReporter
{
~MessageManagerReporter() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMEMORYREPORTER

View File

@ -184,6 +184,7 @@ public:
}
}
private:
~nsFrameMessageManager()
{
for (int32_t i = mChildManagers.Count(); i > 0; --i) {
@ -205,6 +206,7 @@ public:
}
}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFrameMessageManager,
nsIContentFrameMessageManager)
@ -410,6 +412,8 @@ protected:
class nsScriptCacheCleaner MOZ_FINAL : public nsIObserver
{
~nsScriptCacheCleaner() {}
NS_DECL_ISUPPORTS
nsScriptCacheCleaner()

View File

@ -66,7 +66,6 @@ public:
nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
nsGenericDOMDataNode(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
virtual ~nsGenericDOMDataNode();
virtual void GetNodeValueInternal(nsAString& aNodeValue) MOZ_OVERRIDE;
virtual void SetNodeValueInternal(const nsAString& aNodeValue,
@ -225,6 +224,8 @@ public:
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsGenericDOMDataNode)
protected:
virtual ~nsGenericDOMDataNode();
virtual mozilla::dom::Element* GetNameSpaceElement()
{
nsINode *parent = GetParentNode();

View File

@ -33,6 +33,8 @@ namespace mozilla {
class HostObjectURLsReporter MOZ_FINAL : public nsIMemoryReporter
{
~HostObjectURLsReporter() {}
public:
NS_DECL_ISUPPORTS
@ -132,6 +134,8 @@ class BlobURLsReporter MOZ_FINAL : public nsIMemoryReporter
}
private:
~BlobURLsReporter() {}
struct EnumArg {
nsIHandleReportCallback* mCallback;
nsISupports* mData;

View File

@ -26,12 +26,13 @@ enum MixedContentTypes {
class nsMixedContentBlocker : public nsIContentPolicy
{
virtual ~nsMixedContentBlocker();
public:
NS_DECL_ISUPPORTS
NS_DECL_NSICONTENTPOLICY
nsMixedContentBlocker();
virtual ~nsMixedContentBlocker();
static bool sBlockMixedScript;
static bool sBlockMixedDisplay;
};

View File

@ -24,14 +24,15 @@
class nsNoDataProtocolContentPolicy MOZ_FINAL : public nsIContentPolicy
{
~nsNoDataProtocolContentPolicy()
{}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSICONTENTPOLICY
nsNoDataProtocolContentPolicy()
{}
~nsNoDataProtocolContentPolicy()
{}
};

View File

@ -34,9 +34,11 @@ class NodeInfo;
class nsNodeInfoManager MOZ_FINAL
{
private:
~nsNodeInfoManager();
public:
nsNodeInfoManager();
~nsNodeInfoManager();
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsNodeInfoManager)

View File

@ -1159,6 +1159,7 @@ public:
{}
protected:
~ObjectInterfaceRequestorShim() {}
nsCOMPtr<nsIObjectLoadingContent> mContent;
};
@ -3520,6 +3521,10 @@ nsObjectLoadingContent::SetupProtoChainRunner::SetupProtoChainRunner(
{
}
nsObjectLoadingContent::SetupProtoChainRunner::~SetupProtoChainRunner()
{
}
NS_IMETHODIMP
nsObjectLoadingContent::SetupProtoChainRunner::Run()
{

View File

@ -473,6 +473,7 @@ class nsObjectLoadingContent : public nsImageLoadingContent
// Helper class for SetupProtoChain
class SetupProtoChainRunner MOZ_FINAL : public nsIRunnable
{
~SetupProtoChainRunner();
public:
NS_DECL_ISUPPORTS

View File

@ -34,7 +34,6 @@ class nsPlainTextSerializer : public nsIContentSerializer
{
public:
nsPlainTextSerializer();
virtual ~nsPlainTextSerializer();
NS_DECL_ISUPPORTS
@ -67,6 +66,8 @@ public:
nsAString& aStr) MOZ_OVERRIDE;
protected:
virtual ~nsPlainTextSerializer();
nsresult GetAttributeValue(nsIAtom* aName, nsString& aValueRet);
void AddToLine(const char16_t* aStringToAdd, int32_t aLength);
void EndLine(bool softlinebreak, bool aBreakBySpace = false);

View File

@ -38,6 +38,8 @@ class nsRange MOZ_FINAL : public nsIDOMRange,
typedef mozilla::dom::DOMRect DOMRect;
typedef mozilla::dom::DOMRectList DOMRectList;
virtual ~nsRange();
public:
nsRange(nsINode* aNode)
: mRoot(nullptr)
@ -59,7 +61,6 @@ public:
MOZ_ASSERT(aNode, "range isn't in a document!");
mOwner = aNode->OwnerDoc();
}
virtual ~nsRange();
static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
nsIDOMNode* aEndParent, int32_t aEndOffset,

View File

@ -69,6 +69,11 @@ using namespace mozilla::dom;
//////////////////////////////////////////////////////////////
class nsScriptLoadRequest MOZ_FINAL : public nsISupports {
~nsScriptLoadRequest()
{
js_free(mScriptTextBuf);
}
public:
nsScriptLoadRequest(nsIScriptElement* aElement,
uint32_t aVersion,
@ -85,11 +90,6 @@ public:
{
}
~nsScriptLoadRequest()
{
js_free(mScriptTextBuf);
}
NS_DECL_THREADSAFE_ISUPPORTS
void FireScriptAvailable(nsresult aResult)

View File

@ -55,7 +55,6 @@ class nsScriptLoader : public nsIStreamLoaderObserver
public:
nsScriptLoader(nsIDocument* aDocument);
virtual ~nsScriptLoader();
NS_DECL_ISUPPORTS
NS_DECL_NSISTREAMLOADEROBSERVER
@ -245,6 +244,8 @@ public:
void **aOffThreadToken);
private:
virtual ~nsScriptLoader();
/**
* Unblocks the creator parser of the parser-blocking scripts.
*/

View File

@ -37,7 +37,6 @@ class nsSyncLoader : public nsIStreamListener,
{
public:
nsSyncLoader() : mLoading(false) {}
virtual ~nsSyncLoader();
NS_DECL_ISUPPORTS
@ -53,6 +52,8 @@ public:
NS_DECL_NSIINTERFACEREQUESTOR
private:
virtual ~nsSyncLoader();
nsresult PushAsyncStream(nsIStreamListener* aListener);
nsresult PushSyncStream(nsIStreamListener* aListener);
@ -64,9 +65,10 @@ private:
class nsForceXMLListener : public nsIStreamListener
{
virtual ~nsForceXMLListener();
public:
nsForceXMLListener(nsIStreamListener* aListener);
virtual ~nsForceXMLListener();
NS_DECL_ISUPPORTS
NS_FORWARD_NSISTREAMLISTENER(mListener->)

View File

@ -29,7 +29,6 @@ class nsINode;
class nsXMLContentSerializer : public nsIContentSerializer {
public:
nsXMLContentSerializer();
virtual ~nsXMLContentSerializer();
NS_DECL_ISUPPORTS
@ -68,6 +67,7 @@ class nsXMLContentSerializer : public nsIContentSerializer {
nsAString& aStr) MOZ_OVERRIDE;
protected:
virtual ~nsXMLContentSerializer();
/**
* Appends a char16_t character and increments the column position

View File

@ -183,6 +183,8 @@ public:
NS_DECL_NSIAUTHPROMPT
XMLHttpRequestAuthPrompt();
protected:
virtual ~XMLHttpRequestAuthPrompt();
};
@ -3436,6 +3438,8 @@ public:
}
private:
~AsyncVerifyRedirectCallbackForwarder() {}
nsRefPtr<nsXMLHttpRequest> mXHR;
};

View File

@ -612,9 +612,10 @@ protected:
NS_DECL_NSIHTTPHEADERVISITOR
nsHeaderVisitor(nsXMLHttpRequest* aXMLHttpRequest, nsIHttpChannel* aHttpChannel)
: mXHR(aXMLHttpRequest), mHttpChannel(aHttpChannel) {}
virtual ~nsHeaderVisitor() {}
const nsACString &Headers() { return mHeaders; }
private:
virtual ~nsHeaderVisitor() {}
nsCString mHeaders;
nsXMLHttpRequest* mXHR;
nsCOMPtr<nsIHttpChannel> mHttpChannel;
@ -794,12 +795,14 @@ class nsXMLHttpRequestXPCOMifier MOZ_FINAL : public nsIStreamListener,
{
}
private:
~nsXMLHttpRequestXPCOMifier() {
if (mXHR) {
mXHR->mXPCOMifier = nullptr;
}
}
public:
NS_FORWARD_NSISTREAMLISTENER(mXHR->)
NS_FORWARD_NSIREQUESTOBSERVER(mXHR->)
NS_FORWARD_NSICHANNELEVENTSINK(mXHR->)
@ -827,8 +830,9 @@ public:
}
nsXHRParseEndListener(nsIXMLHttpRequest* aXHR)
: mXHR(do_GetWeakReference(aXHR)) {}
virtual ~nsXHRParseEndListener() {}
private:
virtual ~nsXHRParseEndListener() {}
nsWeakPtr mXHR;
};

View File

@ -18,9 +18,10 @@ class HTMLBodyElement;
class BodyRule: public nsIStyleRule
{
virtual ~BodyRule();
public:
BodyRule(HTMLBodyElement* aPart);
virtual ~BodyRule();
NS_DECL_ISUPPORTS

View File

@ -96,7 +96,6 @@ class DistributedContentList : public nsINodeList
{
public:
DistributedContentList(HTMLContentElement* aHostElement);
virtual ~DistributedContentList();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DistributedContentList)
@ -111,6 +110,7 @@ public:
virtual uint32_t Length() const;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
protected:
virtual ~DistributedContentList();
nsRefPtr<HTMLContentElement> mParent;
nsCOMArray<nsIContent> mDistributedNodes;
};

View File

@ -28,7 +28,6 @@ class HTMLFormControlsCollection : public nsIHTMLCollection
{
public:
HTMLFormControlsCollection(HTMLFormElement* aForm);
virtual ~HTMLFormControlsCollection();
void DropFormReference();
@ -83,6 +82,7 @@ public:
using nsWrapperCache::GetWrapperPreserveColor;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
protected:
virtual ~HTMLFormControlsCollection();
virtual JSObject* GetWrapperPreserveColorInternal() MOZ_OVERRIDE
{
return nsWrapperCache::GetWrapperPreserveColor();

View File

@ -252,6 +252,8 @@ class HTMLInputElementState MOZ_FINAL : public nsISupports
{};
protected:
~HTMLInputElementState() {}
nsString mValue;
nsTArray<nsCOMPtr<nsIDOMFile> > mFiles;
bool mChecked;
@ -330,6 +332,8 @@ namespace {
class DirPickerRecursiveFileEnumerator MOZ_FINAL
: public nsISimpleEnumerator
{
~DirPickerRecursiveFileEnumerator() {}
public:
NS_DECL_ISUPPORTS
@ -706,6 +710,8 @@ NS_IMPL_ISUPPORTS(HTMLInputElement::nsFilePickerShownCallback,
class nsColorPickerShownCallback MOZ_FINAL
: public nsIColorPickerShownCallback
{
~nsColorPickerShownCallback() {}
public:
nsColorPickerShownCallback(HTMLInputElement* aInput,
nsIColorPicker* aColorPicker)

View File

@ -40,6 +40,9 @@ class Date;
class DirPickerFileListBuilderTask;
class UploadLastDir MOZ_FINAL : public nsIObserver, public nsSupportsWeakReference {
~UploadLastDir() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
@ -66,15 +69,15 @@ public:
class ContentPrefCallback MOZ_FINAL : public nsIContentPrefCallback2
{
public:
virtual ~ContentPrefCallback()
{ }
public:
ContentPrefCallback(nsIFilePicker* aFilePicker, nsIFilePickerShownCallback* aFpCallback)
: mFilePicker(aFilePicker)
, mFpCallback(aFpCallback)
{ }
virtual ~ContentPrefCallback()
{ }
NS_DECL_ISUPPORTS
NS_DECL_NSICONTENTPREFCALLBACK2
@ -1364,12 +1367,12 @@ private:
class nsFilePickerShownCallback
: public nsIFilePickerShownCallback
{
public:
nsFilePickerShownCallback(HTMLInputElement* aInput,
nsIFilePicker* aFilePicker);
virtual ~nsFilePickerShownCallback()
{ }
public:
nsFilePickerShownCallback(HTMLInputElement* aInput,
nsIFilePicker* aFilePicker);
NS_DECL_ISUPPORTS
NS_IMETHOD Done(int16_t aResult) MOZ_OVERRIDE;

View File

@ -242,6 +242,8 @@ class HTMLMediaElement::MediaLoadListener MOZ_FINAL : public nsIStreamListener,
public nsIInterfaceRequestor,
public nsIObserver
{
~MediaLoadListener() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER

View File

@ -36,7 +36,6 @@ class HTMLOptionsCollection : public nsIHTMLCollection
typedef HTMLOptionElementOrHTMLOptGroupElement HTMLOptionOrOptGroupElement;
public:
HTMLOptionsCollection(HTMLSelectElement* aSelect);
virtual ~HTMLOptionsCollection();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -44,6 +43,8 @@ public:
using nsWrapperCache::GetWrapperPreserveColor;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
protected:
virtual ~HTMLOptionsCollection();
virtual JSObject* GetWrapperPreserveColorInternal() MOZ_OVERRIDE
{
return nsWrapperCache::GetWrapperPreserveColor();

View File

@ -54,12 +54,13 @@ class HTMLPropertiesCollection : public nsIHTMLCollection,
friend class PropertyStringList;
public:
HTMLPropertiesCollection(nsGenericHTMLElement* aRoot);
virtual ~HTMLPropertiesCollection();
// nsWrapperCache
using nsWrapperCache::GetWrapperPreserveColor;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
protected:
virtual ~HTMLPropertiesCollection();
virtual JSObject* GetWrapperPreserveColorInternal() MOZ_OVERRIDE
{
return nsWrapperCache::GetWrapperPreserveColor();
@ -151,7 +152,6 @@ class PropertyNodeList : public nsINodeList,
public:
PropertyNodeList(HTMLPropertiesCollection* aCollection,
nsIContent* aRoot, const nsAString& aName);
virtual ~PropertyNodeList();
virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
@ -190,6 +190,8 @@ public:
void SetDirty() { mIsDirty = true; }
protected:
virtual ~PropertyNodeList();
// Make sure this list is up to date, in case the DOM has been mutated.
void EnsureFresh();

View File

@ -50,10 +50,6 @@ public:
SelectState()
{
}
virtual ~SelectState()
{
}
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SELECT_STATE_IID)
NS_DECL_ISUPPORTS
@ -73,6 +69,10 @@ public:
}
private:
virtual ~SelectState()
{
}
nsCheapSet<nsStringHashKey> mValues;
nsCheapSet<nsUint32HashKey> mIndices;
};

View File

@ -29,7 +29,6 @@ class TableRowsCollection : public nsIHTMLCollection,
{
public:
TableRowsCollection(HTMLTableElement *aParent);
virtual ~TableRowsCollection();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSIDOMHTMLCOLLECTION
@ -53,6 +52,8 @@ public:
using nsWrapperCache::GetWrapperPreserveColor;
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
protected:
virtual ~TableRowsCollection();
virtual JSObject* GetWrapperPreserveColorInternal() MOZ_OVERRIDE
{
return nsWrapperCache::GetWrapperPreserveColor();

View File

@ -19,6 +19,8 @@ namespace dom {
class MediaError MOZ_FINAL : public nsIDOMMediaError,
public nsWrapperCache
{
~MediaError() {}
public:
MediaError(HTMLMediaElement* aParent, uint16_t aCode);

View File

@ -110,6 +110,10 @@ TextTrackManager::TextTrackManager(HTMLMediaElement *aMediaElement)
}
}
TextTrackManager::~TextTrackManager()
{
}
TextTrackList*
TextTrackManager::TextTracks() const
{

View File

@ -35,6 +35,8 @@ class TextTrackCue;
class TextTrackManager MOZ_FINAL : public nsIDOMEventListener
{
~TextTrackManager();
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(TextTrackManager)

View File

@ -17,6 +17,18 @@
namespace mozilla {
namespace dom {
class TimeRanges;
}
template<>
struct HasDangerousPublicDestructor<dom::TimeRanges>
{
static const bool value = true;
};
namespace dom {
// Implements media TimeRanges:
// http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#timeranges
class TimeRanges MOZ_FINAL : public nsIDOMTimeRanges

View File

@ -110,6 +110,8 @@ class UndoAttrChanged : public UndoTxn {
UndoAttrChanged(mozilla::dom::Element* aElement, int32_t aNameSpaceID,
nsIAtom* aAttribute, int32_t aModType);
protected:
~UndoAttrChanged() {}
nsresult SaveRedoState();
nsCOMPtr<nsIContent> mElement;
int32_t mNameSpaceID;
@ -218,6 +220,8 @@ class UndoTextChanged : public UndoTxn {
UndoTextChanged(nsIContent* aContent,
CharacterDataChangeInfo* aChange);
protected:
~UndoTextChanged() {}
void SaveRedoState();
nsCOMPtr<nsIContent> mContent;
UndoCharacterChangedData mChange;
@ -330,6 +334,7 @@ class UndoContentAppend : public UndoTxn {
NS_IMETHOD UndoTransaction();
UndoContentAppend(nsIContent* aContent);
protected:
~UndoContentAppend() {}
nsCOMPtr<nsIContent> mContent;
nsCOMArray<nsIContent> mChildren;
};
@ -400,6 +405,7 @@ class UndoContentInsert : public UndoTxn {
UndoContentInsert(nsIContent* aContent, nsIContent* aChild,
int32_t aInsertIndex);
protected:
~UndoContentInsert() {}
nsCOMPtr<nsIContent> mContent;
nsCOMPtr<nsIContent> mChild;
nsCOMPtr<nsIContent> mNextNode;
@ -488,6 +494,7 @@ class UndoContentRemove : public UndoTxn {
UndoContentRemove(nsIContent* aContent, nsIContent* aChild,
int32_t aInsertIndex);
protected:
~UndoContentRemove() {}
nsCOMPtr<nsIContent> mContent;
nsCOMPtr<nsIContent> mChild;
nsCOMPtr<nsIContent> mNextNode;
@ -733,6 +740,7 @@ class FunctionCallTxn : public UndoTxn {
NS_IMETHOD UndoTransaction();
FunctionCallTxn(DOMTransaction* aTransaction, uint32_t aFlags);
protected:
~FunctionCallTxn() {}
/**
* Call a function member on the transaction object with the
* specified function name.

View File

@ -17,6 +17,8 @@ namespace dom {
class ValidityState MOZ_FINAL : public nsIDOMValidityState,
public nsWrapperCache
{
~ValidityState() {}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ValidityState)

View File

@ -166,6 +166,10 @@ private:
class nsGenericHTMLElementTearoff : public nsIDOMElementCSSInlineStyle
{
virtual ~nsGenericHTMLElementTearoff()
{
}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
nsGenericHTMLElementTearoff(nsGenericHTMLElement *aElement)
@ -173,10 +177,6 @@ class nsGenericHTMLElementTearoff : public nsIDOMElementCSSInlineStyle
{
}
virtual ~nsGenericHTMLElementTearoff()
{
}
NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
{
NS_ADDREF(*aStyle = mElement->Style());

View File

@ -17,9 +17,11 @@ class nsIFormControl;
*/
class nsRadioVisitor : public nsIRadioVisitor
{
protected:
virtual ~nsRadioVisitor() { }
public:
nsRadioVisitor() { }
virtual ~nsRadioVisitor() { }
NS_DECL_ISUPPORTS

View File

@ -191,18 +191,20 @@ public:
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
private:
~nsAnonDivObserver() {}
nsTextEditorState* mTextEditorState;
};
class nsTextInputSelectionImpl MOZ_FINAL : public nsSupportsWeakReference
, public nsISelectionController
{
~nsTextInputSelectionImpl(){}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTextInputSelectionImpl, nsISelectionController)
nsTextInputSelectionImpl(nsFrameSelection *aSel, nsIPresShell *aShell, nsIContent *aLimiter);
~nsTextInputSelectionImpl(){}
void SetScrollableFrame(nsIScrollableFrame *aScrollableFrame);
nsFrameSelection* GetConstFrameSelection()
@ -652,9 +654,6 @@ public:
/** the default constructor
*/
explicit nsTextInputListener(nsITextControlElement* aTxtCtrlElement);
/** the default destructor. virtual due to the possibility of derivation.
*/
virtual ~nsTextInputListener();
/** SetEditor gives an address to the editor that will be accessed
* @param aEditor the editor this listener calls for editing operations
@ -673,6 +672,9 @@ public:
NS_DECL_NSIEDITOROBSERVER
protected:
/** the default destructor. virtual due to the possibility of derivation.
*/
virtual ~nsTextInputListener();
nsresult UpdateTextInputCommands(const nsAString& commandsToUpdate);

View File

@ -32,9 +32,10 @@ template<typename> struct Nullable;
class HTMLAllCollection MOZ_FINAL : public nsISupports
, public nsWrapperCache
{
~HTMLAllCollection();
public:
HTMLAllCollection(nsHTMLDocument* aDocument);
~HTMLAllCollection();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HTMLAllCollection)

View File

@ -80,9 +80,11 @@ private:
class MediaDocumentStreamListener: public nsIStreamListener
{
protected:
virtual ~MediaDocumentStreamListener();
public:
MediaDocumentStreamListener(MediaDocument *aDocument);
virtual ~MediaDocumentStreamListener();
void SetStreamListener(nsIStreamListener *aListener);
NS_DECL_ISUPPORTS

View File

@ -15,7 +15,6 @@ class nsXMLPrettyPrinter : public nsStubDocumentObserver
{
public:
nsXMLPrettyPrinter();
virtual ~nsXMLPrettyPrinter();
NS_DECL_ISUPPORTS
@ -41,6 +40,8 @@ public:
*/
void Unhook();
private:
virtual ~nsXMLPrettyPrinter();
/**
* Signals for unhooking by setting mUnhookPending if the node changed is
* non-anonymous content.

View File

@ -25,7 +25,6 @@ class nsXULContextMenuBuilder : public nsIMenuBuilder,
{
public:
nsXULContextMenuBuilder();
virtual ~nsXULContextMenuBuilder();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULContextMenuBuilder,
@ -35,6 +34,8 @@ public:
NS_DECL_NSIXULCONTEXTMENUBUILDER
protected:
virtual ~nsXULContextMenuBuilder();
nsresult CreateElement(nsIAtom* aTag,
nsIDOMHTMLElement* aHTMLElement,
mozilla::dom::Element** aResult);

View File

@ -124,6 +124,8 @@ uint32_t nsXULPrototypeAttribute::gNumCacheFills;
class nsXULElementTearoff MOZ_FINAL : public nsIDOMElementCSSInlineStyle,
public nsIFrameLoaderOwner
{
~nsXULElementTearoff() {}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULElementTearoff,

View File

@ -115,7 +115,6 @@ public:
Type mType;
virtual ~nsXULPrototypeNode() {}
virtual nsresult Serialize(nsIObjectOutputStream* aStream,
nsXULPrototypeDocument* aProtoDoc,
const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) = 0;
@ -145,6 +144,7 @@ public:
protected:
nsXULPrototypeNode(Type aType)
: mType(aType) {}
virtual ~nsXULPrototypeNode() {}
};
class nsXULPrototypeElement : public nsXULPrototypeNode

View File

@ -26,7 +26,6 @@ public:
// aIsContext is true, the popup is a context menu which opens on a
// context menu event.
nsXULPopupListener(mozilla::dom::Element* aElement, bool aIsContext);
virtual ~nsXULPopupListener(void);
// nsISupports
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -34,6 +33,8 @@ public:
NS_DECL_NSIDOMEVENTLISTENER
protected:
virtual ~nsXULPopupListener(void);
// open the popup. aEvent is the event that triggered the popup such as
// a mouse click and aTargetContent is the target of this event.
virtual nsresult LaunchPopup(nsIDOMEvent* aEvent, nsIContent* aTargetContent);

View File

@ -28,7 +28,6 @@ class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher,
{
public:
nsXULCommandDispatcher(nsIDocument* aDocument);
virtual ~nsXULCommandDispatcher();
// nsISupports
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -40,6 +39,8 @@ public:
void Disconnect();
protected:
virtual ~nsXULCommandDispatcher();
already_AddRefed<nsPIWindowRoot> GetWindowRoot();
nsIContent* GetRootFocusedContentAndWindow(nsPIDOMWindow** aWindow);

View File

@ -27,7 +27,6 @@ class XULContentSinkImpl : public nsIXMLContentSink,
{
public:
XULContentSinkImpl();
virtual ~XULContentSinkImpl();
// nsISupports
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -54,6 +53,8 @@ public:
nsresult Init(nsIDocument* aDocument, nsXULPrototypeDocument* aPrototype);
protected:
virtual ~XULContentSinkImpl();
// pseudo-constants
char16_t* mText;
int32_t mTextLength;

View File

@ -39,6 +39,8 @@ public:
class nsRDFQuery MOZ_FINAL : public nsITemplateRDFQuery
{
~nsRDFQuery() { Finish(); }
public:
nsRDFQuery(nsXULTemplateQueryProcessorRDF* aProcessor)
@ -48,8 +50,6 @@ public:
mCachedResults(nullptr)
{ }
~nsRDFQuery() { Finish(); }
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsRDFQuery)

View File

@ -37,6 +37,9 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsXMLBindingSet, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsXMLBindingSet, Release)
nsXMLBindingSet::~nsXMLBindingSet()
{}
nsresult
nsXMLBindingSet::AddBinding(nsIAtom* aVar, nsIDOMXPathExpression* aExpr)
{

View File

@ -50,6 +50,8 @@ struct nsXMLBinding {
*/
class nsXMLBindingSet MOZ_FINAL
{
~nsXMLBindingSet();
public:
// results hold a reference to a binding set in their

View File

@ -47,7 +47,6 @@ class nsXULTemplateBuilder : public nsIXULTemplateBuilder,
public:
nsXULTemplateBuilder();
virtual ~nsXULTemplateBuilder();
nsresult InitGlobals();
@ -334,6 +333,8 @@ public:
nsIRDFResource** aResource);
protected:
virtual ~nsXULTemplateBuilder();
nsCOMPtr<nsISupports> mDataSource;
nsCOMPtr<nsIRDFDataSource> mDB;
nsCOMPtr<nsIRDFCompositeDataSource> mCompDB;

View File

@ -48,8 +48,6 @@ public:
nsXULTemplateQueryProcessorRDF();
~nsXULTemplateQueryProcessorRDF();
nsresult InitGlobals();
// nsISupports interface
@ -274,6 +272,8 @@ public:
#endif
protected:
~nsXULTemplateQueryProcessorRDF();
// We are an observer of the composite datasource. The cycle is
// broken when the document is destroyed.
nsCOMPtr<nsIRDFDataSource> mDB;

View File

@ -28,6 +28,8 @@ private:
nsCOMArray<nsIAtom> mColumnNames;
~nsXULTemplateResultSetStorage() {}
public:
// nsISupports interface
@ -58,6 +60,8 @@ public:
private:
~nsXULTemplateQueryProcessorStorage() {}
nsCOMPtr<mozIStorageConnection> mStorageConnection;
bool mGenerationStarted;
};

View File

@ -69,6 +69,8 @@ class nsXMLQuery MOZ_FINAL : public nsISupports
{ }
protected:
~nsXMLQuery() {}
nsXULTemplateQueryProcessorXML* mProcessor;
nsCOMPtr<nsIAtom> mMemberVariable;
@ -96,6 +98,8 @@ private:
// current position within the list of results
uint32_t mPosition;
~nsXULTemplateResultSetXML() {}
public:
// nsISupports interface
@ -146,6 +150,8 @@ public:
private:
~nsXULTemplateQueryProcessorXML() {}
bool mGenerationStarted;
nsRefPtrHashtable<nsISupportsHashKey, nsXMLBindingSet> mRuleToBindingsMap;

View File

@ -32,8 +32,6 @@ public:
const Instantiation& aInst,
nsIRDFResource* aNode);
~nsXULTemplateResultRDF();
nsITemplateRDFQuery* Query() { return mQuery; }
nsXULTemplateQueryProcessorRDF* GetProcessor()
@ -65,6 +63,7 @@ public:
HasMemoryElement(const MemoryElement& aMemoryElement);
protected:
~nsXULTemplateResultRDF();
// query that generated the result
nsCOMPtr<nsITemplateRDFQuery> mQuery;

View File

@ -33,6 +33,11 @@ private:
bool mCheckedNext;
~nsXULTemplateResultSetRDF()
{
delete mInstantiations;
}
public:
// nsISupports interface
@ -50,11 +55,6 @@ public:
mCurrent(nullptr),
mCheckedNext(false)
{ }
~nsXULTemplateResultSetRDF()
{
delete mInstantiations;
}
};
#endif // nsXULTemplateResultSetRDF_h__

View File

@ -22,6 +22,10 @@ nsXULTemplateResultStorage::nsXULTemplateResultStorage(nsXULTemplateResultSetSto
}
}
nsXULTemplateResultStorage::~nsXULTemplateResultStorage()
{
}
NS_IMETHODIMP
nsXULTemplateResultStorage::GetIsContainer(bool* aIsContainer)
{

View File

@ -26,6 +26,8 @@ public:
protected:
~nsXULTemplateResultStorage();
nsRefPtr<nsXULTemplateResultSetStorage> mResultSet;
nsCOMArray<nsIVariant> mValues;

View File

@ -27,12 +27,12 @@ public:
nsIDOMNode* aNode,
nsXMLBindingSet* aBindings);
~nsXULTemplateResultXML() {}
void GetNode(nsIDOMNode** aNode);
protected:
~nsXULTemplateResultXML() {}
// ID used for persisting data. It is constructed using the mNode's
// base uri plus the node's id to form 'baseuri#id'. If the node has no
// id, then an id of the form 'row<some number>' is generated. In the