Bug 1094544. Use [Exposed=System] some more instead of hardcoding binding bits in xpc::InitGlobalObject. r=bholley

This commit is contained in:
Boris Zbarsky 2014-11-06 10:54:38 -05:00
Родитель c4cb4d7865
Коммит 59a4947078
4 изменённых файлов: 4 добавлений и 17 удалений

Просмотреть файл

@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
[Constructor(DOMString name, optional DOMString message = "")]
[Constructor(DOMString name, optional DOMString message = ""),
Exposed=(Window,System)]
interface DOMError {
[Constant]
readonly attribute DOMString name;

Просмотреть файл

@ -11,7 +11,7 @@
*/
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
Exposed=(Window,Worker)]
Exposed=(Window,Worker,System)]
interface TextDecoder {
[Constant]
readonly attribute DOMString encoding;

Просмотреть файл

@ -11,7 +11,7 @@
*/
[Constructor(optional DOMString utfLabel = "utf-8"),
Exposed=(Window,Worker)]
Exposed=(Window,Worker,System)]
interface TextEncoder {
[Constant]
readonly attribute DOMString encoding;

Просмотреть файл

@ -23,9 +23,6 @@
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/Exceptions.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/TextDecoderBinding.h"
#include "mozilla/dom/TextEncoderBinding.h"
#include "mozilla/dom/DOMErrorBinding.h"
#include "nsDOMMutationObserver.h"
#include "nsICycleCollectorListener.h"
@ -437,17 +434,6 @@ InitGlobalObject(JSContext* aJSContext, JS::Handle<JSObject*> aGlobal, uint32_t
// Stuff coming through this path always ends up as a DOM global.
MOZ_ASSERT(js::GetObjectClass(aGlobal)->flags & JSCLASS_DOM_GLOBAL);
// Init WebIDL binding constructors wanted on all XPConnect globals.
//
// XXX Please do not add any additional classes here without the approval of
// the XPConnect module owner.
if (!PromiseBinding::GetConstructorObject(aJSContext, aGlobal) ||
!TextDecoderBinding::GetConstructorObject(aJSContext, aGlobal) ||
!TextEncoderBinding::GetConstructorObject(aJSContext, aGlobal) ||
!DOMErrorBinding::GetConstructorObject(aJSContext, aGlobal)) {
return UnexpectedFailure(false);
}
if (!(aFlags & nsIXPConnect::DONT_FIRE_ONNEWGLOBALHOOK))
JS_FireOnNewGlobalObject(aJSContext, aGlobal);