Bug 913807 - HTTP cache v2: API+top service+integration+tests, off by default, r=michal+ehsan+mark.finkle+fabrice+mhammond+gavin

This commit is contained in:
Honza Bambas
2013-09-20 11:11:25 +02:00
parent d68fc79787
commit a55f8e6460
274 changed files with 9823 additions and 2927 deletions

View File

@@ -9,6 +9,7 @@
#include "nsCRT.h"
#include "nsNetUtil.h"
#include "nsIObserverService.h"
#include "nsILoadContextInfo.h"
using namespace mozilla;
@@ -28,7 +29,7 @@ nsApplicationCacheService::nsApplicationCacheService()
NS_IMETHODIMP
nsApplicationCacheService::BuildGroupID(nsIURI *aManifestURL,
nsILoadContext *aLoadContext,
nsILoadContextInfo *aLoadContextInfo,
nsACString &_result)
{
nsresult rv;
@@ -36,12 +37,9 @@ nsApplicationCacheService::BuildGroupID(nsIURI *aManifestURL,
uint32_t appId = NECKO_NO_APP_ID;
bool isInBrowserElement = false;
if (aLoadContext) {
rv = aLoadContext->GetAppId(&appId);
NS_ENSURE_SUCCESS(rv, rv);
rv = aLoadContext->GetIsInBrowserElement(&isInBrowserElement);
NS_ENSURE_SUCCESS(rv, rv);
if (aLoadContextInfo) {
appId = aLoadContextInfo->AppId();
isInBrowserElement = aLoadContextInfo->IsInBrowserElement();
}
rv = nsOfflineCacheDevice::BuildApplicationCacheGroupID(
@@ -134,7 +132,7 @@ nsApplicationCacheService::DeactivateGroup(const nsACString &group)
NS_IMETHODIMP
nsApplicationCacheService::ChooseApplicationCache(const nsACString &key,
nsILoadContext *aLoadContext,
nsILoadContextInfo *aLoadContextInfo,
nsIApplicationCache **out)
{
if (!mCacheService)
@@ -144,7 +142,7 @@ nsApplicationCacheService::ChooseApplicationCache(const nsACString &key,
nsresult rv = mCacheService->GetOfflineDevice(getter_AddRefs(device));
NS_ENSURE_SUCCESS(rv, rv);
return device->ChooseApplicationCache(key, aLoadContext, out);
return device->ChooseApplicationCache(key, aLoadContextInfo, out);
}
NS_IMETHODIMP