Bug 1318727 - BroadcastChannel should support data URL - part 2, r=me
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 30 Nov 2016 15:31:09 +0100
changeset 324814 0bdc2dfc9dcc02f29656518b5dc4812d184fbad3
parent 324813 124b6d7669264412a06cd9885aa34f25768ea880
child 324815 a3eb899eaa85d8fdaa20423978e84d4032e8fe35
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersme
bugs1318727
milestone53.0a1
Bug 1318727 - BroadcastChannel should support data URL - part 2, r=me
caps/nsJSPrincipals.cpp
--- a/caps/nsJSPrincipals.cpp
+++ b/caps/nsJSPrincipals.cpp
@@ -156,21 +156,21 @@ static bool
 ReadPrincipalInfo(JSStructuredCloneReader* aReader,
                   uint32_t aTag,
                   PrincipalInfo& aInfo)
 {
     if (aTag == SCTAG_DOM_SYSTEM_PRINCIPAL) {
         aInfo = SystemPrincipalInfo();
     } else if (aTag == SCTAG_DOM_NULL_PRINCIPAL) {
         PrincipalOriginAttributes attrs;
-        nsAutoCString dummy;
-        if (!ReadSuffixAndSpec(aReader, attrs, dummy)) {
+        nsAutoCString spec;
+        if (!ReadSuffixAndSpec(aReader, attrs, spec)) {
             return false;
         }
-        aInfo = NullPrincipalInfo(attrs);
+        aInfo = NullPrincipalInfo(attrs, spec);
     } else if (aTag == SCTAG_DOM_EXPANDED_PRINCIPAL) {
         uint32_t length, unused;
         if (!JS_ReadUint32Pair(aReader, &length, &unused)) {
             return false;
         }
 
         ExpandedPrincipalInfo expanded;
 
@@ -249,17 +249,17 @@ WriteSuffixAndSpec(JSStructuredCloneWrit
 }
 
 static bool
 WritePrincipalInfo(JSStructuredCloneWriter* aWriter, const PrincipalInfo& aInfo)
 {
     if (aInfo.type() == PrincipalInfo::TNullPrincipalInfo) {
         const NullPrincipalInfo& nullInfo = aInfo;
         return JS_WriteUint32Pair(aWriter, SCTAG_DOM_NULL_PRINCIPAL, 0) &&
-               WriteSuffixAndSpec(aWriter, nullInfo.attrs(), EmptyCString());
+               WriteSuffixAndSpec(aWriter, nullInfo.attrs(), nullInfo.spec());
     }
     if (aInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
         return JS_WriteUint32Pair(aWriter, SCTAG_DOM_SYSTEM_PRINCIPAL, 0);
     }
     if (aInfo.type() == PrincipalInfo::TExpandedPrincipalInfo) {
         const ExpandedPrincipalInfo& expanded = aInfo;
         if (!JS_WriteUint32Pair(aWriter, SCTAG_DOM_EXPANDED_PRINCIPAL, 0) ||
             !JS_WriteUint32Pair(aWriter, expanded.whitelist().Length(), 0)) {