Bug 1054572 - Remove redundant references to HTTP cache v1 API r=mayhemer

This commit is contained in:
Steve Workman 2014-08-22 10:49:29 -07:00
parent 9159925a56
commit a2fbc3ec2f
16 changed files with 7 additions and 82 deletions

View File

@ -12,7 +12,6 @@
#include "nsCPrefetchService.h"
#include "nsNetUtil.h"
#include "nsNetCID.h"
#include "nsICacheSession.h"
#include "nsIOfflineCacheUpdate.h"
#include "nsAutoPtr.h"
#include "nsContentUtils.h"

View File

@ -18,7 +18,7 @@ function OfflineCacheContents(urls) {
OfflineCacheContents.prototype = {
QueryInterface: function(iid) {
if (!iid.equals(Ci.nsISupports) &&
!iid.equals(Ci.nsICacheListener)) {
!iid.equals(Ci.nsICacheEntryOpenCallback)) {
throw Cr.NS_ERROR_NO_INTERFACE;
}
return this;

View File

@ -6,7 +6,7 @@
#include "mozIThirdPartyUtil.h"
#include "nsNetUtil.h"
#include "nsICacheEntryDescriptor.h"
#include "nsICacheEntry.h"
#include "nsICachingChannel.h"
#include "nsIChannel.h"
#include "nsIDocShell.h"
@ -281,7 +281,7 @@ nsChannelClassifier::MarkEntryClassified(nsresult status)
return;
}
nsCOMPtr<nsICacheEntryDescriptor> cacheEntry =
nsCOMPtr<nsICacheEntry> cacheEntry =
do_QueryInterface(cacheToken);
if (!cacheEntry) {
return;
@ -313,7 +313,7 @@ nsChannelClassifier::HasBeenClassified(nsIChannel *aChannel)
return false;
}
nsCOMPtr<nsICacheEntryDescriptor> cacheEntry =
nsCOMPtr<nsICacheEntry> cacheEntry =
do_QueryInterface(cacheToken);
if (!cacheEntry) {
return false;

View File

@ -9,6 +9,7 @@
#include "HttpLog.h"
#include "nsHttp.h"
#include "nsICacheEntry.h"
#include "mozilla/unused.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/TabChild.h"
@ -41,7 +42,7 @@ HttpChannelChild::HttpChannelChild()
: HttpAsyncAborter<HttpChannelChild>(MOZ_THIS_IN_INITIALIZER_LIST())
, mIsFromCache(false)
, mCacheEntryAvailable(false)
, mCacheExpirationTime(nsICache::NO_EXPIRATION_TIME)
, mCacheExpirationTime(nsICacheEntry::NO_EXPIRATION_TIME)
, mSendResumeAt(false)
, mIPCOpen(false)
, mKeptAlive(false)

View File

@ -572,7 +572,7 @@ HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
nsHttpRequestHead *requestHead = chan->GetRequestHead();
bool isFromCache = false;
chan->IsFromCache(&isFromCache);
uint32_t expirationTime = nsICache::NO_EXPIRATION_TIME;
uint32_t expirationTime = nsICacheEntry::NO_EXPIRATION_TIME;
chan->GetCacheTokenExpirationTime(&expirationTime);
nsCString cachedCharset;
chan->GetCacheTokenCachedCharset(cachedCharset);

View File

@ -58,7 +58,6 @@
#include "nsInputStreamPump.h"
#include "nsURLHelper.h"
#include "nsISocketTransport.h"
#include "nsICacheSession.h"
#include "nsIStreamConverterService.h"
#include "nsISiteSecurityService.h"
#include "nsCRT.h"

View File

@ -25,7 +25,6 @@
class nsIPrincipal;
class nsDNSPrefetch;
class nsICacheEntryDescriptor;
class nsICancelable;
class nsIHttpChannelAuthProvider;
class nsInputStreamPump;

View File

@ -38,7 +38,6 @@
#include "EventTokenBucket.h"
#include "Tickler.h"
#include "nsIXULAppInfo.h"
#include "nsICacheSession.h"
#include "nsICookieService.h"
#include "nsIObserverService.h"
#include "nsISiteSecurityService.h"
@ -194,7 +193,6 @@ nsHttpHandler::nsHttpHandler()
, mSpdyPingThreshold(PR_SecondsToInterval(58))
, mSpdyPingTimeout(PR_SecondsToInterval(8))
, mConnectTimeout(90000)
, mBypassCacheLockThreshold(250.0)
, mParallelSpeculativeConnectLimit(6)
, mRequestTokenBucketEnabled(true)
, mRequestTokenBucketMinParallelism(6)
@ -1242,16 +1240,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
mConnectTimeout = clamped(val, 1, 0xffff) * PR_MSEC_PER_SEC;
}
// The maximum amount of time the cache session lock can be held
// before a new transaction bypasses the cache. In milliseconds.
if (PREF_CHANGED(HTTP_PREF("bypass-cachelock-threshold"))) {
rv = prefs->GetIntPref(HTTP_PREF("bypass-cachelock-threshold"), &val);
if (NS_SUCCEEDED(rv))
// the pref and variable are both in milliseconds
mBypassCacheLockThreshold =
static_cast<double>(clamped(val, 0, 0x7ffffff));
}
// The maximum number of current global half open sockets allowable
// for starting a new speculative connection.
if (PREF_CHANGED(HTTP_PREF("speculative-parallel-limit"))) {
@ -1774,35 +1762,6 @@ nsHttpHandler::GetMisc(nsACString &value)
return NS_OK;
}
/*static*/ void
nsHttpHandler::GetCacheSessionNameForStoragePolicy(
nsCacheStoragePolicy storagePolicy,
bool isPrivate,
uint32_t appId,
bool inBrowser,
nsACString& sessionName)
{
MOZ_ASSERT(!isPrivate || storagePolicy == nsICache::STORE_IN_MEMORY);
switch (storagePolicy) {
case nsICache::STORE_IN_MEMORY:
sessionName.AssignASCII(isPrivate ? "HTTP-memory-only-PB" : "HTTP-memory-only");
break;
case nsICache::STORE_OFFLINE:
sessionName.AssignLiteral("HTTP-offline");
break;
default:
sessionName.AssignLiteral("HTTP");
break;
}
if (appId != NECKO_NO_APP_ID || inBrowser) {
sessionName.Append('~');
sessionName.AppendInt(appId);
sessionName.Append('~');
sessionName.AppendInt(inBrowser);
}
}
//-----------------------------------------------------------------------------
// nsHttpHandler::nsIObserver
//-----------------------------------------------------------------------------

View File

@ -18,7 +18,6 @@
#include "nsIHttpProtocolHandler.h"
#include "nsIObserver.h"
#include "nsISpeculativeConnect.h"
#include "nsICache.h"
class nsIHttpChannel;
class nsIPrefBranch;
@ -110,7 +109,6 @@ public:
uint32_t ConnectTimeout() { return mConnectTimeout; }
uint32_t ParallelSpeculativeConnectLimit() { return mParallelSpeculativeConnectLimit; }
bool CriticalRequestPrioritization() { return mCriticalRequestPrioritization; }
double BypassCacheLockThreshold() { return mBypassCacheLockThreshold; }
uint32_t MaxConnectionsPerOrigin() { return mMaxPersistentConnectionsPerServer; }
bool UseRequestTokenBucket() { return mRequestTokenBucketEnabled; }
@ -300,13 +298,6 @@ public:
// returns true in between Init and Shutdown states
bool Active() { return mHandlerActive; }
static void GetCacheSessionNameForStoragePolicy(
nsCacheStoragePolicy storagePolicy,
bool isPrivate,
uint32_t appId,
bool inBrowser,
nsACString& sessionName);
// When the disk cache is responding slowly its use is suppressed
// for 1 minute for most requests. Callable from main thread only.
TimeStamp GetCacheSkippedUntil() { return mCacheSkippedUntil; }
@ -474,10 +465,6 @@ private:
// established. In milliseconds.
uint32_t mConnectTimeout;
// The maximum amount of time the nsICacheSession lock can be held
// before a new transaction bypasses the cache. In milliseconds.
double mBypassCacheLockThreshold;
// The maximum number of current global half open sockets allowable
// when starting a new speculative connection.
uint32_t mParallelSpeculativeConnectLimit;

View File

@ -1,8 +1,5 @@
var _ios;
var ACCESS_WRITE = Ci.nsICache.ACCESS_WRITE;
var ACCESS_READ = Ci.nsICache.ACCESS_READ;
var KEY_CORRUPT_SECINFO = "http://corruptSecurityInfo/";
var ENTRY_DATA = "foobar";

View File

@ -38,17 +38,6 @@ function make_uri(url) {
return ios.newURI(url, null, null);
}
function CacheListener() { }
CacheListener.prototype = {
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsICacheListener))
return this;
throw Components.results.NS_NOINTERFACE;
},
};
const responseBody = "response body";
// A HTTP channel for updating the offline cache should normally succeed.

View File

@ -13,7 +13,6 @@
#include "nsIStringStream.h"
#include "nsIChannel.h"
#include "nsICachingChannel.h"
#include "nsICacheEntryDescriptor.h"
#include "nsIInputStream.h"
#include "CNavDTD.h"
#include "prenv.h"

View File

@ -14,7 +14,6 @@
#include "nsIApplicationCacheContainer.h"
#include "nsIApplicationCacheChannel.h"
#include "nsIApplicationCacheService.h"
#include "nsICache.h"
#include "nsICachingChannel.h"
#include "nsIContent.h"
#include "mozilla/dom/Element.h"

View File

@ -36,7 +36,6 @@
class nsOfflineCacheUpdate;
class nsICacheEntryDescriptor;
class nsIUTF8StringEnumerator;
class nsILoadContext;

View File

@ -31,7 +31,6 @@
#include "nsIWebProgress.h"
#include "nsIWebNavigation.h"
#include "nsICryptoHash.h"
#include "nsICacheEntryDescriptor.h"
#include "nsIPermissionManager.h"
#include "nsIPrincipal.h"
#include "nsIScriptSecurityManager.h"

View File

@ -10,7 +10,6 @@
#include "nsIWebProgress.h"
#include "nsCURILoader.h"
#include "nsICachingChannel.h"
#include "nsICacheVisitor.h"
#include "nsIHttpChannel.h"
#include "nsIURL.h"
#include "nsISimpleEnumerator.h"