mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 23:13:18 +00:00
755cb8b710
- Bug 1103036 - Ensure __delete__ message from TabChild doesn't get sent after ActorDestroy (r=bent) (c91362f82) - Bug 1103036 - Wait for ContentChild shutdown during profile-before-change; r=billm (98602a765) - Bug 1103036 - Use nsITimer for ContentParent shutdown timer (r=bent) (d8f453cb5) - Bug 1103036 - Use kill timer when shutting down ContentParent in shutdown observer; r=billm (0b3dba9bd) - Bug 1103036 - Don't send shutdown message to Nuwa processes; r=billm (3337de858) - Bug 1131375 - Fix message ordering for in-process message manager (r=smaug) (2256e6aa8) - Bug 1155224 - Add targetFrameLoader property to messages (r=smaug) (971ff2db4) - Bug 1134762 - Clean-up UseFastPath logic to avoid OOM error. r=kats (28e0da5c3) - HACK - include nsPIDOMWInindow to get tree compiling again, no clue why it is needed now (88c10e8b4) - Bug 982347 - Implement netError design changes. r=Unfocused (e27b9af06) - Bug 1014282: Do not direct every ssl error to 'Report Web Forgery' (r=margaret) (febb83ad8) - Bug 1035536 - add blank theme file for net error pages, r=Unfocused (cac5f43ba) - Bug 1035536 - move CSS to themes directory, r=dao (5191e1032) - Bug 859695 - OS.File should be adopted in PlacesBackups.jsm and PlacesUtils.jsm. r=mak (78ebec312) - Bug 529697 - (CSP 1.1) Implement form-action directive [3/4], r=unfocused (2f884e70f)
73 lines
1.7 KiB
C++
73 lines
1.7 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "SameProcessMessageQueue.h"
|
|
|
|
using namespace mozilla;
|
|
using namespace mozilla::dom;
|
|
|
|
SameProcessMessageQueue* SameProcessMessageQueue::sSingleton;
|
|
|
|
SameProcessMessageQueue::SameProcessMessageQueue()
|
|
{
|
|
}
|
|
|
|
SameProcessMessageQueue::~SameProcessMessageQueue()
|
|
{
|
|
// This code should run during shutdown, and we should already have pumped the
|
|
// event loop. So we should only see messages here if someone is sending
|
|
// messages pretty late in shutdown.
|
|
NS_WARN_IF_FALSE(mQueue.IsEmpty(), "Shouldn't send messages during shutdown");
|
|
sSingleton = nullptr;
|
|
}
|
|
|
|
void
|
|
SameProcessMessageQueue::Push(Runnable* aRunnable)
|
|
{
|
|
mQueue.AppendElement(aRunnable);
|
|
NS_DispatchToCurrentThread(aRunnable);
|
|
}
|
|
|
|
void
|
|
SameProcessMessageQueue::Flush()
|
|
{
|
|
nsTArray<RefPtr<Runnable>> queue;
|
|
mQueue.SwapElements(queue);
|
|
for (size_t i = 0; i < queue.Length(); i++) {
|
|
queue[i]->Run();
|
|
}
|
|
}
|
|
|
|
/* static */ SameProcessMessageQueue*
|
|
SameProcessMessageQueue::Get()
|
|
{
|
|
if (!sSingleton) {
|
|
sSingleton = new SameProcessMessageQueue();
|
|
}
|
|
return sSingleton;
|
|
}
|
|
|
|
SameProcessMessageQueue::Runnable::Runnable()
|
|
: mDispatched(false)
|
|
{
|
|
}
|
|
|
|
NS_IMPL_ISUPPORTS(SameProcessMessageQueue::Runnable, nsIRunnable)
|
|
|
|
nsresult
|
|
SameProcessMessageQueue::Runnable::Run()
|
|
{
|
|
if (mDispatched) {
|
|
return NS_OK;
|
|
}
|
|
|
|
SameProcessMessageQueue* queue = SameProcessMessageQueue::Get();
|
|
queue->mQueue.RemoveElement(this);
|
|
|
|
mDispatched = true;
|
|
return HandleMessage();
|
|
}
|