Bug 1107516 - Part 1: Add LoadContext constructor taking an nsIPrincipal. r=smaug

This commit is contained in:
Ben Kelly
2014-12-12 11:05:00 -05:00
parent 8beb6d6e82
commit 73dcfb551b
2 changed files with 20 additions and 0 deletions

View File

@@ -4,12 +4,28 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Assertions.h"
#include "mozilla/LoadContext.h"
namespace mozilla {
NS_IMPL_ISUPPORTS(LoadContext, nsILoadContext, nsIInterfaceRequestor)
LoadContext::LoadContext(nsIPrincipal* aPrincipal)
: mTopFrameElement(nullptr)
, mNestedFrameId(0)
, mIsContent(true)
, mUsePrivateBrowsing(false)
, mUseRemoteTabs(false)
#ifdef DEBUG
, mIsNotNull(true)
#endif
{
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aPrincipal->GetAppId(&mAppId)));
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
aPrincipal->GetIsInBrowserElement(&mIsInBrowserElement)));
}
//-----------------------------------------------------------------------------
// LoadContext::nsILoadContext
//-----------------------------------------------------------------------------