From 6ed33677cf520d46d29a12a4a5c42b1e404f6c26 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 5 Sep 2013 16:08:06 -0700 Subject: [PATCH] Bug 912411 (part 1) - Removed some jsapi.h includes in Gecko. r=bz. --HG-- extra : rebase_source : c0b73945bcd6978a616fd846e33e69fae9162d78 --- content/base/src/nsXMLHttpRequest.h | 1 - content/xbl/src/nsXBLService.h | 2 +- dom/bindings/Configuration.py | 2 +- js/jsd/jsd.h | 1 + js/jsd/jsdebug.h | 21 +++++++++++---------- js/xpconnect/wrappers/FilteringWrapper.h | 17 ++++++++++++----- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h index e18dd136560..9f98967cb7a 100644 --- a/content/base/src/nsXMLHttpRequest.h +++ b/content/base/src/nsXMLHttpRequest.h @@ -17,7 +17,6 @@ #include "nsIContent.h" #include "nsIStreamListener.h" #include "nsWeakReference.h" -#include "jsapi.h" #include "nsIChannelEventSink.h" #include "nsIAsyncVerifyRedirectCallback.h" #include "nsIInterfaceRequestor.h" diff --git a/content/xbl/src/nsXBLService.h b/content/xbl/src/nsXBLService.h index fdfe9a45cf0..ff0c39cd016 100644 --- a/content/xbl/src/nsXBLService.h +++ b/content/xbl/src/nsXBLService.h @@ -12,7 +12,7 @@ #include "nsString.h" #include "nsIObserver.h" #include "nsWeakReference.h" -#include "jsapi.h" // nsXBLJSClass derives from JSClass +#include "js/Class.h" // nsXBLJSClass derives from JSClass #include "nsTArray.h" class nsXBLBinding; diff --git a/dom/bindings/Configuration.py b/dom/bindings/Configuration.py index 70b0a0d7834..69d3c660816 100644 --- a/dom/bindings/Configuration.py +++ b/dom/bindings/Configuration.py @@ -224,7 +224,7 @@ class Descriptor(DescriptorProvider): # Do something sane for JSObject if self.nativeType == "JSObject": - headerDefault = "jsapi.h" + headerDefault = "js/TypeDecls.h" elif self.interface.isCallback() or self.interface.isJSImplemented(): # A copy of CGHeaders.getDeclarationFilename; we can't # import it here, sadly. diff --git a/js/jsd/jsd.h b/js/jsd/jsd.h index 13acbe26ef8..7044ead2c21 100644 --- a/js/jsd/jsd.h +++ b/js/jsd/jsd.h @@ -29,6 +29,7 @@ #define JSD_USE_NSPR_LOCKS 1 #endif /* MOZILLA_CLIENT */ +#include "jsapi.h" #include "jshash.h" #include "jsclist.h" #include "jsdebug.h" diff --git a/js/jsd/jsdebug.h b/js/jsd/jsdebug.h index faabceb0733..c773e161799 100644 --- a/js/jsd/jsdebug.h +++ b/js/jsd/jsdebug.h @@ -11,7 +11,8 @@ #ifndef jsdebug_h___ #define jsdebug_h___ -#include "jsapi.h" +#include "jstypes.h" +#include "js/TypeDecls.h" extern "C" { @@ -714,9 +715,9 @@ JSD_AddFullSourceText(JSDContext* jsdc, typedef unsigned (* JSD_ExecutionHookProc)(JSDContext* jsdc, JSDThreadState* jsdthreadstate, - unsigned type, + unsigned type, void* callerdata, - jsval* rval); + JS::Value* rval); /* possible 'type' params for JSD_CallHookProc */ #define JSD_HOOK_TOPLEVEL_START 0 /* about to evaluate top level script */ @@ -1005,14 +1006,14 @@ JSD_AttemptScriptInStackFrame(JSDContext* jsdc, const char *filename, unsigned lineno, JS::MutableHandleValue rval); /* -* Convert the given jsval to a string +* Convert the given JS::Value to a string * NOTE: The ErrorReporter hook might be called if this fails. */ extern JSD_PUBLIC_API(JSString*) JSD_ValToStringInStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate, JSDStackFrameInfo* jsdframe, - jsval val); + JS::Value val); /* * Get the JSDValue currently being thrown as an exception (may be NULL). @@ -1121,18 +1122,18 @@ JSD_CurrentThread(); /* * NOTE: JSDValue and JSDProperty objects are reference counted. This allows -* for rooting these objects AND any underlying garbage collected jsvals. +* for rooting these objects AND any underlying garbage collected JS::Values. * ALL JSDValue and JSDProperty objects returned by the functions below * MUST eventually be released using the appropriate JSD_Dropxxx function. */ /* -* Create a new JSDValue to wrap the given jsval +* Create a new JSDValue to wrap the given JS::Value * NOTE: must eventually release by calling JSD_DropValue (if not NULL) * *** new for version 1.1 **** */ extern JSD_PUBLIC_API(JSDValue*) -JSD_NewValue(JSDContext* jsdc, jsval val); +JSD_NewValue(JSDContext* jsdc, JS::Value val); /* * Release the JSDValue. After this call the object MUST not be referenced again! @@ -1142,10 +1143,10 @@ extern JSD_PUBLIC_API(void) JSD_DropValue(JSDContext* jsdc, JSDValue* jsdval); /* -* Get the jsval wrapped by this JSDValue +* Get the JS::Value wrapped by this JSDValue * *** new for version 1.1 **** */ -extern JSD_PUBLIC_API(jsval) +extern JSD_PUBLIC_API(JS::Value) JSD_GetValueWrappedJSVal(JSDContext* jsdc, JSDValue* jsdval); /* diff --git a/js/xpconnect/wrappers/FilteringWrapper.h b/js/xpconnect/wrappers/FilteringWrapper.h index 8eee2e3d4dd..49519a33ce6 100644 --- a/js/xpconnect/wrappers/FilteringWrapper.h +++ b/js/xpconnect/wrappers/FilteringWrapper.h @@ -8,8 +8,15 @@ #ifndef __FilteringWrapper_h__ #define __FilteringWrapper_h__ -#include -#include +#include "mozilla/Attributes.h" +#include "jswrapper.h" +#include "js/CallNonGenericMethod.h" + +struct JSPropertyDescriptor; + +namespace JS { +class AutoIdVector; +} namespace xpc { @@ -28,11 +35,11 @@ class FilteringWrapper : public Base { JS::MutableHandle desc, unsigned flags) MOZ_OVERRIDE; virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle wrapper, - js::AutoIdVector &props) MOZ_OVERRIDE; + JS::AutoIdVector &props) MOZ_OVERRIDE; virtual bool enumerate(JSContext *cx, JS::Handle wrapper, - js::AutoIdVector &props) MOZ_OVERRIDE; + JS::AutoIdVector &props) MOZ_OVERRIDE; virtual bool keys(JSContext *cx, JS::Handle wrapper, - js::AutoIdVector &props) MOZ_OVERRIDE; + JS::AutoIdVector &props) MOZ_OVERRIDE; virtual bool iterate(JSContext *cx, JS::Handle wrapper, unsigned flags, JS::MutableHandle vp) MOZ_OVERRIDE; virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl,