Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv

I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
This commit is contained in:
Boris Zbarsky
2017-07-10 16:05:24 -04:00
parent a5a9b77587
commit 7988d1ba67
23 changed files with 304 additions and 107 deletions

View File

@@ -1525,7 +1525,7 @@ CacheCreator::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue)
JS::Rooted<JSObject*> obj(aCx, &aValue.toObject());
Cache* cache = nullptr;
nsresult rv = UNWRAP_OBJECT(Cache, obj, cache);
nsresult rv = UNWRAP_OBJECT(Cache, &obj, cache);
if (NS_WARN_IF(NS_FAILED(rv))) {
FailLoaders(NS_ERROR_FAILURE);
return;
@@ -1671,7 +1671,7 @@ CacheScriptLoader::ResolvedCallback(JSContext* aCx,
JS::Rooted<JSObject*> obj(aCx, &aValue.toObject());
mozilla::dom::Response* response = nullptr;
rv = UNWRAP_OBJECT(Response, obj, response);
rv = UNWRAP_OBJECT(Response, &obj, response);
if (NS_WARN_IF(NS_FAILED(rv))) {
Fail(rv);
return;