Bug 736686 - Part 1: Make dictionary initializers callable off main thread. r=khuey

This commit is contained in:
Masatoshi Kimura 2012-03-24 12:33:49 +01:00
parent 63ed9dae81
commit 749ec9839a

View File

@ -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<nsCxPusher> 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")