diff --git a/netwerk/cache2/CacheEntry.cpp b/netwerk/cache2/CacheEntry.cpp index 765e79c384a7..a898785110fd 100644 --- a/netwerk/cache2/CacheEntry.cpp +++ b/netwerk/cache2/CacheEntry.cpp @@ -1552,6 +1552,18 @@ NS_IMETHODIMP CacheEntry::GetDiskStorageSizeInKB(uint32_t *aDiskStorageSize) return mFile->GetDiskStorageSizeInKB(aDiskStorageSize); } +NS_IMETHODIMP CacheEntry::GetLoadContextInfo(nsILoadContextInfo** aInfo) +{ + nsCOMPtr info = CacheFileUtils::ParseKey(mStorageID); + if (!info) { + return NS_ERROR_FAILURE; + } + + info.forget(aInfo); + + return NS_OK; +} + // nsIRunnable NS_IMETHODIMP CacheEntry::Run() diff --git a/netwerk/cache2/OldWrappers.h b/netwerk/cache2/OldWrappers.h index 0bdb3f52ea4a..81f4158d4e19 100644 --- a/netwerk/cache2/OldWrappers.h +++ b/netwerk/cache2/OldWrappers.h @@ -135,6 +135,10 @@ public: { return mOldInfo->GetDataSize(aDataSize); } + NS_IMETHOD GetLoadContextInfo(nsILoadContextInfo** aInfo) override + { + return NS_ERROR_NOT_IMPLEMENTED; + } NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback* listener) override; NS_IMETHOD GetPersistent(bool *aPersistToDisk) override; diff --git a/netwerk/cache2/nsICacheEntry.idl b/netwerk/cache2/nsICacheEntry.idl index 1885b9423c64..6fa76bd24892 100644 --- a/netwerk/cache2/nsICacheEntry.idl +++ b/netwerk/cache2/nsICacheEntry.idl @@ -12,6 +12,7 @@ interface nsICacheEntryDoomCallback; interface nsICacheListener; interface nsIFile; interface nsICacheEntryMetaDataVisitor; +interface nsILoadContextInfo; [scriptable, uuid(607c2a2c-0a48-40b9-a956-8cf2bb9857cf)] interface nsICacheEntry : nsISupports @@ -233,6 +234,11 @@ interface nsICacheEntry : nsISupports */ nsIInputStream openAlternativeInputStream(in ACString type); + /** + * Get the nsILoadContextInfo of the cache entry + */ + readonly attribute nsILoadContextInfo loadContextInfo; + /**************************************************************************** * The following methods might be added to some nsICacheEntryInternal * interface since we want to remove them as soon as the old cache backend is