mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1103324 - Instantiate an AutoNoJSAPI when dispatching IPC messages. r=billm
This commit is contained in:
parent
0dc2747b42
commit
6e61fa1c76
@ -104,11 +104,18 @@ InitScriptSettings()
|
||||
sScriptSettingsTLS.set(nullptr);
|
||||
}
|
||||
|
||||
void DestroyScriptSettings()
|
||||
void
|
||||
DestroyScriptSettings()
|
||||
{
|
||||
MOZ_ASSERT(sScriptSettingsTLS.get() == nullptr);
|
||||
}
|
||||
|
||||
bool
|
||||
ScriptSettingsInitialized()
|
||||
{
|
||||
return sScriptSettingsTLS.initialized();
|
||||
}
|
||||
|
||||
ScriptSettingsStackEntry::ScriptSettingsStackEntry(nsIGlobalObject *aGlobal,
|
||||
bool aCandidate)
|
||||
: mGlobalObject(aGlobal)
|
||||
|
@ -63,6 +63,7 @@ private:
|
||||
*/
|
||||
void InitScriptSettings();
|
||||
void DestroyScriptSettings();
|
||||
bool ScriptSettingsInitialized();
|
||||
|
||||
/*
|
||||
* Static helpers in ScriptSettings which track the number of listeners
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include "mozilla/ipc/MessageChannel.h"
|
||||
#include "mozilla/ipc/ProtocolUtils.h"
|
||||
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Move.h"
|
||||
@ -79,6 +81,8 @@
|
||||
using namespace mozilla;
|
||||
using namespace std;
|
||||
|
||||
using mozilla::dom::AutoNoJSAPI;
|
||||
using mozilla::dom::ScriptSettingsInitialized;
|
||||
using mozilla::MonitorAutoLock;
|
||||
using mozilla::MonitorAutoUnlock;
|
||||
|
||||
@ -1058,6 +1062,9 @@ MessageChannel::OnMaybeDequeueOne()
|
||||
void
|
||||
MessageChannel::DispatchMessage(const Message &aMsg)
|
||||
{
|
||||
Maybe<AutoNoJSAPI> nojsapi;
|
||||
if (ScriptSettingsInitialized() && NS_IsMainThread())
|
||||
nojsapi.emplace();
|
||||
if (aMsg.is_sync())
|
||||
DispatchSyncMessage(aMsg);
|
||||
else if (aMsg.is_interrupt())
|
||||
|
Loading…
Reference in New Issue
Block a user