Backed out changesets 6be352955252 and 1bc459138617 (bug 770840) for Android nightly bustage (bug 870782).

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2013-05-10 12:38:26 -04:00
Родитель cb2a0bbccd
Коммит e9058c72dc
3 изменённых файлов: 36 добавлений и 13 удалений

Просмотреть файл

@ -11,7 +11,6 @@
#include "nsProxyRelease.h"
#include "nsThreadUtils.h"
#include "nsTextFormatter.h"
#include "nsCycleCollectorUtils.h"
// NOTE: much of the fancy footwork is done in xpcstubs.cpp
@ -151,8 +150,6 @@ nsXPCWrappedJS::QueryInterface(REFNSIID aIID, void** aInstancePtr)
nsrefcnt
nsXPCWrappedJS::AddRef(void)
{
if (!MOZ_LIKELY(NS_IsMainThread() || NS_IsCycleCollectorThread()))
MOZ_CRASH();
nsrefcnt cnt = NS_AtomicIncrementRefcnt(mRefCnt);
NS_LOG_ADDREF(this, cnt, "nsXPCWrappedJS", sizeof(*this));
@ -167,8 +164,6 @@ nsXPCWrappedJS::AddRef(void)
nsrefcnt
nsXPCWrappedJS::Release(void)
{
if (!MOZ_LIKELY(NS_IsMainThread() || NS_IsCycleCollectorThread()))
MOZ_CRASH();
NS_PRECONDITION(0 != mRefCnt, "dup release");
if (mMainThreadOnly && !NS_IsMainThread()) {
@ -282,10 +277,6 @@ nsXPCWrappedJS::GetNewOrUsed(JSContext* cx,
nsISupports* aOuter,
nsXPCWrappedJS** wrapperResult)
{
// Do a release-mode assert against accessing nsXPCWrappedJS off-main-thread.
if (!MOZ_LIKELY(NS_IsMainThread() || NS_IsCycleCollectorThread()))
MOZ_CRASH();
JS::RootedObject jsObj(cx, aJSObj);
JSObject2WrappedJSMap* map;
nsXPCWrappedJS* root = nullptr;
@ -568,10 +559,6 @@ nsXPCWrappedJS::CallMethod(uint16_t methodIndex,
const XPTMethodDescriptor* info,
nsXPTCMiniVariant* params)
{
// Do a release-mode assert against accessing nsXPCWrappedJS off-main-thread.
if (!MOZ_LIKELY(NS_IsMainThread() || NS_IsCycleCollectorThread()))
MOZ_CRASH();
if (!IsValid())
return NS_ERROR_UNEXPECTED;
if (NS_IsMainThread() != mMainThread) {

Просмотреть файл

@ -0,0 +1,35 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 sts=4 et
* 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/. */
function run_test() {
var tm = Components.classes["@mozilla.org/thread-manager;1"].getService();
var thr = tm.newThread(0);
var foundThreadError = false;
var listener = {
observe: function(message) {
if (/JS function on a different thread/.test(message.message))
foundThreadError = true;
}
};
var cs = Components.classes["@mozilla.org/consoleservice;1"].
getService(Components.interfaces.nsIConsoleService);
cs.registerListener(listener);
thr.dispatch({
run: function() {
do_check_true(false);
}
}, Components.interfaces.nsIThread.DISPATCH_NORMAL);
thr.shutdown();
cs.unregisterListener(listener);
do_check_true(foundThreadError);
}

Просмотреть файл

@ -7,6 +7,7 @@ tail =
[test_bug451678.js]
[test_bug596580.js]
[test_bug604362.js]
[test_bug608142.js]
[test_bug641378.js]
[test_bug677864.js]
[test_bug711404.js]