зеркало из https://github.com/mozilla/gecko-dev.git
Backout e4550612487b & c3008e662841 (bug 827274) for mochitest-chrome crashes on a CLOSED TREE
This commit is contained in:
Родитель
97094c4d13
Коммит
446aa2a6f8
|
@ -389,14 +389,6 @@ CTypesActivityCallback(JSContext* aCx,
|
|||
worker->EndCTypesCall();
|
||||
break;
|
||||
|
||||
case js::CTYPES_CALLBACK_BEGIN:
|
||||
worker->BeginCTypesCallback();
|
||||
break;
|
||||
|
||||
case js::CTYPES_CALLBACK_END:
|
||||
worker->EndCTypesCallback();
|
||||
break;
|
||||
|
||||
default:
|
||||
MOZ_NOT_REACHED("Unknown type flag!");
|
||||
}
|
||||
|
|
|
@ -771,22 +771,6 @@ public:
|
|||
void
|
||||
EndCTypesCall();
|
||||
|
||||
void
|
||||
BeginCTypesCallback()
|
||||
{
|
||||
// If a callback is beginning then we need to do the exact same thing as
|
||||
// when a ctypes call ends.
|
||||
EndCTypesCall();
|
||||
}
|
||||
|
||||
void
|
||||
EndCTypesCallback()
|
||||
{
|
||||
// If a callback is ending then we need to do the exact same thing as
|
||||
// when a ctypes call begins.
|
||||
BeginCTypesCall();
|
||||
}
|
||||
|
||||
private:
|
||||
WorkerPrivate(JSContext* aCx, JSObject* aObject, WorkerPrivate* aParent,
|
||||
JSContext* aParentJSContext, const nsAString& aScriptURL,
|
||||
|
|
|
@ -5790,7 +5790,9 @@ FunctionType::Call(JSContext* cx,
|
|||
}
|
||||
|
||||
// Let the runtime callback know that we are about to call into C.
|
||||
js::AutoCTypesActivityCallback autoCallback(cx, js::CTYPES_CALL_BEGIN, js::CTYPES_CALL_END);
|
||||
js::CTypesActivityCallback activityCallback = cx->runtime->ctypesActivityCallback;
|
||||
if (activityCallback)
|
||||
activityCallback(cx, js::CTYPES_CALL_BEGIN);
|
||||
|
||||
uintptr_t fn = *reinterpret_cast<uintptr_t*>(CData::GetData(obj));
|
||||
|
||||
|
@ -5819,8 +5821,8 @@ FunctionType::Call(JSContext* cx,
|
|||
|
||||
errno = savedErrno;
|
||||
|
||||
// We're no longer calling into C.
|
||||
autoCallback.DoEndCallback();
|
||||
if (activityCallback)
|
||||
activityCallback(cx, js::CTYPES_CALL_END);
|
||||
|
||||
// Store the error value for later consultation with |ctypes.getStatus|
|
||||
JSObject *objCTypes = CType::GetGlobalCTypes(cx, typeObj);
|
||||
|
@ -6103,12 +6105,6 @@ CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData)
|
|||
// Retrieve the essentials from our closure object.
|
||||
ClosureInfo* cinfo = static_cast<ClosureInfo*>(userData);
|
||||
JSContext* cx = cinfo->cx;
|
||||
|
||||
// Let the runtime callback know that we are about to call into JS again. The end callback will
|
||||
// fire automatically when we exit this function.
|
||||
js::AutoCTypesActivityCallback autoCallback(cx, js::CTYPES_CALLBACK_BEGIN,
|
||||
js::CTYPES_CALLBACK_END);
|
||||
|
||||
RootedObject typeObj(cx, cinfo->typeObj);
|
||||
RootedObject thisObj(cx, cinfo->thisObj);
|
||||
RootedObject jsfnObj(cx, cinfo->jsfnObj);
|
||||
|
|
|
@ -990,15 +990,3 @@ js::SetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb)
|
|||
{
|
||||
rt->ctypesActivityCallback = cb;
|
||||
}
|
||||
|
||||
js::AutoCTypesActivityCallback::AutoCTypesActivityCallback(JSContext *cx,
|
||||
js::CTypesActivityType beginType,
|
||||
js::CTypesActivityType endType
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: cx(cx), callback(cx->runtime->ctypesActivityCallback), beginType(beginType), endType(endType)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
|
||||
if (callback)
|
||||
callback(cx, beginType);
|
||||
}
|
||||
|
|
|
@ -1563,9 +1563,7 @@ IsTypedArrayThisCheck(JS::IsAcceptableThis test);
|
|||
|
||||
enum CTypesActivityType {
|
||||
CTYPES_CALL_BEGIN,
|
||||
CTYPES_CALL_END,
|
||||
CTYPES_CALLBACK_BEGIN,
|
||||
CTYPES_CALLBACK_END
|
||||
CTYPES_CALL_END
|
||||
};
|
||||
|
||||
typedef void
|
||||
|
@ -1578,29 +1576,6 @@ typedef void
|
|||
JS_FRIEND_API(void)
|
||||
SetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);
|
||||
|
||||
class JS_FRIEND_API(AutoCTypesActivityCallback) {
|
||||
private:
|
||||
JSContext *cx;
|
||||
CTypesActivityCallback callback;
|
||||
CTypesActivityType beginType;
|
||||
CTypesActivityType endType;
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
|
||||
public:
|
||||
AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,
|
||||
CTypesActivityType endType
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
~AutoCTypesActivityCallback() {
|
||||
DoEndCallback();
|
||||
}
|
||||
void DoEndCallback() {
|
||||
if (callback) {
|
||||
callback(cx, endType);
|
||||
callback = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* jsfriendapi_h___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче