Bug 1210508 - Handle null OriginAttributes from JS-implemented nsILoadContext. r=me
authorBobby Holley <bobbyholley@gmail.com>
Thu, 01 Oct 2015 18:10:18 -0700
changeset 265555 0b9b618c20f21beee8cf98fba525db42c97f1809
parent 265554 a557216dcc5cd6e0482db4eb383c9615059c2e5e
child 265556 7874d6a8dc918b0fb3bc2af91e578ec33f365e1d
push id15472
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:51:34 +0000
treeherderfx-team@2c33ef6b27e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Bug 1210508 - Handle null OriginAttributes from JS-implemented nsILoadContext. r=me
--- a/docshell/base/nsILoadContext.idl
+++ b/docshell/base/nsILoadContext.idl
@@ -18,17 +18,17 @@ interface nsIDOMElement;
  * An nsILoadContext represents the context of a load.  This interface
  * can be queried for various information about where the load is
  * happening.
-[scriptable, uuid(1220e340-b337-4c35-aaa1-f51362763621)]
+[scriptable, uuid(96014778-d30b-4fee-8902-a3481788907b)]
 interface nsILoadContext : nsISupports
    * associatedWindow is the window with which the load is associated, if any.
    * Note that the load may be triggered by a document which is different from
    * the document in associatedWindow, and in fact the source of the load need
    * not be same-origin with the document in associatedWindow.  This attribute
    * may be null if there is no associated window.
@@ -143,17 +143,17 @@ interface nsILoadContext : nsISupports
   bool GetOriginAttributes(mozilla::OriginAttributes& aAttrs)
     mozilla::dom::AutoJSAPI jsapi;
     bool ok = jsapi.Init(xpc::PrivilegedJunkScope());
     NS_ENSURE_TRUE(ok, false);
     JS::Rooted<JS::Value> v(jsapi.cx());
     nsresult rv = GetOriginAttributes(&v);
     NS_ENSURE_SUCCESS(rv, false);
-    MOZ_ASSERT(v.isObject());
+    NS_ENSURE_TRUE(v.isObject(), false);
     JS::Rooted<JSObject*> obj(jsapi.cx(), &v.toObject());
     // If we're JS-implemented, the object will be left in a different (System-Principaled)
     // scope, so we may need to enter its compartment.
     JSAutoCompartment ac(jsapi.cx(), obj);
     mozilla::OriginAttributes attrs;