mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out bug 950745 for crashes
This commit is contained in:
parent
0c2b7e6090
commit
b8e57e2e8d
@ -25,7 +25,6 @@
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
#include "mozilla/InternalMutationEvent.h"
|
||||
#include "mozilla/ipc/MessageChannel.h"
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
|
@ -36,8 +36,6 @@ struct RunnableMethodTraits<mozilla::ipc::MessageChannel>
|
||||
DebugAbort(__FILE__, __LINE__, #_cond,## __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
static uintptr_t gDispatchingUrgentMessageCount;
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
@ -1101,13 +1099,9 @@ MessageChannel::DispatchUrgentMessage(const Message& aMsg)
|
||||
|
||||
Message *reply = nullptr;
|
||||
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
gDispatchingUrgentMessageCount++;
|
||||
mDispatchingUrgentMessageCount++;
|
||||
Result rv = mListener->OnCallReceived(aMsg, reply);
|
||||
mDispatchingUrgentMessageCount--;
|
||||
gDispatchingUrgentMessageCount--;
|
||||
|
||||
if (!MaybeHandleError(rv, "DispatchUrgentMessage")) {
|
||||
delete reply;
|
||||
@ -1758,11 +1752,5 @@ MessageChannel::DumpInterruptStack(const char* const pfx) const
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ProcessingUrgentMessages()
|
||||
{
|
||||
return gDispatchingUrgentMessageCount > 0;
|
||||
}
|
||||
|
||||
} // ipc
|
||||
} // mozilla
|
||||
|
@ -641,9 +641,6 @@ class MessageChannel : HasResultCodes
|
||||
bool mAbortOnError;
|
||||
};
|
||||
|
||||
bool
|
||||
ProcessingUrgentMessages();
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -8,12 +8,10 @@
|
||||
#include "JavaScriptChild.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/ipc/MessageChannel.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "xpcprivate.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "AccessCheck.h"
|
||||
|
||||
using namespace JS;
|
||||
using namespace mozilla;
|
||||
@ -21,17 +19,6 @@ using namespace mozilla::jsipc;
|
||||
|
||||
using mozilla::AutoSafeJSContext;
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
static void
|
||||
UrgentMessageCheck(JSContext *cx, HandleScript script)
|
||||
{
|
||||
// We're only allowed to enter chrome JS code while processing urgent
|
||||
// messages.
|
||||
if (ipc::ProcessingUrgentMessages())
|
||||
MOZ_RELEASE_ASSERT(xpc::AccessCheck::isChrome(js::GetContextCompartment(cx)));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
FinalizeChild(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartment, void *data)
|
||||
{
|
||||
@ -44,9 +31,6 @@ JavaScriptChild::JavaScriptChild(JSRuntime *rt)
|
||||
: JavaScriptShared(rt),
|
||||
JavaScriptBase<PJavaScriptChild>(rt)
|
||||
{
|
||||
#ifdef NIGHTLY_BUILD
|
||||
js::SetAssertOnScriptEntryHook(rt, UrgentMessageCheck);
|
||||
#endif
|
||||
}
|
||||
|
||||
JavaScriptChild::~JavaScriptChild()
|
||||
|
@ -30,6 +30,5 @@ LOCAL_INCLUDES += [
|
||||
'/js/ipc',
|
||||
'/js/public',
|
||||
'/js/xpconnect/src',
|
||||
'/js/xpconnect/wrappers',
|
||||
]
|
||||
|
||||
|
@ -63,14 +63,6 @@ js::ForgetSourceHook(JSRuntime *rt)
|
||||
return Move(rt->sourceHook);
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
JS_FRIEND_API(void)
|
||||
js::SetAssertOnScriptEntryHook(JSRuntime *rt, AssertOnScriptEntryHook hook)
|
||||
{
|
||||
rt->assertOnScriptEntryHook_ = hook;
|
||||
}
|
||||
#endif
|
||||
|
||||
JS_FRIEND_API(void)
|
||||
JS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data)
|
||||
{
|
||||
|
@ -418,13 +418,6 @@ SetSourceHook(JSRuntime *rt, mozilla::UniquePtr<SourceHook> hook);
|
||||
extern JS_FRIEND_API(mozilla::UniquePtr<SourceHook>)
|
||||
ForgetSourceHook(JSRuntime *rt);
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
typedef void (*AssertOnScriptEntryHook)(JSContext *cx, JS::HandleScript script);
|
||||
|
||||
extern JS_FRIEND_API(void)
|
||||
SetAssertOnScriptEntryHook(JSRuntime *rt, AssertOnScriptEntryHook hook);
|
||||
#endif
|
||||
|
||||
extern JS_FRIEND_API(JS::Zone *)
|
||||
GetCompartmentZone(JSCompartment *comp);
|
||||
|
||||
|
@ -374,11 +374,6 @@ js::RunScript(JSContext *cx, RunState &state)
|
||||
{
|
||||
JS_CHECK_RECURSION(cx, return false);
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
if (AssertOnScriptEntryHook hook = cx->runtime()->assertOnScriptEntryHook_)
|
||||
(*hook)(cx, state.script());
|
||||
#endif
|
||||
|
||||
SPSEntryMarker marker(cx->runtime(), state.script());
|
||||
|
||||
state.script()->ensureNonLazyCanonicalFunction(cx);
|
||||
|
@ -203,7 +203,7 @@ class RunState
|
||||
return (GeneratorState *)this;
|
||||
}
|
||||
|
||||
JS::HandleScript script() const { return script_; }
|
||||
JSScript *script() const { return script_; }
|
||||
|
||||
virtual InterpreterFrame *pushInterpreterFrame(JSContext *cx) = 0;
|
||||
virtual void setReturnValue(Value v) = 0;
|
||||
|
@ -172,9 +172,6 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
||||
negativeInfinityValue(DoubleValue(NegativeInfinity<double>())),
|
||||
positiveInfinityValue(DoubleValue(PositiveInfinity<double>())),
|
||||
emptyString(nullptr),
|
||||
#ifdef NIGHTLY_BUILD
|
||||
assertOnScriptEntryHook_(nullptr),
|
||||
#endif
|
||||
debugMode(false),
|
||||
spsProfiler(thisFromCtor()),
|
||||
profilingScripts(false),
|
||||
|
@ -1010,10 +1010,6 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
|
||||
mozilla::UniquePtr<js::SourceHook> sourceHook;
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
js::AssertOnScriptEntryHook assertOnScriptEntryHook_;
|
||||
#endif
|
||||
|
||||
/* If true, new compartments are initially in debug mode. */
|
||||
bool debugMode;
|
||||
|
||||
|
@ -4341,8 +4341,6 @@ inline static mozilla::HangMonitor::ActivityType ActivityTypeForMessage(UINT msg
|
||||
// and http://msdn.microsoft.com/en-us/library/ms633573%28VS.85%29.aspx
|
||||
LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(!ipc::ProcessingUrgentMessages());
|
||||
|
||||
HangMonitor::NotifyActivity(ActivityTypeForMessage(msg));
|
||||
|
||||
return mozilla::CallWindowProcCrashProtected(WindowProcInternal, hWnd, msg, wParam, lParam);
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/HangMonitor.h"
|
||||
#include "mozilla/IOInterposer.h"
|
||||
#include "mozilla/ipc/MessageChannel.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsXPCOMPrivate.h"
|
||||
#include "mozilla/ChaosMode.h"
|
||||
@ -687,9 +686,6 @@ nsThread::ProcessNextEvent(bool aMayWait, bool* aResult)
|
||||
{
|
||||
LOG(("THRD(%p) ProcessNextEvent [%u %u]\n", this, aMayWait, mRunningEvent));
|
||||
|
||||
// If we're on the main thread, we shouldn't be dispatching CPOWs.
|
||||
MOZ_RELEASE_ASSERT(mIsMainThread != MAIN_THREAD || !ipc::ProcessingUrgentMessages());
|
||||
|
||||
if (NS_WARN_IF(PR_GetCurrentThread() != mThread)) {
|
||||
return NS_ERROR_NOT_SAME_THREAD;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user