Bug 621103: Rename js::Anchor to JS::Anchor: 'JS' is the public namespace. r=waldo

This commit is contained in:
Jim Blandy 2011-01-31 14:42:53 -08:00
parent fa08e98f10
commit 672dd55a28
4 changed files with 13 additions and 13 deletions

View File

@ -907,7 +907,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv_tn(JSContext *cx, JSObject *obj,
nsIDOMWebGLRenderingContext *self;
xpc_qsSelfRef selfref;
js::Anchor<jsval> self_anchor;
JS::Anchor<jsval> self_anchor;
if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr,
&self_anchor.get(), nsnull)) {
js_SetTraceableNativeFailed(cx);
@ -923,7 +923,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv_tn(JSContext *cx, JSObject *obj,
nsIWebGLUniformLocation *location;
xpc_qsSelfRef location_selfref;
js::Anchor<jsval> location_anchor;
JS::Anchor<jsval> location_anchor;
nsresult rv_convert_arg0
= xpc_qsUnwrapThis(cx, locationobj, nsnull, &location,
&location_selfref.ptr, &location_anchor.get(),
@ -979,7 +979,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv_tn(JSContext *cx, JSObject *obj,
nsIDOMWebGLRenderingContext *self;
xpc_qsSelfRef selfref;
js::Anchor<jsval> self_anchor;
JS::Anchor<jsval> self_anchor;
if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr,
&self_anchor.get(), nsnull)) {
js_SetTraceableNativeFailed(cx);
@ -995,7 +995,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv_tn(JSContext *cx, JSObject *obj,
nsIWebGLUniformLocation *location;
xpc_qsSelfRef location_selfref;
js::Anchor<jsval> location_anchor;
JS::Anchor<jsval> location_anchor;
nsresult rv_convert_arg0
= xpc_qsUnwrapThis(cx, locationobj, nsnull, &location,
&location_selfref.ptr, &location_anchor.get(),
@ -1053,7 +1053,7 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv_tn(JSContext *cx, JSObject
nsIDOMWebGLRenderingContext *self;
xpc_qsSelfRef selfref;
js::Anchor<jsval> self_anchor;
JS::Anchor<jsval> self_anchor;
if (!xpc_qsUnwrapThis(cx, obj, nsnull, &self, &selfref.ptr,
&self_anchor.get(), nsnull)) {
js_SetTraceableNativeFailed(cx);
@ -1069,7 +1069,7 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv_tn(JSContext *cx, JSObject
nsIWebGLUniformLocation *location;
xpc_qsSelfRef location_selfref;
js::Anchor<jsval> location_anchor;
JS::Anchor<jsval> location_anchor;
nsresult rv_convert_arg0
= xpc_qsUnwrapThis(cx, locationobj, nsnull, &location,
&location_selfref.ptr, &location_anchor.get(),

View File

@ -62,7 +62,7 @@ END_TEST(testConservativeGC)
BEGIN_TEST(testDerivedValues)
{
JSString *str = JS_NewStringCopyZ(cx, "once upon a midnight dreary");
js::Anchor<JSString *> str_anchor(str);
JS::Anchor<JSString *> str_anchor(str);
static const jschar expected[] = { 'o', 'n', 'c', 'e' };
const jschar *ch = JS_GetStringCharsZ(cx, str);
str = NULL;

View File

@ -1283,7 +1283,7 @@ js_RemoveRoot(JSRuntime *rt, void *rp);
#ifdef __cplusplus
JS_END_EXTERN_C
namespace js {
namespace JS {
/*
* Protecting non-jsval, non-JSObject *, non-JSString * values from collection
@ -1331,12 +1331,12 @@ namespace js {
* knows about, but when we work with derived values like |ch|, we must root
* their owners, as the derived value alone won't keep them alive.
*
* A js::Anchor is a kind of GC root that allows us to keep the owners of
* A JS::Anchor is a kind of GC root that allows us to keep the owners of
* derived values like |ch| alive throughout the Anchor's lifetime. We could
* fix the above code as follows:
*
* void f(JSString *str) {
* js::Anchor<JSString *> a_str(str);
* JS::Anchor<JSString *> a_str(str);
* const jschar *ch = JS_GetStringCharsZ(str);
* ... do stuff with ch, but no uses of str ...;
* }
@ -1436,7 +1436,7 @@ inline Anchor<jsval>::~Anchor() {
#endif
#endif
} /* namespace js */
} /* namespace JS */
JS_BEGIN_EXTERN_C
#endif

View File

@ -1208,7 +1208,7 @@ def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx,
f.write(" nsresult rv;\n");
f.write(" %s *%s;\n" % (type.name, name))
f.write(" xpc_qsSelfRef %sref;\n" % name)
f.write(" js::Anchor<jsval> %sanchor;\n" % name);
f.write(" JS::Anchor<jsval> %sanchor;\n" % name);
f.write(" rv = xpc_qsUnwrapArg<%s>("
"cx, js::Jsvalify(js::ValueArgToConstRef(%s)), &%s, &%sref.ptr, &%sanchor.get());\n"
% (type.name, argVal, name, name, name))
@ -1348,7 +1348,7 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
else:
f.write(" %s *self;\n" % customMethodCall['thisType'])
f.write(" xpc_qsSelfRef selfref;\n")
f.write(" js::Anchor<jsval> selfanchor;\n")
f.write(" JS::Anchor<jsval> selfanchor;\n")
if haveCcx:
f.write(" if (!xpc_qsUnwrapThisFromCcx(ccx, &self, &selfref.ptr, "
"&selfanchor.get())) {\n")