mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 596808 - nsDiskCacheDevice::Init() called twice resulting in no disk cache available r=jduell, a=betaN
This commit is contained in:
parent
06a4f2397e
commit
a554f1f1f7
4
netwerk/cache/nsCacheService.cpp
vendored
4
netwerk/cache/nsCacheService.cpp
vendored
@ -109,7 +109,7 @@
|
||||
|
||||
static const char * observerList[] = {
|
||||
"profile-before-change",
|
||||
"profile-after-change",
|
||||
"profile-do-change",
|
||||
NS_XPCOM_SHUTDOWN_OBSERVER_ID,
|
||||
NS_PRIVATE_BROWSING_SWITCH_TOPIC
|
||||
};
|
||||
@ -364,7 +364,7 @@ nsCacheProfilePrefObserver::Observe(nsISupports * subject,
|
||||
nsCacheService::OnProfileShutdown(!strcmp("shutdown-cleanse",
|
||||
data.get()));
|
||||
|
||||
} else if (!strcmp("profile-after-change", topic)) {
|
||||
} else if (!strcmp("profile-do-change", topic)) {
|
||||
// profile after change
|
||||
mHaveProfile = PR_TRUE;
|
||||
nsCOMPtr<nsIPrefBranch> branch = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
|
2
netwerk/cache/nsDiskCache.h
vendored
2
netwerk/cache/nsDiskCache.h
vendored
@ -53,7 +53,7 @@
|
||||
class nsDiskCache {
|
||||
public:
|
||||
enum {
|
||||
kCurrentVersion = 0x0001000D // format = 16 bits major version/16 bits minor version
|
||||
kCurrentVersion = 0x0001000E // format = 16 bits major version/16 bits minor version
|
||||
};
|
||||
|
||||
enum { kData, kMetaData };
|
||||
|
5
netwerk/cache/nsDiskCacheDevice.cpp
vendored
5
netwerk/cache/nsDiskCacheDevice.cpp
vendored
@ -368,7 +368,10 @@ nsDiskCacheDevice::Init()
|
||||
|
||||
nsresult rv;
|
||||
|
||||
NS_ENSURE_TRUE(!Initialized(), NS_ERROR_FAILURE);
|
||||
if (Initialized()) {
|
||||
NS_ERROR("Disk cache already initialized!");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (!mCacheDirectory)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user