Bug 1125351 - Make nsIDocShell.isPrerendered infallible; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 23 Jan 2015 16:22:55 -0500
changeset 239117 feda8ca8f832177e80f77a8c447195a9e1936811
parent 239116 7345338634ab288fa17b128f6a0c3504b39d1a6d
child 239118 3cfdd4c2d83bf287476b6c4e2f7cd21ab472e755
push id487
push userbcampen@mozilla.com
push dateMon, 26 Jan 2015 23:32:56 +0000
reviewersbzbarsky
bugs1125351
milestone38.0a1
Bug 1125351 - Make nsIDocShell.isPrerendered infallible; r=bzbarsky
docshell/base/nsDocShell.cpp
docshell/base/nsIDocShell.idl
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -3378,20 +3378,18 @@ nsDocShell::SetDocLoaderParent(nsDocLoad
             SetAllowWindowControl(value);
         }
         SetAllowContentRetargeting(
             parentAsDocShell->GetAllowContentRetargeting());
         if (NS_SUCCEEDED(parentAsDocShell->GetIsActive(&value)))
         {
             SetIsActive(value);
         }
-        if (NS_SUCCEEDED(parentAsDocShell->GetIsPrerendered(&value))) {
-            if (value) {
-                SetIsPrerendered(true);
-            }
+        if (parentAsDocShell->GetIsPrerendered()) {
+          SetIsPrerendered(true);
         }
         if (NS_FAILED(parentAsDocShell->GetAllowDNSPrefetch(&value))) {
             value = false;
         }
         SetAllowDNSPrefetch(value);
         value = parentAsDocShell->GetAffectPrivateSessionLifetime();
         SetAffectPrivateSessionLifetime(value);
         uint32_t flags;
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -619,17 +619,17 @@ interface nsIDocShell : nsIDocShellTreeI
    */
   attribute boolean isActive;
 
   /**
    * Puts the docshell in prerendering mode. noscript because we want only
    * native code to be able to put a docshell in prerendering.
    */
   [noscript] void SetIsPrerendered(in boolean prerendered);
-  readonly attribute boolean isPrerendered;
+  [infallible] readonly attribute boolean isPrerendered;
 
   /**
    * The ID of the docshell in the session history.
    */
   readonly attribute unsigned long long historyID;
 
   /**
    * Sets whether a docshell is an app tab. An app tab docshell may behave