Bug 875405 - fixing unpushed cx usages. r=bholley

This commit is contained in:
Gabor Krizsanits 2013-05-30 16:54:46 +02:00
parent 5f0d6aaac4
commit 654fe7f8ff
5 changed files with 6 additions and 6 deletions

View File

@ -550,7 +550,7 @@ BluetoothService::HandleSettingsChanged(const nsAString& aData)
// The string that we're interested in will be a JSON string that looks like:
// {"key":"bluetooth.enabled","value":true}
JSContext* cx = nsContentUtils::GetSafeJSContext();
AutoSafeJSContext cx;
if (!cx) {
return NS_OK;
}

View File

@ -527,7 +527,7 @@ IndexedDBDatabaseParent::HandleDatabaseEvent(nsIDOMEvent* aEvent,
nsresult rv;
if (aType.EqualsLiteral(VERSIONCHANGE_EVT_STR)) {
JSContext* cx = nsContentUtils::GetSafeJSContext();
AutoSafeJSContext cx;
NS_ENSURE_TRUE(cx, NS_ERROR_FAILURE);
nsCOMPtr<nsIIDBVersionChangeEvent> changeEvent = do_QueryInterface(aEvent);

View File

@ -22,7 +22,7 @@ DeserializeArrayBuffer(JS::Handle<JSObject*> aObj,
const InfallibleTArray<uint8_t>& aBuffer,
JS::MutableHandle<JS::Value> aVal)
{
JSContext* cx = nsContentUtils::GetSafeJSContext();
mozilla::AutoSafeJSContext cx;
JSAutoCompartment ac(cx, aObj);
JS::Rooted<JSObject*> obj(cx, JS_NewArrayBuffer(cx, aBuffer.Length()));

View File

@ -2260,7 +2260,7 @@ class XPCJSRuntimeStats : public JS::RuntimeStats
virtual void initExtraZoneStats(JS::Zone *zone, JS::ZoneStats *zStats) MOZ_OVERRIDE {
// Get the compartment's global.
nsXPConnect *xpc = nsXPConnect::GetXPConnect();
JSContext *cx = xpc->GetSafeJSContext();
AutoSafeJSContext cx;
JSCompartment *comp = js::GetAnyCompartmentInZone(zone);
xpc::ZoneStatsExtras *extras = new xpc::ZoneStatsExtras;
extras->pathPrefix.AssignLiteral("explicit/js-non-window/zones/");
@ -2293,7 +2293,7 @@ class XPCJSRuntimeStats : public JS::RuntimeStats
// Get the compartment's global.
nsXPConnect *xpc = nsXPConnect::GetXPConnect();
JSContext *cx = xpc->GetSafeJSContext();
AutoSafeJSContext cx;
bool needZone = true;
RootedObject global(cx, JS_GetGlobalForCompartmentOrNull(cx, c));
if (global) {

View File

@ -154,7 +154,7 @@ TestSettingsObserver::Observe(nsISupports *aSubject,
// Get the safe JS context.
nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID());
JSContext *cx = xpc->GetSafeJSContext();
AutoSafeJSContext cx;
if (!cx) {
CHECK_MSG(false, "Failed to GetSafeJSContext");
return NS_OK;