From e5e0b12c279cf050350002fce8d353c1fc0b8b7a Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Thu, 18 Aug 2016 15:20:48 -0700 Subject: [PATCH] Bug 1288870, part 3 - Remove the now-vestigial Mark code for XPCNativeInterface. r=billm XPCNativeInterface::Mark(), Unmark() and IsMarked() don't do anything any more, so anything that calls them can be deleted. This removes the only use of XPCCallContext::CanGetInterface(), so delete that, too. MozReview-Commit-ID: 4w3aPTVXNDI --- js/xpconnect/src/XPCInlines.h | 21 +-------------------- js/xpconnect/src/XPCJSRuntime.cpp | 5 ----- js/xpconnect/src/xpcprivate.h | 9 --------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/js/xpconnect/src/XPCInlines.h b/js/xpconnect/src/XPCInlines.h index 5ff32688739c..96c8a90c26c4 100644 --- a/js/xpconnect/src/XPCInlines.h +++ b/js/xpconnect/src/XPCInlines.h @@ -119,12 +119,6 @@ XPCCallContext::GetSet() const return mSet; } -inline bool -XPCCallContext::CanGetInterface() const -{ - return mState >= HAVE_NAME; -} - inline XPCNativeInterface* XPCCallContext::GetInterface() const { @@ -442,26 +436,13 @@ XPCNativeSet::MatchesSetUpToInterface(const XPCNativeSet* other, inline void XPCNativeSet::Mark() { - if (IsMarked()) - return; - - XPCNativeInterface* const * pp = mInterfaces; - - for (int i = (int) mInterfaceCount; i > 0; i--, pp++) - (*pp)->Mark(); - - MarkSelfOnly(); + mMarked = 1; } #ifdef DEBUG inline void XPCNativeSet::ASSERT_NotMarked() { MOZ_ASSERT(!IsMarked(), "bad"); - - XPCNativeInterface* const * pp = mInterfaces; - - for (int i = (int) mInterfaceCount; i > 0; i--, pp++) - MOZ_ASSERT(!(*pp)->IsMarked(), "bad"); } #endif diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 4e580c1a136f..8670299a5c5c 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -804,11 +804,6 @@ XPCJSRuntime::FinalizeCallback(JSFreeOp* fop, if (set) set->Mark(); } - if (ccxp->CanGetInterface()) { - XPCNativeInterface* iface = ccxp->GetInterface(); - if (iface) - iface->Mark(); - } ccxp = ccxp->GetPrevCallContext(); } } diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 7d24545cf357..5a3f3db42747 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -1242,10 +1242,6 @@ class XPCNativeInterface final void DebugDump(int16_t depth); - void Mark() {} - void Unmark() {} - bool IsMarked() const { return false; } - size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf); protected: @@ -1364,11 +1360,6 @@ class XPCNativeSet final inline void TraceJS(JSTracer* trc) {} inline void AutoTrace(JSTracer* trc) {} - private: - void MarkSelfOnly() { - mMarked = 1; - } - public: void Unmark() { mMarked = 0;