Bug 1450321, part 2 - Remove the Locked methods.
Now that there are no locks, there's no need for "Locked" methods.
MozReview-Commit-ID: 39Vx6v2GV42
--- a/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
@@ -43,22 +43,16 @@ xptiInterfaceEntry::xptiInterfaceEntry(c
SetScriptableFlag(aIface->IsScriptable());
SetBuiltinClassFlag(aIface->IsBuiltinClass());
SetMainProcessScriptableOnlyFlag(aIface->IsMainProcessScriptableOnly());
}
bool
xptiInterfaceEntry::Resolve()
{
- return ResolveLocked();
-}
-
-bool
-xptiInterfaceEntry::ResolveLocked()
-{
int resolvedState = GetResolveState();
if (resolvedState == FULLY_RESOLVED) {
return true;
}
if (resolvedState == RESOLVE_FAILED) {
return false;
}
@@ -68,17 +62,17 @@ xptiInterfaceEntry::ResolveLocked()
// Finish out resolution by finding parent and Resolving it so
// we can set the info we get from it.
uint16_t parent_index = mDescriptor->mParentInterface;
if (parent_index) {
xptiInterfaceEntry* parent = mTypelib->GetEntryAt(parent_index - 1);
- if (!parent || !parent->EnsureResolvedLocked()) {
+ if (!parent || !parent->EnsureResolved()) {
SetResolvedState(RESOLVE_FAILED);
return false;
}
mParent = parent;
if (parent->GetHasNotXPCOMFlag()) {
SetHasNotXPCOMFlag();
} else {
@@ -566,17 +560,17 @@ xptiInterfaceEntry::InterfaceInfo()
mInfo = new xptiInterfaceInfo(this);
}
RefPtr<xptiInterfaceInfo> info = mInfo;
return info.forget();
}
void
-xptiInterfaceEntry::LockedInvalidateInterfaceInfo()
+xptiInterfaceEntry::InvalidateInterfaceInfo()
{
if (mInfo) {
mInfo->Invalidate();
mInfo = nullptr;
}
}
bool
@@ -637,17 +631,17 @@ xptiInterfaceInfo::Release(void)
// If InterfaceInfo added a reference before we acquired the monitor
// then we want to bail out of here without destorying the object.
if (mRefCnt) {
return 1;
}
if (mEntry) {
- mEntry->LockedInterfaceInfoDeathNotification();
+ mEntry->InterfaceInfoDeathNotification();
mEntry = nullptr;
}
delete this;
return 0;
}
return cnt;
}
--- a/xpcom/reflect/xptinfo/xptiWorkingSet.cpp
+++ b/xpcom/reflect/xptinfo/xptiWorkingSet.cpp
@@ -28,17 +28,17 @@ XPTInterfaceInfoManager::xptiWorkingSet:
XPT_NewArena(XPTI_ARENA8_BLOCK_SIZE, XPTI_ARENA1_BLOCK_SIZE);
}
void
XPTInterfaceInfoManager::xptiWorkingSet::InvalidateInterfaceInfos()
{
for (auto iter = mNameTable.Iter(); !iter.Done(); iter.Next()) {
xptiInterfaceEntry* entry = iter.UserData();
- entry->LockedInvalidateInterfaceInfo();
+ entry->InvalidateInterfaceInfo();
}
}
XPTInterfaceInfoManager::xptiWorkingSet::~xptiWorkingSet()
{
MOZ_COUNT_DTOR(xptiWorkingSet);
// Only destroy the arena if we're doing leak stats. Why waste shutdown
--- a/xpcom/reflect/xptinfo/xptiprivate.h
+++ b/xpcom/reflect/xptinfo/xptiprivate.h
@@ -219,18 +219,18 @@ public:
bool EnsureResolved() { return IsFullyResolved() ? true : Resolve(); }
already_AddRefed<xptiInterfaceInfo> InterfaceInfo();
bool InterfaceInfoEquals(const xptiInterfaceInfo* info) const
{
return info == mInfo;
}
- void LockedInvalidateInterfaceInfo();
- void LockedInterfaceInfoDeathNotification() { mInfo = nullptr; }
+ void InvalidateInterfaceInfo();
+ void InterfaceInfoDeathNotification() { mInfo = nullptr; }
xptiInterfaceEntry* Parent() const
{
NS_ASSERTION(IsFullyResolved(), "Parent() called while not resolved?");
return mParent;
}
const nsID& IID() const { return mIID; }
@@ -284,26 +284,16 @@ private:
xptiInterfaceEntry(const XPTInterfaceDescriptor* aIface,
xptiTypelibGuts* aTypelib);
~xptiInterfaceEntry();
void SetResolvedState(int state) { mFlags.SetState(uint8_t(state)); }
bool Resolve();
- // We only call these "*Locked" variants after locking. This is done to
- // allow reentrace as files are loaded and various interfaces resolved
- // without having to worry about the locked state.
-
- bool EnsureResolvedLocked()
- {
- return IsFullyResolved() ? true : ResolveLocked();
- }
- bool ResolveLocked();
-
// private helpers
nsresult GetEntryForParam(uint16_t methodIndex,
const nsXPTParamInfo* param,
xptiInterfaceEntry** entry);
nsresult GetTypeInArray(const nsXPTParamInfo* param,
uint16_t dimension,