Skip to content

Commit

Permalink
Bug 1038756: Callsites creating a channel in /uriloader/ (r=honzab)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Kerschbaumer committed Sep 21, 2014
1 parent 996d8eb commit 92c6b4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
18 changes: 15 additions & 3 deletions uriloader/prefetch/nsOfflineCacheUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"
#include "nsContentUtils.h"

#include "nsXULAppAPI.h"

Expand Down Expand Up @@ -179,11 +180,16 @@ nsManifestCheck::Begin()

rv = mManifestHash->Init(nsICryptoHash::MD5);
NS_ENSURE_SUCCESS(rv, rv);

rv = NS_NewChannel(getter_AddRefs(mChannel),
mURI,
nullptr, nullptr, nullptr,
nsContentUtils::GetSystemPrincipal(),
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
nullptr, // aChannelPolicy
nullptr, // loadGroup
nullptr, // aCallbacks
nsIRequest::LOAD_BYPASS_CACHE);

NS_ENSURE_SUCCESS(rv, rv);

// configure HTTP specific stuff
Expand Down Expand Up @@ -374,8 +380,14 @@ nsOfflineCacheUpdateItem::OpenChannel(nsOfflineCacheUpdate *aUpdate)

rv = NS_NewChannel(getter_AddRefs(mChannel),
mURI,
nullptr, nullptr, this,
nsContentUtils::GetSystemPrincipal(),
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
nullptr, // aChannelPolicy
nullptr, // aLoadGroup
this, // aCallbacks
flags);

NS_ENSURE_SUCCESS(rv, rv);

nsCOMPtr<nsIApplicationCacheChannel> appCacheChannel =
Expand Down
9 changes: 8 additions & 1 deletion uriloader/prefetch/nsPrefetchService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "nsIDOMNode.h"
#include "nsINode.h"
#include "nsIDocument.h"
#include "nsContentUtils.h"

using namespace mozilla;

Expand Down Expand Up @@ -188,9 +189,15 @@ nsPrefetchNode::OpenChannel()
nsCOMPtr<nsILoadGroup> loadGroup = source->OwnerDoc()->GetDocumentLoadGroup();
nsresult rv = NS_NewChannel(getter_AddRefs(mChannel),
mURI,
nullptr, loadGroup, this,
nsContentUtils::GetSystemPrincipal(),
nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
nullptr, // aChannelPolicy
loadGroup, // aLoadGroup
this, // aCallbacks
nsIRequest::LOAD_BACKGROUND |
nsICachingChannel::LOAD_ONLY_IF_MODIFIED);

NS_ENSURE_SUCCESS(rv, rv);

// configure HTTP specific stuff
Expand Down

0 comments on commit 92c6b4b

Please sign in to comment.