From 61ab7bb2cafd20867e580fe4cdfbcd713bdf8655 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 6 Jan 2016 20:02:41 +0000 Subject: [PATCH] Bug 1237364 - nsFrameLoader.cpp can set the userContextId directly using nsIDocShell, r=smaug --- dom/base/nsFrameLoader.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index 0874f954aeb2..c4477afd18ad 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -1799,10 +1799,13 @@ nsFrameLoader::MaybeCreateDocShell() } if (!userContextIdStr.IsEmpty()) { - nsresult err; - nsDocShell * ds = nsDocShell::Cast(mDocShell); - ds->SetUserContextId(userContextIdStr.ToInteger(&err)); - NS_ENSURE_SUCCESS(err, err); + nsresult rv; + uint32_t userContextId = + static_cast(userContextIdStr.ToInteger(&rv)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mDocShell->SetUserContextId(userContextId); + NS_ENSURE_SUCCESS(rv, rv); } // Inform our docShell that it has a new child.