Bug 873730. Make JS_SourceHook take a Handle for the JSScript. r=till
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 18 May 2013 23:09:11 -0400
changeset 143836 069ca251c989faa4e14eb77b4c887ef307a710ed
parent 143835 82a243758a1d5bb78e9861656e21662f1a638291
child 143837 f6e13bdaea064ad683a869a9702182786df08b14
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs873730
milestone24.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 873730. Make JS_SourceHook take a Handle for the JSScript. r=till
js/src/jsfriendapi.h
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -172,17 +172,18 @@ struct JSFunctionSpecWithHelp {
 #define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \
     {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}
 #define JS_FS_HELP_END                                                        \
     {NULL, NULL, 0, 0, NULL, NULL}
 
 extern JS_FRIEND_API(bool)
 JS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);
 
-typedef bool (* JS_SourceHook)(JSContext *cx, JSScript *script, jschar **src, uint32_t *length);
+typedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,
+                               jschar **src, uint32_t *length);
 
 extern JS_FRIEND_API(void)
 JS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);
 
 namespace js {
 
 extern mozilla::ThreadLocal<PerThreadData *> TlsPerThreadData;
 
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2596,17 +2596,18 @@ ReadSourceFromFilename(JSContext *cx, co
   return NS_OK;
 }
 
 /*
   The JS engine calls this function when it needs the source for a chrome JS
   function. See the comment in the XPCJSRuntime constructor.
 */
 static bool
-SourceHook(JSContext *cx, JSScript *script, jschar **src, uint32_t *length)
+SourceHook(JSContext *cx, JS::Handle<JSScript*> script, jschar **src,
+           uint32_t *length)
 {
   *src = NULL;
   *length = 0;
 
   if (!nsContentUtils::IsCallerChrome())
     return true;
 
   const char *filename = JS_GetScriptFilename(cx, script);