Bug 871179 - Fix rooting hazards in netwerk's Dashboard.cpp; r=till

--HG--
extra : rebase_source : b20df14656861f5cef10d1200580f23598632163
This commit is contained in:
Ehsan Akhgari 2013-05-12 01:09:22 -04:00
Родитель 0e8df20868
Коммит 79b98d1709
1 изменённых файлов: 8 добавлений и 8 удалений

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

@ -90,8 +90,8 @@ Dashboard::GetSockets()
dict.mReceived += mSock.data[i].received;
}
JS::Value val;
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
JS::RootedValue val(cx);
if (!dict.ToObject(cx, JS::NullPtr(), val.address())) {
mSock.cb = nullptr;
mSock.data.Clear();
return NS_ERROR_FAILURE;
@ -197,8 +197,8 @@ Dashboard::GetHttpConnections()
}
}
JS::Value val;
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
JS::RootedValue val(cx);
if (!dict.ToObject(cx, JS::NullPtr(), val.address())) {
mHttp.cb = nullptr;
mHttp.data.Clear();
return NS_ERROR_FAILURE;
@ -337,8 +337,8 @@ Dashboard::GetWebSocketConnections()
*encrypted.AppendElement() = mWs.data[i].mEncrypted;
}
JS::Value val;
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
JS::RootedValue val(cx);
if (!dict.ToObject(cx, JS::NullPtr(), val.address())) {
mWs.cb = nullptr;
mWs.data.Clear();
return NS_ERROR_FAILURE;
@ -426,8 +426,8 @@ Dashboard::GetDNSCacheEntries()
CopyASCIItoUTF16("ipv4", *family.AppendElement());
}
JS::Value val;
if (!dict.ToObject(cx, JS::NullPtr(), &val)) {
JS::RootedValue val(cx);
if (!dict.ToObject(cx, JS::NullPtr(), val.address())) {
mDns.cb = nullptr;
mDns.data.Clear();
return NS_ERROR_FAILURE;