Bug 1038756: Callsites creating a channel in /layout/mathml/ (r=roc)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Sun, 21 Sep 2014 09:41:03 -0700
changeset 206512 de85d97eac27680338f398df85f3f281a071d200
parent 206511 7fc6512d34b18a00c0c145c27087496237c6b028
child 206513 55806e3e450fdfec0765af4f6cfb61396e997b71
push id27529
push userryanvm@gmail.com
push dateMon, 22 Sep 2014 19:49:52 +0000
treeherdermozilla-central@f4037194394e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1038756
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1038756: Callsites creating a channel in /layout/mathml/ (r=roc)
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLOperators.cpp
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -13,16 +13,17 @@
 #include "nsUnicharUtils.h"
 #include "nsRenderingContext.h"
 
 #include "mozilla/Preferences.h"
 #include "nsIPersistentProperties2.h"
 #include "nsIObserverService.h"
 #include "nsIObserver.h"
 #include "nsNetUtil.h"
+#include "nsContentUtils.h"
 
 #include "mozilla/LookAndFeel.h"
 #include "nsCSSRendering.h"
 #include "prprf.h"         // For PR_snprintf()
 
 #include "nsDisplayList.h"
 
 #include "nsMathMLOperators.h"
@@ -145,18 +146,20 @@ static nsresult
 LoadProperties(const nsString& aName,
                nsCOMPtr<nsIPersistentProperties>& aProperties)
 {
   nsAutoString uriStr;
   uriStr.AssignLiteral("resource://gre/res/fonts/mathfont");
   uriStr.Append(aName);
   uriStr.StripWhitespace(); // that may come from aName
   uriStr.AppendLiteral(".properties");
-  return NS_LoadPersistentPropertiesFromURISpec(getter_AddRefs(aProperties), 
-                                                NS_ConvertUTF16toUTF8(uriStr));
+  return NS_LoadPersistentPropertiesFromURISpec(getter_AddRefs(aProperties),
+                                                NS_ConvertUTF16toUTF8(uriStr),
+                                                nsContentUtils::GetSystemPrincipal(),
+                                                nsIContentPolicy::TYPE_OTHER);
 }
 
 class nsPropertiesTable MOZ_FINAL : public nsGlyphTable {
 public:
   explicit nsPropertiesTable(const nsString& aPrimaryFontName)
     : mState(NS_TABLE_STATE_EMPTY)
   {
     MOZ_COUNT_CTOR(nsPropertiesTable);
--- a/layout/mathml/nsMathMLOperators.cpp
+++ b/layout/mathml/nsMathMLOperators.cpp
@@ -6,16 +6,17 @@
 #include "nsMathMLOperators.h"
 #include "nsCOMPtr.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "nsTArray.h"
 
 #include "nsIPersistentProperties2.h"
 #include "nsNetUtil.h"
+#include "nsContentUtils.h"
 #include "nsCRT.h"
 
 // operator dictionary entry
 struct OperatorData {
   OperatorData(void)
     : mFlags(0),
       mLeadingSpace(0.0f),
       mTrailingSpace(0.0f)
@@ -216,18 +217,22 @@ SetOperator(OperatorData*   aOperatorDat
 }
 
 static nsresult
 InitOperators(void)
 {
   // Load the property file containing the Operator Dictionary
   nsresult rv;
   nsCOMPtr<nsIPersistentProperties> mathfontProp;
-  rv = NS_LoadPersistentPropertiesFromURISpec(getter_AddRefs(mathfontProp),
-       NS_LITERAL_CSTRING("resource://gre/res/fonts/mathfont.properties"));
+  rv = NS_LoadPersistentPropertiesFromURISpec(
+         getter_AddRefs(mathfontProp),
+         NS_LITERAL_CSTRING("resource://gre/res/fonts/mathfont.properties"),
+         nsContentUtils::GetSystemPrincipal(),
+         nsIContentPolicy::TYPE_OTHER);
+
   if (NS_FAILED(rv)) return rv;
 
   // Parse the Operator Dictionary in two passes.
   // The first pass is to count the number of operators; the second pass is to
   // allocate the necessary space for them and to add them in the hash table.
   for (int32_t pass = 1; pass <= 2; pass++) {
     OperatorData dummyData;
     OperatorData* operatorData = &dummyData;