Bumping manifests a=b2g-bump
[gecko.git] / docshell / base / LoadInfo.cpp
blob703d849308ad243a9fce7a5529304bf3d9151b1e
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/LoadInfo.h"
9 #include "mozilla/Assertions.h"
10 #include "nsISupportsImpl.h"
11 #include "nsISupportsUtils.h"
13 namespace mozilla {
15 LoadInfo::LoadInfo(nsIPrincipal* aPrincipal,
16 InheritType aInheritPrincipal,
17 SandboxType aSandboxed)
18 : mPrincipal(aPrincipal)
19 , mInheritPrincipal(aInheritPrincipal == eInheritPrincipal &&
20 aSandboxed != eSandboxed)
21 , mSandboxed(aSandboxed == eSandboxed)
23 MOZ_ASSERT(aPrincipal);
26 LoadInfo::~LoadInfo()
30 NS_IMPL_ISUPPORTS(LoadInfo, nsILoadInfo)
32 NS_IMETHODIMP
33 LoadInfo::GetLoadingPrincipal(nsIPrincipal** aPrincipal)
35 NS_ADDREF(*aPrincipal = mPrincipal);
36 return NS_OK;
39 nsIPrincipal*
40 LoadInfo::LoadingPrincipal()
42 return mPrincipal;
45 NS_IMETHODIMP
46 LoadInfo::GetForceInheritPrincipal(bool* aInheritPrincipal)
48 *aInheritPrincipal = mInheritPrincipal;
49 return NS_OK;
52 NS_IMETHODIMP
53 LoadInfo::GetLoadingSandboxed(bool* aLoadingSandboxed)
55 *aLoadingSandboxed = mSandboxed;
56 return NS_OK;
59 } // namespace mozilla