Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 3 - ContentPrincipal, r=ckerschb

This commit is contained in:
Andrea Marchesini 2018-07-17 21:38:48 +02:00
parent 58f78c6f5d
commit 4e97b69ebf
9 changed files with 20 additions and 16 deletions

View File

@ -12,14 +12,14 @@
#include "nsIObjectOutputStream.h"
#include "nsIStandardURL.h"
#include "ContentPrincipal.h"
#include "ExpandedPrincipal.h"
#include "mozilla/NullPrincipal.h"
#include "nsNetUtil.h"
#include "nsIURIWithPrincipal.h"
#include "nsScriptSecurityManager.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/dom/ChromeUtils.h"
#include "mozilla/dom/CSPDictionariesBinding.h"
#include "mozilla/dom/ToJSValue.h"

View File

@ -3,8 +3,8 @@
* 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/. */
#ifndef ContentPrincipal_h
#define ContentPrincipal_h
#ifndef mozilla_ContentPrincipal_h
#define mozilla_ContentPrincipal_h
#include "nsCOMPtr.h"
#include "nsJSPrincipals.h"
@ -16,7 +16,9 @@
#include "mozilla/BasePrincipal.h"
#include "mozilla/extensions/WebExtensionPolicy.h"
class ContentPrincipal final : public mozilla::BasePrincipal
namespace mozilla {
class ContentPrincipal final : public BasePrincipal
{
public:
NS_DECL_NSISERIALIZABLE
@ -35,7 +37,7 @@ public:
// Init() must be called before the principal is in a usable state.
nsresult Init(nsIURI* aCodebase,
const mozilla::OriginAttributes& aOriginAttributes,
const OriginAttributes& aOriginAttributes,
const nsACString& aOriginNoSuffix);
virtual nsresult GetScriptLocation(nsACString& aStr) override;
@ -43,7 +45,7 @@ public:
static nsresult
GenerateOriginNoSuffixFromURI(nsIURI* aURI, nsACString& aOrigin);
mozilla::extensions::WebExtensionPolicy* AddonPolicy();
extensions::WebExtensionPolicy* AddonPolicy();
nsCOMPtr<nsIURI> mDomain;
nsCOMPtr<nsIURI> mCodebase;
@ -56,12 +58,14 @@ protected:
bool MayLoadInternal(nsIURI* aURI) override;
private:
mozilla::Maybe<mozilla::WeakPtr<mozilla::extensions::WebExtensionPolicy>> mAddon;
Maybe<WeakPtr<extensions::WebExtensionPolicy>> mAddon;
};
} // mozilla namespace
#define NS_PRINCIPAL_CONTRACTID "@mozilla.org/principal;1"
#define NS_PRINCIPAL_CID \
{ 0x653e0e4d, 0x3ee4, 0x45fa, \
{ 0xb2, 0x72, 0x97, 0xc2, 0x0b, 0xc0, 0x1e, 0xb8 } }
#endif // ContentPrincipal_h
#endif // mozilla_ContentPrincipal_h

View File

@ -24,13 +24,13 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'caps'
EXPORTS += [
'ContentPrincipal.h',
'nsJSPrincipals.h',
'nsScriptSecurityManager.h',
]
EXPORTS.mozilla = [
'BasePrincipal.h',
'ContentPrincipal.h',
'NullPrincipal.h',
'NullPrincipalURI.h',
'OriginAttributes.h',

View File

@ -102,7 +102,7 @@
#include "mozilla/dom/HTMLBodyElement.h"
#include "ContentPrincipal.h"
#include "mozilla/ContentPrincipal.h"
#ifdef XP_WIN
#include "mozilla/plugins/PPluginWidgetParent.h"

View File

@ -10,6 +10,7 @@
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/Services.h"
#include "mozilla/SystemGroup.h"
#include "mozilla/Unused.h"
@ -44,7 +45,6 @@
#include "nsIObserverService.h"
#include "nsPrintfCString.h"
#include "mozilla/AbstractThread.h"
#include "ContentPrincipal.h"
#include "ExpandedPrincipal.h"
static nsPermissionManager *gPermissionManager = nullptr;

View File

@ -9,6 +9,7 @@
#include "MainThreadUtils.h"
#include "mozilla/Assertions.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "mozilla/ipc/URIUtils.h"
@ -18,7 +19,6 @@
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "mozilla/LoadInfo.h"
#include "ContentPrincipal.h"
#include "nsContentUtils.h"
#include "nsString.h"
#include "nsTArray.h"

View File

@ -15,13 +15,13 @@
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsIFileURL.h"
#include "ContentPrincipal.h"
#include "jsapi.h"
#include "jsfriendapi.h"
#include "xpcprivate.h" // For xpc::OptionsBase
#include "js/Wrapper.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ToJSValue.h"
#include "mozilla/dom/ScriptLoader.h"

View File

@ -99,8 +99,8 @@ using mozilla::dom::AudioChannelAgent;
#include "mozilla/HTMLEditor.h"
#include "nsScriptSecurityManager.h"
#include "ContentPrincipal.h"
#include "ExpandedPrincipal.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/SystemPrincipal.h"
#include "nsNetCID.h"

View File

@ -8,6 +8,7 @@
#include "necko-config.h"
#include "nsHttp.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/net/ExtensionProtocolHandler.h"
#include "mozilla/net/NeckoParent.h"
@ -44,7 +45,6 @@
#include "SerializedLoadContext.h"
#include "nsAuthInformationHolder.h"
#include "nsIAuthPromptCallback.h"
#include "ContentPrincipal.h"
#include "nsINetworkPredictor.h"
#include "nsINetworkPredictorVerifier.h"
#include "nsISpeculativeConnect.h"