mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865022 - Set the http cache size to match the size of the /cache partition r=vingtetun
This commit is contained in:
parent
00be9ce5e6
commit
99900c7eda
@ -1209,3 +1209,19 @@ Services.obs.addObserver(function(aSubject, aTopic, aData) {
|
||||
pageURL: data.pageURL
|
||||
});
|
||||
}, "activity-done", false);
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
// Devices don't have all the same partition size for /cache where we
|
||||
// store the http cache.
|
||||
(function setHTTPCacheSize() {
|
||||
let path = Services.prefs.getCharPref("browser.cache.disk.parent_directory");
|
||||
let volumeService = Cc["@mozilla.org/telephony/volume-service;1"]
|
||||
.getService(Ci.nsIVolumeService);
|
||||
|
||||
let stats = volumeService.createOrGetVolumeByPath(path).getStats();
|
||||
|
||||
// We must set the size in KB, and keep a bit of free space.
|
||||
let size = Math.floor(stats.totalBytes / 1024) - 1024;
|
||||
Services.prefs.setIntPref("browser.cache.disk.capacity", size);
|
||||
}) ()
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user