зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1627892 - Replace custom AutoLock by BaseAutoLock. r=ttung
Differential Revision: https://phabricator.services.mozilla.com/D69945
This commit is contained in:
Родитель
c25aee166f
Коммит
521c25b58c
|
@ -252,7 +252,7 @@ already_AddRefed<Promise> Cache::Match(JSContext* aCx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
RefPtr<InternalRequest> ir =
|
||||
ToInternalRequest(aCx, aRequest, IgnoreBody, aRv);
|
||||
|
@ -282,7 +282,7 @@ already_AddRefed<Promise> Cache::MatchAll(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
CacheQueryParams params;
|
||||
ToCacheQueryParams(params, aOptions);
|
||||
|
@ -314,7 +314,7 @@ already_AddRefed<Promise> Cache::Add(JSContext* aContext,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
if (!IsValidPutRequestMethod(aRequest, aRv)) {
|
||||
return nullptr;
|
||||
|
@ -348,7 +348,7 @@ already_AddRefed<Promise> Cache::AddAll(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
GlobalObject global(aContext, mGlobal->GetGlobalJSObject());
|
||||
MOZ_DIAGNOSTIC_ASSERT(!global.Failed());
|
||||
|
@ -394,7 +394,7 @@ already_AddRefed<Promise> Cache::Put(JSContext* aCx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
if (NS_WARN_IF(!IsValidPutRequestMethod(aRequest, aRv))) {
|
||||
return nullptr;
|
||||
|
@ -428,7 +428,7 @@ already_AddRefed<Promise> Cache::Delete(JSContext* aCx,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
RefPtr<InternalRequest> ir =
|
||||
ToInternalRequest(aCx, aRequest, IgnoreBody, aRv);
|
||||
|
@ -457,7 +457,7 @@ already_AddRefed<Promise> Cache::Keys(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
CacheQueryParams params;
|
||||
ToCacheQueryParams(params, aOptions);
|
||||
|
@ -593,7 +593,7 @@ already_AddRefed<Promise> Cache::PutAll(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
CacheChild::AutoLock actorLock(mActor);
|
||||
CacheChild::AutoLock actorLock(*mActor);
|
||||
|
||||
AutoChildOpArgs args(this, CachePutAllArgs(), aRequestList.Length());
|
||||
|
||||
|
|
|
@ -27,17 +27,8 @@ class CacheChild final : public PCacheChild, public ActorChild {
|
|||
friend class PCacheChild;
|
||||
|
||||
public:
|
||||
class MOZ_RAII AutoLock final {
|
||||
CacheChild* mActor;
|
||||
|
||||
public:
|
||||
explicit AutoLock(CacheChild* aActor) : mActor(aActor) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mActor);
|
||||
mActor->Lock();
|
||||
}
|
||||
|
||||
~AutoLock() { mActor->Unlock(); }
|
||||
};
|
||||
friend class mozilla::detail::BaseAutoLock<CacheChild&>;
|
||||
using AutoLock = mozilla::detail::BaseAutoLock<CacheChild&>;
|
||||
|
||||
CacheChild();
|
||||
~CacheChild();
|
||||
|
|
Загрузка…
Ссылка в новой задаче