Skip to content

Commit

Permalink
Bug 1182977 (part 2) - Use PLDHashTable::Iterator in dom/storage/. r=…
Browse files Browse the repository at this point in the history
…khuey.
  • Loading branch information
nnethercote committed Jul 22, 2015
1 parent d22646b commit 3f98d86
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions dom/storage/DOMStorageDBThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,13 @@ DOMStorageDBThread::ShouldPreloadScope(const nsACString& aScope)
return mScopesHavingData.Contains(aScope);
}

namespace {

PLDHashOperator
GetScopesHavingDataEnum(nsCStringHashKey* aKey, void* aArg)
{
InfallibleTArray<nsCString>* scopes =
static_cast<InfallibleTArray<nsCString>*>(aArg);
scopes->AppendElement(aKey->GetKey());
return PL_DHASH_NEXT;
}

} // namespace

void
DOMStorageDBThread::GetScopesHavingData(InfallibleTArray<nsCString>* aScopes)
{
MonitorAutoLock monitor(mThreadObserver->GetMonitor());
mScopesHavingData.EnumerateEntries(GetScopesHavingDataEnum, aScopes);
for (auto iter = mScopesHavingData.Iter(); !iter.Done(); iter.Next()) {
aScopes->AppendElement(iter.Get()->GetKey());
}
}

nsresult
Expand Down

0 comments on commit 3f98d86

Please sign in to comment.