зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1246153 part 3. Use the new clean global setup for doing from-JSON creation of dictionaries. r=bholley
This commit is contained in:
Родитель
63950bd866
Коммит
80d8bedf90
|
@ -12321,8 +12321,15 @@ class CGDictionary(CGThing):
|
|||
"Init", "bool",
|
||||
[Argument('const nsAString&', 'aJSON')],
|
||||
body=dedent("""
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
AutoSafeJSContext cx;
|
||||
AutoJSAPI jsapi;
|
||||
JSObject* cleanGlobal = SimpleGlobalObject::Create(SimpleGlobalObject::GlobalType::BindingDetail);
|
||||
if (!cleanGlobal) {
|
||||
return false;
|
||||
}
|
||||
if (!jsapi.Init(cleanGlobal)) {
|
||||
return false;
|
||||
}
|
||||
JSContext* cx = jsapi.cx();
|
||||
JS::Rooted<JS::Value> json(cx);
|
||||
bool ok = ParseJSON(cx, aJSON, &json);
|
||||
NS_ENSURE_TRUE(ok, false);
|
||||
|
@ -13401,6 +13408,8 @@ class CGBindingRoot(CGThing):
|
|||
return any(m.getExtendedAttribute("UseCounter") for m in iface.members)
|
||||
bindingHeaders["mozilla/UseCounter.h"] = any(
|
||||
descriptorRequiresTelemetry(d) for d in descriptors)
|
||||
bindingHeaders["mozilla/dom/SimpleGlobalObject.h"] = any(
|
||||
CGDictionary.dictionarySafeToJSONify(d) for d in dictionaries)
|
||||
|
||||
cgthings.extend(traverseMethods)
|
||||
cgthings.extend(unlinkMethods)
|
||||
|
|
Загрузка…
Ссылка в новой задаче