1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 sw=2 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 "nsPrincipal.h"
9 #include "mozIThirdPartyUtil.h"
11 #include "nsScriptSecurityManager.h"
13 #include "nsReadableUtils.h"
16 #include "nsJSPrincipals.h"
17 #include "nsIObjectInputStream.h"
18 #include "nsIObjectOutputStream.h"
19 #include "nsIClassInfoImpl.h"
20 #include "nsIProtocolHandler.h"
22 #include "nsIContentSecurityPolicy.h"
23 #include "jswrapper.h"
25 #include "mozilla/dom/ScriptSettings.h"
26 #include "mozilla/Preferences.h"
27 #include "mozilla/HashFunctions.h"
29 #include "nsIAppsService.h"
30 #include "mozIApplication.h"
32 using namespace mozilla
;
34 static bool gCodeBasePrincipalSupport
= false;
35 static bool gIsObservingCodeBasePrincipalSupport
= false;
37 static bool URIIsImmutable(nsIURI
* aURI
)
39 nsCOMPtr
<nsIMutable
> mutableObj(do_QueryInterface(aURI
));
43 NS_SUCCEEDED(mutableObj
->GetMutable(&isMutable
)) &&
47 // Static member variables
48 const char nsBasePrincipal::sInvalid
[] = "Invalid";
50 NS_IMETHODIMP_(MozExternalRefCountType
)
51 nsBasePrincipal::AddRef()
53 NS_PRECONDITION(int32_t(refcount
) >= 0, "illegal refcnt");
54 // XXXcaa does this need to be threadsafe? See bug 143559.
55 nsrefcnt count
= ++refcount
;
56 NS_LOG_ADDREF(this, count
, "nsBasePrincipal", sizeof(*this));
60 NS_IMETHODIMP_(MozExternalRefCountType
)
61 nsBasePrincipal::Release()
63 NS_PRECONDITION(0 != refcount
, "dup release");
64 nsrefcnt count
= --refcount
;
65 NS_LOG_RELEASE(this, count
, "nsBasePrincipal");
73 nsBasePrincipal::nsBasePrincipal()
75 if (!gIsObservingCodeBasePrincipalSupport
) {
77 Preferences::AddBoolVarCache(&gCodeBasePrincipalSupport
,
78 "signed.applets.codebase_principal_support",
80 gIsObservingCodeBasePrincipalSupport
= NS_SUCCEEDED(rv
);
81 NS_WARN_IF_FALSE(gIsObservingCodeBasePrincipalSupport
,
82 "Installing gCodeBasePrincipalSupport failed!");
86 nsBasePrincipal::~nsBasePrincipal(void)
91 nsBasePrincipal::GetCsp(nsIContentSecurityPolicy
** aCsp
)
93 NS_IF_ADDREF(*aCsp
= mCSP
);
98 nsBasePrincipal::SetCsp(nsIContentSecurityPolicy
* aCsp
)
100 // If CSP was already set, it should not be destroyed! Instead, it should
101 // get set anew when a new principal is created.
103 return NS_ERROR_ALREADY_INITIALIZED
;
110 void nsPrincipal::dumpImpl()
113 GetScriptLocation(str
);
114 fprintf(stderr
, "nsPrincipal (%p) = %s\n", static_cast<void*>(this), str
.get());
118 NS_IMPL_CLASSINFO(nsPrincipal
, nullptr, nsIClassInfo::MAIN_THREAD_ONLY
,
120 NS_IMPL_QUERY_INTERFACE_CI(nsPrincipal
,
123 NS_IMPL_CI_INTERFACE_GETTER(nsPrincipal
,
126 NS_IMPL_ADDREF_INHERITED(nsPrincipal
, nsBasePrincipal
)
127 NS_IMPL_RELEASE_INHERITED(nsPrincipal
, nsBasePrincipal
)
129 nsPrincipal::nsPrincipal()
130 : mAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID
)
131 , mInMozBrowser(false)
132 , mCodebaseImmutable(false)
133 , mDomainImmutable(false)
134 , mInitialized(false)
137 nsPrincipal::~nsPrincipal()
141 nsPrincipal::Init(nsIURI
*aCodebase
,
145 NS_ENSURE_STATE(!mInitialized
);
146 NS_ENSURE_ARG(aCodebase
);
150 mCodebase
= NS_TryToMakeImmutable(aCodebase
);
151 mCodebaseImmutable
= URIIsImmutable(mCodebase
);
154 mInMozBrowser
= aInMozBrowser
;
160 nsPrincipal::GetScriptLocation(nsACString
&aStr
)
162 mCodebase
->GetSpec(aStr
);
165 /* static */ nsresult
166 nsPrincipal::GetOriginForURI(nsIURI
* aURI
, char **aOrigin
)
169 return NS_ERROR_FAILURE
;
174 nsCOMPtr
<nsIURI
> origin
= NS_GetInnermostURI(aURI
);
176 return NS_ERROR_FAILURE
;
179 nsAutoCString hostPort
;
181 // chrome: URLs don't have a meaningful origin, so make
182 // sure we just get the full spec for them.
183 // XXX this should be removed in favor of the solution in
186 nsresult rv
= origin
->SchemeIs("chrome", &isChrome
);
187 if (NS_SUCCEEDED(rv
) && !isChrome
) {
188 rv
= origin
->GetAsciiHost(hostPort
);
189 // Some implementations return an empty string, treat it as no support
190 // for asciiHost by that implementation.
191 if (hostPort
.IsEmpty()) {
192 rv
= NS_ERROR_FAILURE
;
197 if (NS_SUCCEEDED(rv
) && !isChrome
) {
198 rv
= origin
->GetPort(&port
);
201 if (NS_SUCCEEDED(rv
) && !isChrome
) {
203 hostPort
.Append(':');
204 hostPort
.AppendInt(port
, 10);
207 nsAutoCString scheme
;
208 rv
= origin
->GetScheme(scheme
);
209 NS_ENSURE_SUCCESS(rv
, rv
);
211 *aOrigin
= ToNewCString(scheme
+ NS_LITERAL_CSTRING("://") + hostPort
);
214 // Some URIs (e.g., nsSimpleURI) don't support asciiHost. Just
215 // get the full spec.
217 // XXX nsMozIconURI and nsJARURI don't implement this correctly, they
218 // both fall back to GetSpec. That needs to be fixed.
219 rv
= origin
->GetAsciiSpec(spec
);
220 NS_ENSURE_SUCCESS(rv
, rv
);
222 *aOrigin
= ToNewCString(spec
);
225 return *aOrigin
? NS_OK
: NS_ERROR_OUT_OF_MEMORY
;
229 nsPrincipal::GetOrigin(char **aOrigin
)
231 return GetOriginForURI(mCodebase
, aOrigin
);
235 nsPrincipal::EqualsConsideringDomain(nsIPrincipal
*aOther
, bool *aResult
)
240 NS_WARNING("Need a principal to compare this to!");
244 if (aOther
== this) {
249 if (!nsScriptSecurityManager::AppAttributesEqual(this, aOther
)) {
253 // If either the subject or the object has changed its principal by
254 // explicitly setting document.domain then the other must also have
255 // done so in order to be considered the same origin. This prevents
256 // DNS spoofing based on document.domain (154930)
258 nsCOMPtr
<nsIURI
> thisURI
;
259 this->GetDomain(getter_AddRefs(thisURI
));
260 bool thisSetDomain
= !!thisURI
;
262 this->GetURI(getter_AddRefs(thisURI
));
265 nsCOMPtr
<nsIURI
> otherURI
;
266 aOther
->GetDomain(getter_AddRefs(otherURI
));
267 bool otherSetDomain
= !!otherURI
;
269 aOther
->GetURI(getter_AddRefs(otherURI
));
272 *aResult
= thisSetDomain
== otherSetDomain
&&
273 nsScriptSecurityManager::SecurityCompareURIs(thisURI
, otherURI
);
278 nsPrincipal::Equals(nsIPrincipal
*aOther
, bool *aResult
)
283 NS_WARNING("Need a principal to compare this to!");
287 if (aOther
== this) {
292 if (!nsScriptSecurityManager::AppAttributesEqual(this, aOther
)) {
296 nsCOMPtr
<nsIURI
> otherURI
;
297 nsresult rv
= aOther
->GetURI(getter_AddRefs(otherURI
));
302 NS_ASSERTION(mCodebase
,
303 "shouldn't be calling this on principals from preferences");
305 // Compare codebases.
306 *aResult
= nsScriptSecurityManager::SecurityCompareURIs(mCodebase
,
312 nsPrincipal::Subsumes(nsIPrincipal
*aOther
, bool *aResult
)
314 return Equals(aOther
, aResult
);
318 nsPrincipal::SubsumesConsideringDomain(nsIPrincipal
*aOther
, bool *aResult
)
320 return EqualsConsideringDomain(aOther
, aResult
);
324 nsPrincipal::GetURI(nsIURI
** aURI
)
326 if (mCodebaseImmutable
) {
327 NS_ADDREF(*aURI
= mCodebase
);
336 return NS_EnsureSafeToReturn(mCodebase
, aURI
);
340 nsPrincipal::CheckMayLoad(nsIURI
* aURI
, bool aReport
, bool aAllowIfInheritsPrincipal
)
342 if (aAllowIfInheritsPrincipal
) {
343 // If the caller specified to allow loads of URIs that inherit
344 // our principal, allow the load if this URI inherits its principal
345 if (nsPrincipal::IsPrincipalInherited(aURI
)) {
350 // See if aURI is something like a Blob URI that is actually associated with
352 nsCOMPtr
<nsIURIWithPrincipal
> uriWithPrin
= do_QueryInterface(aURI
);
353 nsCOMPtr
<nsIPrincipal
> uriPrin
;
355 uriWithPrin
->GetPrincipal(getter_AddRefs(uriPrin
));
357 if (uriPrin
&& nsIPrincipal::Subsumes(uriPrin
)) {
361 if (nsScriptSecurityManager::SecurityCompareURIs(mCodebase
, aURI
)) {
365 // If strict file origin policy is in effect, local files will always fail
366 // SecurityCompareURIs unless they are identical. Explicitly check file origin
367 // policy, in that case.
368 if (nsScriptSecurityManager::GetStrictFileOriginPolicy() &&
369 NS_URIIsLocalFile(aURI
) &&
370 NS_RelaxStrictFileOriginPolicy(aURI
, mCodebase
)) {
375 nsScriptSecurityManager::ReportError(nullptr, NS_LITERAL_STRING("CheckSameOriginError"), mCodebase
, aURI
);
377 return NS_ERROR_DOM_BAD_URI
;
381 nsPrincipal::SetURI(nsIURI
* aURI
)
383 mCodebase
= NS_TryToMakeImmutable(aURI
);
384 mCodebaseImmutable
= URIIsImmutable(mCodebase
);
388 nsPrincipal::GetHashValue(uint32_t* aValue
)
390 NS_PRECONDITION(mCodebase
, "Need a codebase");
392 *aValue
= nsScriptSecurityManager::HashPrincipalByOrigin(this);
397 nsPrincipal::GetDomain(nsIURI
** aDomain
)
404 if (mDomainImmutable
) {
405 NS_ADDREF(*aDomain
= mDomain
);
409 return NS_EnsureSafeToReturn(mDomain
, aDomain
);
413 nsPrincipal::SetDomain(nsIURI
* aDomain
)
415 mDomain
= NS_TryToMakeImmutable(aDomain
);
416 mDomainImmutable
= URIIsImmutable(mDomain
);
418 // Recompute all wrappers between compartments using this principal and other
419 // non-chrome compartments.
420 AutoSafeJSContext cx
;
421 JSPrincipals
*principals
= nsJSPrincipals::get(static_cast<nsIPrincipal
*>(this));
422 bool success
= js::RecomputeWrappers(cx
, js::ContentCompartmentsOnly(),
423 js::CompartmentsWithPrincipals(principals
));
424 NS_ENSURE_TRUE(success
, NS_ERROR_FAILURE
);
425 success
= js::RecomputeWrappers(cx
, js::CompartmentsWithPrincipals(principals
),
426 js::ContentCompartmentsOnly());
427 NS_ENSURE_TRUE(success
, NS_ERROR_FAILURE
);
433 nsPrincipal::GetJarPrefix(nsACString
& aJarPrefix
)
435 MOZ_ASSERT(mAppId
!= nsIScriptSecurityManager::UNKNOWN_APP_ID
);
437 mozilla::GetJarPrefix(mAppId
, mInMozBrowser
, aJarPrefix
);
442 nsPrincipal::GetAppStatus(uint16_t* aAppStatus
)
444 *aAppStatus
= GetAppStatus();
449 nsPrincipal::GetAppId(uint32_t* aAppId
)
451 if (mAppId
== nsIScriptSecurityManager::UNKNOWN_APP_ID
) {
453 *aAppId
= nsIScriptSecurityManager::NO_APP_ID
;
462 nsPrincipal::GetIsInBrowserElement(bool* aIsInBrowserElement
)
464 *aIsInBrowserElement
= mInMozBrowser
;
469 nsPrincipal::GetUnknownAppId(bool* aUnknownAppId
)
471 *aUnknownAppId
= mAppId
== nsIScriptSecurityManager::UNKNOWN_APP_ID
;
476 nsPrincipal::GetIsNullPrincipal(bool* aIsNullPrincipal
)
478 *aIsNullPrincipal
= false;
483 nsPrincipal::GetBaseDomain(nsACString
& aBaseDomain
)
485 // For a file URI, we return the file path.
486 if (NS_URIIsLocalFile(mCodebase
)) {
487 nsCOMPtr
<nsIURL
> url
= do_QueryInterface(mCodebase
);
490 return url
->GetFilePath(aBaseDomain
);
494 bool hasNoRelativeFlag
;
495 nsresult rv
= NS_URIChainHasFlags(mCodebase
,
496 nsIProtocolHandler::URI_NORELATIVE
,
498 if (NS_WARN_IF(NS_FAILED(rv
))) {
502 if (hasNoRelativeFlag
) {
503 return mCodebase
->GetSpec(aBaseDomain
);
506 // For everything else, we ask the TLD service via
507 // the ThirdPartyUtil.
508 nsCOMPtr
<mozIThirdPartyUtil
> thirdPartyUtil
=
509 do_GetService(THIRDPARTYUTIL_CONTRACTID
);
510 if (thirdPartyUtil
) {
511 return thirdPartyUtil
->GetBaseDomain(mCodebase
, aBaseDomain
);
518 nsPrincipal::Read(nsIObjectInputStream
* aStream
)
520 nsCOMPtr
<nsISupports
> supports
;
521 nsCOMPtr
<nsIURI
> codebase
;
522 nsresult rv
= NS_ReadOptionalObject(aStream
, true, getter_AddRefs(supports
));
527 codebase
= do_QueryInterface(supports
);
529 nsCOMPtr
<nsIURI
> domain
;
530 rv
= NS_ReadOptionalObject(aStream
, true, getter_AddRefs(supports
));
535 domain
= do_QueryInterface(supports
);
538 rv
= aStream
->Read32(&appId
);
539 NS_ENSURE_SUCCESS(rv
, rv
);
542 rv
= aStream
->ReadBoolean(&inMozBrowser
);
543 NS_ENSURE_SUCCESS(rv
, rv
);
545 rv
= NS_ReadOptionalObject(aStream
, true, getter_AddRefs(supports
));
546 NS_ENSURE_SUCCESS(rv
, rv
);
549 nsCOMPtr
<nsIContentSecurityPolicy
> csp
= do_QueryInterface(supports
, &rv
);
551 rv
= Init(codebase
, appId
, inMozBrowser
);
552 NS_ENSURE_SUCCESS(rv
, rv
);
555 NS_ENSURE_SUCCESS(rv
, rv
);
557 // need to link in the CSP context here (link in the URI of the protected
560 csp
->SetRequestContext(codebase
, nullptr, nullptr);
569 nsPrincipal::Write(nsIObjectOutputStream
* aStream
)
571 NS_ENSURE_STATE(mCodebase
);
573 nsresult rv
= NS_WriteOptionalCompoundObject(aStream
, mCodebase
, NS_GET_IID(nsIURI
),
579 rv
= NS_WriteOptionalCompoundObject(aStream
, mDomain
, NS_GET_IID(nsIURI
),
585 aStream
->Write32(mAppId
);
586 aStream
->WriteBoolean(mInMozBrowser
);
588 rv
= NS_WriteOptionalCompoundObject(aStream
, mCSP
,
589 NS_GET_IID(nsIContentSecurityPolicy
),
595 // mCodebaseImmutable and mDomainImmutable will be recomputed based
596 // on the deserialized URIs in Read().
602 nsPrincipal::GetAppStatus()
604 if (mAppId
== nsIScriptSecurityManager::UNKNOWN_APP_ID
) {
605 NS_WARNING("Asking for app status on a principal with an unknown app id");
606 return nsIPrincipal::APP_STATUS_NOT_INSTALLED
;
608 return nsScriptSecurityManager::AppStatusForPrincipal(this);
611 /************************************************************************************************************************/
613 static const char EXPANDED_PRINCIPAL_SPEC
[] = "[Expanded Principal]";
615 NS_IMPL_CLASSINFO(nsExpandedPrincipal
, nullptr, nsIClassInfo::MAIN_THREAD_ONLY
,
616 NS_EXPANDEDPRINCIPAL_CID
)
617 NS_IMPL_QUERY_INTERFACE_CI(nsExpandedPrincipal
,
619 nsIExpandedPrincipal
)
620 NS_IMPL_CI_INTERFACE_GETTER(nsExpandedPrincipal
,
622 nsIExpandedPrincipal
)
623 NS_IMPL_ADDREF_INHERITED(nsExpandedPrincipal
, nsBasePrincipal
)
624 NS_IMPL_RELEASE_INHERITED(nsExpandedPrincipal
, nsBasePrincipal
)
626 nsExpandedPrincipal::nsExpandedPrincipal(nsTArray
<nsCOMPtr
<nsIPrincipal
> > &aWhiteList
)
628 mPrincipals
.AppendElements(aWhiteList
);
631 nsExpandedPrincipal::~nsExpandedPrincipal()
635 nsExpandedPrincipal::GetDomain(nsIURI
** aDomain
)
642 nsExpandedPrincipal::SetDomain(nsIURI
* aDomain
)
648 nsExpandedPrincipal::GetOrigin(char** aOrigin
)
650 *aOrigin
= ToNewCString(NS_LITERAL_CSTRING(EXPANDED_PRINCIPAL_SPEC
));
651 return *aOrigin
? NS_OK
: NS_ERROR_OUT_OF_MEMORY
;
654 typedef nsresult (NS_STDCALL
nsIPrincipal::*nsIPrincipalMemFn
)(nsIPrincipal
* aOther
,
656 #define CALL_MEMBER_FUNCTION(THIS,MEM_FN) ((THIS)->*(MEM_FN))
658 // nsExpandedPrincipal::Equals and nsExpandedPrincipal::EqualsConsideringDomain
659 // shares the same logic. The difference only that Equals requires 'this'
660 // and 'aOther' to Subsume each other while EqualsConsideringDomain requires
661 // bidirectional SubsumesConsideringDomain.
663 Equals(nsExpandedPrincipal
* aThis
, nsIPrincipalMemFn aFn
, nsIPrincipal
* aOther
,
666 // If (and only if) 'aThis' and 'aOther' both Subsume/SubsumesConsideringDomain
667 // each other, then they are Equal.
669 // Calling the corresponding subsume function on this (aFn).
670 nsresult rv
= CALL_MEMBER_FUNCTION(aThis
, aFn
)(aOther
, aResult
);
671 NS_ENSURE_SUCCESS(rv
, rv
);
675 // Calling the corresponding subsume function on aOther (aFn).
676 rv
= CALL_MEMBER_FUNCTION(aOther
, aFn
)(aThis
, aResult
);
677 NS_ENSURE_SUCCESS(rv
, rv
);
682 nsExpandedPrincipal::Equals(nsIPrincipal
* aOther
, bool* aResult
)
684 return ::Equals(this, &nsIPrincipal::Subsumes
, aOther
, aResult
);
688 nsExpandedPrincipal::EqualsConsideringDomain(nsIPrincipal
* aOther
, bool* aResult
)
690 return ::Equals(this, &nsIPrincipal::SubsumesConsideringDomain
, aOther
, aResult
);
693 // nsExpandedPrincipal::Subsumes and nsExpandedPrincipal::SubsumesConsideringDomain
694 // shares the same logic. The difference only that Subsumes calls are replaced
695 //with SubsumesConsideringDomain calls in the second case.
697 Subsumes(nsExpandedPrincipal
* aThis
, nsIPrincipalMemFn aFn
, nsIPrincipal
* aOther
,
701 nsCOMPtr
<nsIExpandedPrincipal
> expanded
= do_QueryInterface(aOther
);
703 // If aOther is an ExpandedPrincipal too, check if all of its
704 // principals are subsumed.
705 nsTArray
< nsCOMPtr
<nsIPrincipal
> >* otherList
;
706 expanded
->GetWhiteList(&otherList
);
707 for (uint32_t i
= 0; i
< otherList
->Length(); ++i
){
708 rv
= CALL_MEMBER_FUNCTION(aThis
, aFn
)((*otherList
)[i
], aResult
);
709 NS_ENSURE_SUCCESS(rv
, rv
);
711 // If we don't subsume at least one principal of aOther, return false.
716 // For a regular aOther, one of our principals must subsume it.
717 nsTArray
< nsCOMPtr
<nsIPrincipal
> >* list
;
718 aThis
->GetWhiteList(&list
);
719 for (uint32_t i
= 0; i
< list
->Length(); ++i
){
720 rv
= CALL_MEMBER_FUNCTION((*list
)[i
], aFn
)(aOther
, aResult
);
721 NS_ENSURE_SUCCESS(rv
, rv
);
723 // If one of our principal subsumes it, return true.
731 #undef CALL_MEMBER_FUNCTION
734 nsExpandedPrincipal::Subsumes(nsIPrincipal
* aOther
, bool* aResult
)
736 return ::Subsumes(this, &nsIPrincipal::Subsumes
, aOther
, aResult
);
740 nsExpandedPrincipal::SubsumesConsideringDomain(nsIPrincipal
* aOther
, bool* aResult
)
742 return ::Subsumes(this, &nsIPrincipal::SubsumesConsideringDomain
, aOther
, aResult
);
746 nsExpandedPrincipal::CheckMayLoad(nsIURI
* uri
, bool aReport
, bool aAllowIfInheritsPrincipal
)
749 for (uint32_t i
= 0; i
< mPrincipals
.Length(); ++i
){
750 rv
= mPrincipals
[i
]->CheckMayLoad(uri
, aReport
, aAllowIfInheritsPrincipal
);
751 if (NS_SUCCEEDED(rv
))
755 return NS_ERROR_DOM_BAD_URI
;
759 nsExpandedPrincipal::GetHashValue(uint32_t* result
)
761 MOZ_CRASH("extended principal should never be used as key in a hash map");
765 nsExpandedPrincipal::GetURI(nsIURI
** aURI
)
772 nsExpandedPrincipal::GetWhiteList(nsTArray
<nsCOMPtr
<nsIPrincipal
> >** aWhiteList
)
774 *aWhiteList
= &mPrincipals
;
779 nsExpandedPrincipal::GetJarPrefix(nsACString
& aJarPrefix
)
781 aJarPrefix
.Truncate();
786 nsExpandedPrincipal::GetAppStatus(uint16_t* aAppStatus
)
788 *aAppStatus
= nsIPrincipal::APP_STATUS_NOT_INSTALLED
;
793 nsExpandedPrincipal::GetAppId(uint32_t* aAppId
)
795 *aAppId
= nsIScriptSecurityManager::NO_APP_ID
;
800 nsExpandedPrincipal::GetIsInBrowserElement(bool* aIsInBrowserElement
)
802 *aIsInBrowserElement
= false;
807 nsExpandedPrincipal::GetUnknownAppId(bool* aUnknownAppId
)
809 *aUnknownAppId
= false;
814 nsExpandedPrincipal::GetIsNullPrincipal(bool* aIsNullPrincipal
)
816 *aIsNullPrincipal
= false;
821 nsExpandedPrincipal::GetBaseDomain(nsACString
& aBaseDomain
)
823 return NS_ERROR_NOT_AVAILABLE
;
827 nsExpandedPrincipal::GetScriptLocation(nsACString
& aStr
)
829 // Is that a good idea to list it's principals?
830 aStr
.Assign(EXPANDED_PRINCIPAL_SPEC
);
834 void nsExpandedPrincipal::dumpImpl()
836 fprintf(stderr
, "nsExpandedPrincipal (%p)\n", static_cast<void*>(this));
840 //////////////////////////////////////////
841 // Methods implementing nsISerializable //
842 //////////////////////////////////////////
845 nsExpandedPrincipal::Read(nsIObjectInputStream
* aStream
)
847 return NS_ERROR_NOT_IMPLEMENTED
;
851 nsExpandedPrincipal::Write(nsIObjectOutputStream
* aStream
)
853 return NS_ERROR_NOT_IMPLEMENTED
;