Bug 1038756: Callsites creating a channel in /toolkit/components/places/ (r=mak)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Sun, 21 Sep 2014 09:42:47 -0700
changeset 206518 218ea09a72868d5adaf87a892e45123fe81eafbc
parent 206517 2382ff174f223b5afd997c53d643eab1861c2334
child 206519 3910656e0a2c47d7a16a0c2cea43c67c68095ffb
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)
reviewersmak
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 /toolkit/components/places/ (r=mak)
toolkit/components/places/AsyncFaviconHelpers.cpp
toolkit/components/places/nsAnnoProtocolHandler.cpp
--- a/toolkit/components/places/AsyncFaviconHelpers.cpp
+++ b/toolkit/components/places/AsyncFaviconHelpers.cpp
@@ -14,16 +14,17 @@
 #include "nsFaviconService.h"
 #include "mozilla/storage.h"
 #include "mozilla/Telemetry.h"
 #include "nsNetUtil.h"
 #include "nsPrintfCString.h"
 #include "nsStreamUtils.h"
 #include "nsIPrivateBrowsingChannel.h"
 #include "nsISupportsPriority.h"
+#include "nsContentUtils.h"
 #include <algorithm>
 
 using namespace mozilla::places;
 using namespace mozilla::storage;
 
 namespace mozilla {
 namespace places {
 
@@ -536,17 +537,22 @@ AsyncFetchAndSetIconFromNetwork::Run()
     mIcon.data.Truncate(0);
     mIcon.mimeType.Truncate(0);
   }
 
   nsCOMPtr<nsIURI> iconURI;
   nsresult rv = NS_NewURI(getter_AddRefs(iconURI), mIcon.spec);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIChannel> channel;
-  rv = NS_NewChannel(getter_AddRefs(channel), iconURI);
+  rv = NS_NewChannel(getter_AddRefs(channel),
+                     iconURI,
+                     nsContentUtils::GetSystemPrincipal(),
+                     nsILoadInfo::SEC_NORMAL,
+                     nsIContentPolicy::TYPE_OTHER);
+
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIInterfaceRequestor> listenerRequestor =
     do_QueryInterface(reinterpret_cast<nsISupports*>(this));
   NS_ENSURE_STATE(listenerRequestor);
   rv = channel->SetNotificationCallbacks(listenerRequestor);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(channel);
   if (pbChannel) {
--- a/toolkit/components/places/nsAnnoProtocolHandler.cpp
+++ b/toolkit/components/places/nsAnnoProtocolHandler.cpp
@@ -18,16 +18,17 @@
 #include "nsIChannel.h"
 #include "nsIInputStreamChannel.h"
 #include "nsILoadGroup.h"
 #include "nsIStandardURL.h"
 #include "nsIStringStream.h"
 #include "nsISupportsUtils.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
+#include "nsContentUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStringStream.h"
 #include "mozilla/storage.h"
 #include "nsIPipe.h"
 #include "Helpers.h"
 
 using namespace mozilla;
 using namespace mozilla::places;
@@ -41,17 +42,22 @@ using namespace mozilla::places;
 static
 nsresult
 GetDefaultIcon(nsIChannel **aChannel)
 {
   nsCOMPtr<nsIURI> defaultIconURI;
   nsresult rv = NS_NewURI(getter_AddRefs(defaultIconURI),
                           NS_LITERAL_CSTRING(FAVICON_DEFAULT_URL));
   NS_ENSURE_SUCCESS(rv, rv);
-  return NS_NewChannel(aChannel, defaultIconURI);
+
+  return NS_NewChannel(aChannel,
+                       defaultIconURI,
+                       nsContentUtils::GetSystemPrincipal(),
+                       nsILoadInfo::SEC_NORMAL,
+                       nsIContentPolicy::TYPE_OTHER);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// faviconAsyncLoader
 
 namespace {
 
 /**