From 749ec9839ad6adddb7c3309dbbe4786757591f27 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Sat, 24 Mar 2012 12:33:49 +0100 Subject: [PATCH] Bug 736686 - Part 1: Make dictionary initializers callable off main thread. r=khuey --- js/xpconnect/src/dictionary_helper_gen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/xpconnect/src/dictionary_helper_gen.py b/js/xpconnect/src/dictionary_helper_gen.py index 0e7c47da7d7..ee615292910 100644 --- a/js/xpconnect/src/dictionary_helper_gen.py +++ b/js/xpconnect/src/dictionary_helper_gen.py @@ -429,8 +429,11 @@ def write_cpp(iface, fd): " }\n" " NS_ENSURE_STATE(aVal->isObject());\n\n" " JSObject* obj = &aVal->toObject();\n" - " nsCxPusher pusher;\n" - " NS_ENSURE_STATE(pusher.Push(aCx, false));\n" + " Maybe pusher;\n" + " if (NS_IsMainThread()) {\n" + " pusher.construct();\n" + " NS_ENSURE_STATE(pusher.ref().Push(aCx, false));\n" + " }\n" " JSAutoRequest ar(aCx);\n" " JSAutoEnterCompartment ac;\n" " NS_ENSURE_STATE(ac.enter(aCx, obj));\n")