Bug 1489301 - Part 5: Expose all System-only objects on Window, r=bzbarsky
☠☠ backed out by 77f4c84bebf0 ☠ ☠
authorNika Layzell <nika@thelayzells.com>
Sat, 20 Oct 2018 20:05:38 -0400
changeset 490731 529524df76a62485a06367438281b9a1155b9b42
parent 490730 f34bc8a40bec4df77ca477793a8932f6683baa8c
child 490732 1c0823540b44ff83a6319a363aab6e017faddaf4
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersbzbarsky
bugs1489301
milestone65.0a1
Bug 1489301 - Part 5: Expose all System-only objects on Window, r=bzbarsky There is a limited number of these, and this allows me to completely remove mention of the 'System' global. In the future System-only exposure could be achieved using a [Func] enabler. Differential Revision: https://phabricator.services.mozilla.com/D9400
dom/chrome-webidl/ChannelWrapper.webidl
dom/chrome-webidl/MozDocumentObserver.webidl
dom/chrome-webidl/WebExtensionContentScript.webidl
dom/chrome-webidl/WebExtensionPolicy.webidl
dom/webidl/AddonManager.webidl
--- a/dom/chrome-webidl/ChannelWrapper.webidl
+++ b/dom/chrome-webidl/ChannelWrapper.webidl
@@ -36,17 +36,17 @@ enum MozContentPolicyType {
   "speculative",
   "other"
 };
 
 /**
  * A thin wrapper around nsIChannel and nsIHttpChannel that allows JS
  * callers to access them without XPConnect overhead.
  */
-[ChromeOnly, Exposed=System]
+[ChromeOnly, Exposed=Window]
 interface ChannelWrapper : EventTarget {
   /**
    * Returns the wrapper instance for the given channel. The same wrapper is
    * always returned for a given channel.
    */
   static ChannelWrapper get(MozChannel channel);
 
   /**
--- a/dom/chrome-webidl/MozDocumentObserver.webidl
+++ b/dom/chrome-webidl/MozDocumentObserver.webidl
@@ -4,14 +4,14 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 callback interface MozDocumentCallback {
   void onNewDocument(MozDocumentMatcher matcher, WindowProxy window);
   void onPreloadDocument(MozDocumentMatcher matcher, LoadInfo loadInfo);
 };
 
-[ChromeOnly, Constructor(MozDocumentCallback callbacks), Exposed=System]
+[ChromeOnly, Constructor(MozDocumentCallback callbacks), Exposed=Window]
 interface MozDocumentObserver {
   [Throws]
   void observe(sequence<MozDocumentMatcher> matchers);
   void disconnect();
 };
--- a/dom/chrome-webidl/WebExtensionContentScript.webidl
+++ b/dom/chrome-webidl/WebExtensionContentScript.webidl
@@ -4,17 +4,17 @@
 
 interface LoadInfo;
 interface URI;
 interface WindowProxy;
 
 typedef (MatchPatternSet or sequence<DOMString>) MatchPatternSetOrStringSequence;
 typedef (MatchGlob or DOMString) MatchGlobOrString;
 
-[Constructor(MozDocumentMatcherInit options), ChromeOnly, Exposed=System]
+[Constructor(MozDocumentMatcherInit options), ChromeOnly, Exposed=Window]
 interface MozDocumentMatcher {
   /**
    * Returns true if the script's match and exclude patterns match the given
    * URI, without reference to attributes such as `allFrames`.
    */
   boolean matchesURI(URI uri);
 
   /**
@@ -127,17 +127,17 @@ enum ContentScriptRunAt {
   /**
    * The first point after the page and all of its resources has fully loaded
    * when the event loop is idle, and can run scripts without delaying a paint
    * event.
    */
   "document_idle",
 };
 
-[Constructor(WebExtensionPolicy extension, WebExtensionContentScriptInit options), ChromeOnly, Exposed=System]
+[Constructor(WebExtensionPolicy extension, WebExtensionContentScriptInit options), ChromeOnly, Exposed=Window]
 interface WebExtensionContentScript : MozDocumentMatcher {
   /**
    * The earliest point in the load cycle at which this script should run. For
    * static content scripts, in extensions which were present at browser
    * startup, the browser makes every effort to make sure that the script runs
    * no later than this point in the load cycle. For dynamic content scripts,
    * and scripts from extensions installed during this session, the scripts
    * may run at a later point.
--- a/dom/chrome-webidl/WebExtensionPolicy.webidl
+++ b/dom/chrome-webidl/WebExtensionPolicy.webidl
@@ -6,17 +6,17 @@ interface URI;
 interface WindowProxy;
 
 callback WebExtensionLocalizeCallback = DOMString (DOMString unlocalizedText);
 
 /**
  * Defines the platform-level policies for a WebExtension, including its
  * permissions and the characteristics of its moz-extension: URLs.
  */
-[Constructor(WebExtensionInit options), ChromeOnly, Exposed=System]
+[Constructor(WebExtensionInit options), ChromeOnly, Exposed=Window]
 interface WebExtensionPolicy {
   /**
    * The add-on's internal ID, as specified in its manifest.json file or its
    * XPI signature.
    */
   [Constant, StoreInSlot]
   readonly attribute DOMString id;
 
--- a/dom/webidl/AddonManager.webidl
+++ b/dom/webidl/AddonManager.webidl
@@ -77,13 +77,13 @@ interface AddonManager : EventTarget {
    * @return A promise that resolves to an instance of AddonInstall.
    */
   Promise<AddonInstall> createInstall(optional addonInstallOptions options);
 
   // Indicator to content whether permissions prompts are enabled
   readonly attribute boolean permissionPromptsEnabled;
 };
 
-[ChromeOnly,Exposed=System,HeaderFile="mozilla/AddonManagerWebAPI.h"]
+[ChromeOnly,Exposed=Window,HeaderFile="mozilla/AddonManagerWebAPI.h"]
 interface AddonManagerPermissions {
   static boolean isHostPermitted(DOMString host);
 };