mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 501422 - HTML5 offline resources doesn't work, r=bzbarsky
This commit is contained in:
parent
465ca1483a
commit
365bb48638
@ -849,8 +849,32 @@ nsHttpChannel::CallOnStartRequest()
|
|||||||
|
|
||||||
// install stream converter if required
|
// install stream converter if required
|
||||||
rv = ApplyContentConversions();
|
rv = ApplyContentConversions();
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
return rv;
|
if (!mCanceled) {
|
||||||
|
// create offline cache entry if offline caching was requested
|
||||||
|
if (mCacheForOfflineUse) {
|
||||||
|
PRBool shouldCacheForOfflineUse;
|
||||||
|
rv = ShouldUpdateOfflineCacheEntry(&shouldCacheForOfflineUse);
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
|
if (shouldCacheForOfflineUse) {
|
||||||
|
LOG(("writing to the offline cache"));
|
||||||
|
rv = InitOfflineCacheEntry();
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
|
if (mOfflineCacheEntry) {
|
||||||
|
rv = InstallOfflineCacheListener();
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LOG(("offline cache is up to date, not updating"));
|
||||||
|
CloseOfflineCacheEntry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@ -1134,28 +1158,8 @@ nsHttpChannel::ProcessNormal()
|
|||||||
rv = InstallCacheListener();
|
rv = InstallCacheListener();
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
}
|
}
|
||||||
// create offline cache entry if offline caching was requested
|
|
||||||
if (mCacheForOfflineUse) {
|
|
||||||
PRBool shouldCacheForOfflineUse;
|
|
||||||
rv = ShouldUpdateOfflineCacheEntry(&shouldCacheForOfflineUse);
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
if (shouldCacheForOfflineUse) {
|
return NS_OK;
|
||||||
LOG(("writing to the offline cache"));
|
|
||||||
rv = InitOfflineCacheEntry();
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
if (mOfflineCacheEntry) {
|
|
||||||
rv = InstallOfflineCacheListener();
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG(("offline cache is up to date, not updating"));
|
|
||||||
CloseOfflineCacheEntry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
@ -2358,27 +2362,6 @@ nsHttpChannel::ReadFromCache()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up the offline cache entry for writing
|
|
||||||
if (mCacheForOfflineUse) {
|
|
||||||
PRBool shouldUpdateOffline;
|
|
||||||
rv = ShouldUpdateOfflineCacheEntry(&shouldUpdateOffline);
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
if (shouldUpdateOffline) {
|
|
||||||
LOG(("writing to the offline cache"));
|
|
||||||
rv = InitOfflineCacheEntry();
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
if (mOfflineCacheEntry) {
|
|
||||||
rv = InstallOfflineCacheListener();
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG(("offline cache is up to date, not updating"));
|
|
||||||
CloseOfflineCacheEntry();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// open input stream for reading...
|
// open input stream for reading...
|
||||||
nsCOMPtr<nsIInputStream> stream;
|
nsCOMPtr<nsIInputStream> stream;
|
||||||
rv = mCacheEntry->OpenInputStream(0, getter_AddRefs(stream));
|
rv = mCacheEntry->OpenInputStream(0, getter_AddRefs(stream));
|
||||||
|
Loading…
Reference in New Issue
Block a user