mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 969365 - Do ShouldCheckAppCache with AppID and InBrowser in HttpChannelParent, r=jduell
This commit is contained in:
parent
75624f2f6a
commit
efab360be6
@ -16,6 +16,7 @@
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsISupportsPriority.h"
|
||||
#include "nsIAuthPromptProvider.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsSerializationHelper.h"
|
||||
#include "nsISerializable.h"
|
||||
#include "nsIAssociatedContentSecurity.h"
|
||||
@ -249,10 +250,26 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI,
|
||||
}
|
||||
|
||||
if (setChooseApplicationCache) {
|
||||
// This works because we've already called SetNotificationCallbacks and
|
||||
// done mPBOverride logic by this point.
|
||||
appCacheChan->SetChooseApplicationCache(
|
||||
NS_ShouldCheckAppCache(uri, NS_UsePrivateBrowsing(mChannel)));
|
||||
bool inBrowser = false;
|
||||
uint32_t appId = NECKO_NO_APP_ID;
|
||||
if (mLoadContext) {
|
||||
mLoadContext->GetIsInBrowserElement(&inBrowser);
|
||||
mLoadContext->GetAppId(&appId);
|
||||
}
|
||||
|
||||
bool chooseAppCache = false;
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan =
|
||||
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID);
|
||||
if (secMan) {
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
secMan->GetAppCodebasePrincipal(uri, appId, inBrowser, getter_AddRefs(principal));
|
||||
|
||||
// This works because we've already called SetNotificationCallbacks and
|
||||
// done mPBOverride logic by this point.
|
||||
chooseAppCache = NS_ShouldCheckAppCache(principal, NS_UsePrivateBrowsing(mChannel));
|
||||
}
|
||||
|
||||
appCacheChan->SetChooseApplicationCache(chooseAppCache);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user