Bug 842186 - Replace jsvals with JS::Values in .cpp and .h files inside the ipc, security, tools, caps, xpfe and startupcache directories. r=jwalden

--HG--
extra : rebase_source : 17f26bc48a8ce01b7349adc178a4e62f7d4b3a5e
This commit is contained in:
Jose Cortes 2013-03-15 22:22:01 -07:00
Родитель f1c9ece468
Коммит 172ead2b07
12 изменённых файлов: 40 добавлений и 39 удалений

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

@ -99,7 +99,7 @@ IDToString(JSContext *cx, jsid id)
return JS_GetInternedStringChars(JSID_TO_STRING(id));
JSAutoRequest ar(cx);
jsval idval;
JS::Value idval;
if (!JS_IdToValue(cx, id, &idval))
return nullptr;
JSString *str = JS_ValueToString(cx, idval);

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

@ -47,7 +47,7 @@ nsSecurityNameSet::~nsSecurityNameSet()
NS_IMPL_ISUPPORTS1(nsSecurityNameSet, nsIScriptExternalNameSet)
static JSBool
netscape_security_enablePrivilege(JSContext *cx, unsigned argc, jsval *vp)
netscape_security_enablePrivilege(JSContext *cx, unsigned argc, JS::Value *vp)
{
Telemetry::Accumulate(Telemetry::ENABLE_PRIVILEGE_EVER_CALLED, true);
return xpc::EnableUniversalXPConnect(cx);

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

@ -56,7 +56,7 @@ DispatchRILEvent::RunTask(JSContext *aCx)
}
memcpy(JS_GetArrayBufferViewData(array), mMessage->mData, mMessage->mSize);
jsval argv[] = { OBJECT_TO_JSVAL(array) };
JS::Value argv[] = { OBJECT_TO_JSVAL(array) };
return JS_CallFunctionName(aCx, obj, "onRILMessage", NS_ARRAY_LENGTH(argv),
argv, argv);
}

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

@ -73,7 +73,7 @@ TestShellParent::GetGlobalJSObject(JSContext* cx, JSObject** globalp)
JSBool
TestShellCommandParent::SetCallback(JSContext* aCx,
jsval aCallback)
JS::Value aCallback)
{
if (!mCallback.Hold(aCx)) {
return JS_FALSE;
@ -100,10 +100,10 @@ TestShellCommandParent::RunCallback(const nsString& aResponse)
JSString* str = JS_NewUCStringCopyN(mCx, aResponse.get(), aResponse.Length());
NS_ENSURE_TRUE(str, JS_FALSE);
jsval argv[] = { STRING_TO_JSVAL(str) };
JS::Value argv[] = { STRING_TO_JSVAL(str) };
unsigned argc = ArrayLength(argv);
jsval rval;
JS::Value rval;
JSBool ok = JS_CallFunctionValue(mCx, global, mCallback, argc, argv, &rval);
NS_ENSURE_TRUE(ok, JS_FALSE);

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

@ -53,7 +53,7 @@ public:
TestShellCommandParent() : mCx(NULL) { }
JSBool SetCallback(JSContext* aCx,
jsval aCallback);
JS::Value aCallback);
JSBool RunCallback(const nsString& aResponse);

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

@ -211,12 +211,12 @@ ContextCallback(JSContext *cx,
static JSBool
Print(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
unsigned i, n;
JSString *str;
jsval *argv = JS_ARGV(cx, vp);
JS::Value *argv = JS_ARGV(cx, vp);
for (i = n = 0; i < argc; i++) {
str = JS_ValueToString(cx, argv[i]);
if (!str)
@ -251,7 +251,7 @@ GetLine(char *bufp,
static JSBool
Dump(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
JS_SET_RVAL(cx, vp, JSVAL_VOID);
@ -274,15 +274,15 @@ Dump(JSContext *cx,
static JSBool
Load(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
jsval result;
JS::Value result;
JSObject *obj = JS_THIS_OBJECT(cx, vp);
if (!obj)
return JS_FALSE;
jsval *argv = JS_ARGV(cx, vp);
JS::Value *argv = JS_ARGV(cx, vp);
for (unsigned i = 0; i < argc; i++) {
JSString *str = JS_ValueToString(cx, argv[i]);
if (!str)
@ -318,9 +318,9 @@ Load(JSContext *cx,
static JSBool
Version(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
jsval *argv = JS_ARGV(cx, vp);
JS::Value *argv = JS_ARGV(cx, vp);
if (argc > 0 && JSVAL_IS_INT(argv[0]))
JS_SET_RVAL(cx, vp, INT_TO_JSVAL(JS_SetVersion(cx, JSVersion(JSVAL_TO_INT(argv[0])))));
else
@ -329,7 +329,7 @@ Version(JSContext *cx,
}
static JSBool
BuildDate(JSContext *cx, unsigned argc, jsval *vp)
BuildDate(JSContext *cx, unsigned argc, JS::Value *vp)
{
fprintf(stdout, "built on %s at %s\n", __DATE__, __TIME__);
return JS_TRUE;
@ -338,7 +338,7 @@ BuildDate(JSContext *cx, unsigned argc, jsval *vp)
static JSBool
Quit(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
int exitCode = 0;
JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "/ i", &exitCode);
@ -353,7 +353,7 @@ Quit(JSContext *cx,
static JSBool
DumpXPC(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
int32_t depth = 2;
@ -372,7 +372,7 @@ DumpXPC(JSContext *cx,
static JSBool
GC(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
JSRuntime *rt = JS_GetRuntime(cx);
JS_GC(rt);
@ -387,9 +387,9 @@ GC(JSContext *cx,
static JSBool
GCZeal(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
jsval* argv = JS_ARGV(cx, vp);
JS::Value* argv = JS_ARGV(cx, vp);
uint32_t zeal;
if (!JS_ValueToECMAUint32(cx, argv[0], &zeal))
@ -405,7 +405,7 @@ GCZeal(JSContext *cx,
static JSBool
DumpHeap(JSContext *cx,
unsigned argc,
jsval *vp)
JS::Value *vp)
{
JSAutoByteString fileName;
void* startThing = NULL;
@ -416,7 +416,7 @@ DumpHeap(JSContext *cx,
FILE *dumpFile;
JSBool ok;
jsval *argv = JS_ARGV(cx, vp);
JS::Value *argv = JS_ARGV(cx, vp);
JS_SET_RVAL(cx, vp, JSVAL_VOID);
vp = argv + 0;
@ -530,7 +530,7 @@ ProcessFile(JSContext *cx,
XPCShellEnvironment::AutoContextPusher pusher(env);
JSScript *script;
jsval result;
JS::Value result;
int lineno, startline;
JSBool ok, hitEOF;
char *bufp, buffer[4096];
@ -1110,7 +1110,7 @@ XPCShellEnvironment::EvaluateString(const nsString& aString,
aResult->Truncate();
}
jsval result;
JS::Value result;
JSBool ok = JS_ExecuteScript(mCx, global, script, &result);
if (ok && result != JSVAL_VOID) {
JSErrorReporter old = JS_SetErrorReporter(mCx, NULL);

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

@ -909,7 +909,7 @@ cryptojs_generateOneKeyPair(JSContext *cx, nsKeyPairInfo *keyPairInfo,
static nsresult
cryptojs_ReadArgsAndGenerateKey(JSContext *cx,
jsval *argv,
JS::Value *argv,
nsKeyPairInfo *keyGenType,
nsIInterfaceRequestor *uiCxt,
PK11SlotInfo **slot, bool willEscrow)
@ -1846,7 +1846,7 @@ nsCrypto::GenerateCRMFRequest(nsIDOMCRMFObject** aReturn)
ncc->GetArgc(&argc);
jsval *argv = nullptr;
JS::Value *argv = nullptr;
nrv = ncc->GetArgvPtr(&argv);
NS_ENSURE_SUCCESS(nrv, nrv);
@ -2537,7 +2537,7 @@ nsCrypto::SignText(const nsAString& aStringToSign, const nsAString& aCaOption,
uint32_t numCAs = argc - 2;
if (numCAs > 0) {
jsval *argv = nullptr;
JS::Value *argv = nullptr;
ncc->GetArgvPtr(&argv);
nsAutoArrayPtr<JSAutoByteString> caNameBytes(new JSAutoByteString[numCAs]);
@ -2857,7 +2857,8 @@ nsCrypto::DisableRightClick()
}
NS_IMETHODIMP
nsCrypto::GetRandomValues(const jsval& aData, JSContext *cx, jsval* _retval)
nsCrypto::GetRandomValues(const JS::Value& aData, JSContext *cx,
JS::Value* _retval)
{
return mozilla::dom::Crypto::GetRandomValues(aData, cx, _retval);
}

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

@ -411,7 +411,7 @@ SetupJS(JSContext **cxp)
bool
GetHistogramCounts(const char *testmsg, const nsACString &histogram_id,
JSContext *cx, jsval *counts)
JSContext *cx, JS::Value *counts)
{
nsCOMPtr<nsITelemetry> telemetry = do_GetService("@mozilla.org/base/telemetry;1");
JS::AutoValueRooter h(cx);
@ -448,7 +448,7 @@ CompareCountArrays(JSContext *cx, JSObject *before, JSObject *after)
}
for (uint32_t i = 0; i < before_size; ++i) {
jsval before_num, after_num;
JS::Value before_num, after_num;
if (!(JS_GetElement(cx, before, i, &before_num)
&& JS_GetElement(cx, after, i, &after_num))) {

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

@ -86,7 +86,7 @@ JSObjectBuilder::ArrayPush(JSCustomArray *aArray, int value)
if (!mOk)
return;
jsval objval = INT_TO_JSVAL(value);
JS::Value objval = INT_TO_JSVAL(value);
uint32_t length;
mOk = JS_GetArrayLength(mCx, (JSObject*)aArray, &length);
@ -108,7 +108,7 @@ JSObjectBuilder::ArrayPush(JSCustomArray *aArray, const char *value)
return;
}
jsval objval = STRING_TO_JSVAL(string);
JS::Value objval = STRING_TO_JSVAL(string);
uint32_t length;
mOk = JS_GetArrayLength(mCx, (JSObject*)aArray, &length);
@ -124,7 +124,7 @@ JSObjectBuilder::ArrayPush(JSCustomArray *aArray, JSCustomObject *aObject)
if (!mOk)
return;
jsval objval = OBJECT_TO_JSVAL((JSObject*)aObject); uint32_t length;
JS::Value objval = OBJECT_TO_JSVAL((JSObject*)aObject); uint32_t length;
mOk = JS_GetArrayLength(mCx, (JSObject*)aArray, &length);
if (!mOk)

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

@ -582,7 +582,7 @@ public:
if (stream.is_open()) {
JSAutoCompartment autoComp(cx, obj);
JSObject* profileObj = mozilla_sampler_get_profile_data1(cx);
jsval val = OBJECT_TO_JSVAL(profileObj);
JS::Value val = OBJECT_TO_JSVAL(profileObj);
JS_Stringify(cx, &val, nullptr, JSVAL_NULL, WriteCallback, &stream);
stream.close();
LOGF("Saved to %s", tmpPath.get());

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

@ -176,7 +176,7 @@ nsProfiler::GetSharedLibraryInformation(nsAString& aOutString)
return NS_OK;
}
NS_IMETHODIMP nsProfiler::GetProfileData(JSContext* aCx, jsval* aResult)
NS_IMETHODIMP nsProfiler::GetProfileData(JSContext* aCx, JS::Value* aResult)
{
JSObject *obj = SAMPLER_GET_PROFILE_DATA(aCx);
if (!obj)

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

@ -164,7 +164,7 @@ nsHTTPIndex::OnFTPControlLog(bool server, const char *msg)
JSObject* global = JS_GetGlobalObject(cx);
NS_ENSURE_TRUE(global, NS_OK);
jsval params[2];
JS::Value params[2];
nsString unicodeMsg;
unicodeMsg.AssignWithConversion(msg);
@ -175,7 +175,7 @@ nsHTTPIndex::OnFTPControlLog(bool server, const char *msg)
params[0] = BOOLEAN_TO_JSVAL(server);
params[1] = STRING_TO_JSVAL(jsMsgStr);
jsval val;
JS::Value val;
JS_CallFunctionName(cx,
global,
"OnFTPControlLog",
@ -260,7 +260,7 @@ nsHTTPIndex::OnStartRequest(nsIRequest *request, nsISupports* aContext)
"unable to get jsobj from xpconnect wrapper");
if (NS_FAILED(rv)) return rv;
jsval jslistener = OBJECT_TO_JSVAL(jsobj);
JS::Value jslistener = OBJECT_TO_JSVAL(jsobj);
// ...and stuff it into the global context
JSAutoRequest ar(cx);