Bug 1257422 part 2. Use the overload of IDBRequest::GetResult that doesn't ask for a JSContext in FirstRevisionIdCallback::HandleEvent, since there is no reason not to. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 17 Mar 2016 23:23:55 -0400
changeset 342019 67aa8f1fca8ee61c98edfdb404b549bc15382f91
parent 342018 20c9fb1e81bace4582d27311c93fc0c005ab8eb0
child 342020 26f9c1949e1c479d7102eeebe7c3f565bb531f09
push id13342
push userbmo:james@hoppipolla.co.uk
push dateFri, 18 Mar 2016 09:55:58 +0000
reviewerskhuey
bugs1257422
milestone48.0a1
Bug 1257422 part 2. Use the overload of IDBRequest::GetResult that doesn't ask for a JSContext in FirstRevisionIdCallback::HandleEvent, since there is no reason not to. r=khuey
dom/datastore/DataStoreService.cpp
--- a/dom/datastore/DataStoreService.cpp
+++ b/dom/datastore/DataStoreService.cpp
@@ -485,21 +485,19 @@ public:
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
 #ifdef DEBUG
     MOZ_ASSERT(type.EqualsASCII("success"));
 #endif
 
-    AutoSafeJSContext cx;
-
     ErrorResult error;
-    JS::Rooted<JS::Value> result(cx);
-    request->GetResult(cx, &result, error);
+    JS::Rooted<JS::Value> result(nsContentUtils::RootingCx());
+    request->GetResult(&result, error);
     if (NS_WARN_IF(error.Failed())) {
       return error.StealNSResult();
     }
 
     // This means that the content is a IDBCursor, so the first revision already
     // exists.
     if (result.isObject()) {
 #ifdef DEBUG