зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1028383 - Make ITopLevelProtocol assert to enforce its assumptions that things happen on the main thread - r=bent
This commit is contained in:
Родитель
31db832664
Коммит
fed8dee123
|
@ -19,11 +19,14 @@ namespace ipc {
|
|||
|
||||
IToplevelProtocol::~IToplevelProtocol()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mOpenActors.clear();
|
||||
}
|
||||
|
||||
void IToplevelProtocol::AddOpenedActor(IToplevelProtocol* aActor)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
#ifdef DEBUG
|
||||
for (const IToplevelProtocol* actor = mOpenActors.getFirst();
|
||||
actor;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "mozilla/ipc/Transport.h"
|
||||
#include "mozilla/ipc/MessageLink.h"
|
||||
#include "mozilla/LinkedList.h"
|
||||
#include "MainThreadUtils.h"
|
||||
|
||||
#if defined(ANDROID) && defined(DEBUG)
|
||||
#include <android/log.h>
|
||||
|
@ -187,6 +188,7 @@ protected:
|
|||
: mProtocolId(aProtoId)
|
||||
, mTrans(nullptr)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
}
|
||||
|
||||
~IToplevelProtocol();
|
||||
|
@ -212,10 +214,12 @@ public:
|
|||
*/
|
||||
IToplevelProtocol* GetFirstOpenedActors()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return mOpenActors.getFirst();
|
||||
}
|
||||
const IToplevelProtocol* GetFirstOpenedActors() const
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return mOpenActors.getFirst();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче