Commit e5e0b12c authored by Andrew McCreight's avatar Andrew McCreight
Browse files

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
parent f8d14c90
Loading
Loading
Loading
Loading
+1 −20
Original line number Diff line number Diff line
@@ -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

+0 −5
Original line number Diff line number Diff line
@@ -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();
                }
            }
+0 −9
Original line number Diff line number Diff line
@@ -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;