Bug 1453869 part 8. Teach Cu.importGlobalProperties about DOMParser. r=mrbkap
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 20 Apr 2018 23:03:32 -0400
changeset 468458 72056af41ae0bfb73e74f19717365a0fa8e0370a
parent 468457 1ad69430054b58bedc5fe9e9561982c1524dc312
child 468459 7ff0d0f4e9ab0e6e7c895c13beef16f8ab58d122
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1453869
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1453869 part 8. Teach Cu.importGlobalProperties about DOMParser. r=mrbkap MozReview-Commit-ID: 36Op1KdLZJe
js/xpconnect/src/Sandbox.cpp
js/xpconnect/src/xpcprivate.h
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -29,16 +29,17 @@
 #include "XrayWrapper.h"
 #include "Crypto.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/BlobBinding.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/dom/CSSBinding.h"
 #include "mozilla/dom/CSSRuleBinding.h"
 #include "mozilla/dom/DirectoryBinding.h"
+#include "mozilla/dom/DOMParserBinding.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/dom/Fetch.h"
 #include "mozilla/dom/FileBinding.h"
 #include "mozilla/dom/InspectorUtilsBinding.h"
 #include "mozilla/dom/MessageChannelBinding.h"
 #include "mozilla/dom/MessagePortBinding.h"
@@ -807,16 +808,18 @@ xpc::GlobalProperties::Parse(JSContext* 
         } else if (!strcmp(name.ptr(), "ChromeUtils")) {
             ChromeUtils = true;
         } else if (!strcmp(name.ptr(), "CSS")) {
             CSS = true;
         } else if (!strcmp(name.ptr(), "CSSRule")) {
             CSSRule = true;
         } else if (!strcmp(name.ptr(), "Directory")) {
             Directory = true;
+        } else if (!strcmp(name.ptr(), "DOMParser")) {
+            DOMParser = true;
         } else if (!strcmp(name.ptr(), "Event")) {
             Event = true;
         } else if (!strcmp(name.ptr(), "File")) {
             File = true;
         } else if (!strcmp(name.ptr(), "FileReader")) {
             FileReader = true;
         } else if (!strcmp(name.ptr(), "FormData")) {
             FormData = true;
@@ -883,16 +886,20 @@ xpc::GlobalProperties::Define(JSContext*
 
     if (CSSRule && !dom::CSSRuleBinding::GetConstructorObject(cx))
         return false;
 
     if (Directory &&
         !dom::DirectoryBinding::GetConstructorObject(cx))
         return false;
 
+    if (DOMParser &&
+        !dom::DOMParserBinding::GetConstructorObject(cx))
+        return false;
+
     if (Event &&
         !dom::EventBinding::GetConstructorObject(cx))
         return false;
 
     if (File &&
         !dom::FileBinding::GetConstructorObject(cx))
         return false;
 
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2607,16 +2607,17 @@ struct GlobalProperties {
     bool DefineInSandbox(JSContext* cx, JS::HandleObject obj);
 
     // Interface objects we can expose.
     bool Blob : 1;
     bool ChromeUtils : 1;
     bool CSS : 1;
     bool CSSRule : 1;
     bool Directory : 1;
+    bool DOMParser : 1;
     bool Event : 1;
     bool File : 1;
     bool FileReader: 1;
     bool FormData : 1;
     bool InspectorUtils : 1;
     bool MessageChannel: 1;
     bool NodeFilter : 1;
     bool TextDecoder : 1;