Bug 588595 - Adjust number of tiles count down [r=stechz]
authorMark Finkle <mfinkle@mozilla.com>
Thu, 19 Aug 2010 01:37:23 -0400
changeset 1809 c195d2ca37e39c4ed788277c573c7c0b25c38aff
parent 1808 fa32126e5d30c2ebb5b8150a4a6b5fda8f7df57f
child 1810 d03333072f87ecb1ffda01dbc20f2b5b0e96a965
push id1614
push usermfinkle@mozilla.com
push dateThu, 19 Aug 2010 05:37:49 +0000
reviewersstechz
bugs588595
Bug 588595 - Adjust number of tiles count down [r=stechz]
app/mobile.js
chrome/content/BrowserView.js
--- a/app/mobile.js
+++ b/app/mobile.js
@@ -64,26 +64,17 @@ pref("ui.click_hold_context_menus", true
 /* cache prefs */
 pref("browser.cache.disk.enable", false);
 pref("browser.cache.disk.capacity", 0); // kilobytes
 
 pref("browser.cache.memory.enable", true);
 pref("browser.cache.memory.capacity", 1024); // kilobytes
 
 /* tile cache prefs */
-/* -1 = default to very small value for the number of tiles unless we know about
-        the device in which case we set this to an optimal value
-*/
-#ifdef WINCE
-pref("tile.cache.size", 15); // tiles
-#elifdef MOZ_PLATFORM_MAEMO
-pref("tile.cache.size", -1); // tiles
-#else
-pref("tile.cache.size", 30); // tiles
-#endif
+pref("tile.cache.size", 10); // tiles
 
 /* image cache prefs */
 pref("image.cache.size", 1048576); // bytes
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", true);
 pref("browser.cache.offline.enable", true);
 pref("browser.cache.offline.capacity", 5120); // kilobytes
--- a/chrome/content/BrowserView.js
+++ b/chrome/content/BrowserView.js
@@ -41,17 +41,16 @@
 
 let Ci = Components.interfaces;
 
 const kBrowserFormZoomLevelMin = 1.0;
 const kBrowserFormZoomLevelMax = 2.0;
 const kBrowserViewZoomLevelPrecision = 10000;
 const kBrowserViewPrefetchBeginIdleWait = 1;    // seconds
 const kBrowserViewPrefetchBeginIdleWaitLoading = 10;    // seconds
-const kBrowserViewCacheSize = 6;
 
 /**
  * A BrowserView maintains state of the viewport (browser, zoom level,
  * dimensions) and the visible rectangle into the viewport, for every
  * browser it is given (cf setBrowser()).  In updates to the viewport state,
  * a BrowserView (using its TileManager) renders parts of the page quasi-
  * intelligently, with guarantees of having rendered and appended all of the
  * visible browser content (aka the "critical rectangle").
@@ -198,39 +197,17 @@ BrowserView.prototype = {
   init: function init(container, visibleRectFactory) {
     this._batchOps = [];
     this._container = container;
     this._browser = null;
     this._browserViewportState = null;
     this._renderMode = 0;
     this._offscreenDepth = 0;
 
-    let cacheSize = kBrowserViewCacheSize;
-    try {
-      cacheSize = Services.prefs.getIntPref("tile.cache.size");
-    } catch(e) {}
-
-    if (cacheSize == -1) {
-      let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
-      let device = sysInfo.get("device");
-      switch (device) {
-#ifdef MOZ_PLATFORM_MAEMO
-        case "Nokia N900":
-          cacheSize = 26;
-          break;
-        case "Nokia N8xx":
-          // N8xx has half the memory of N900 and crashes with higher numbers
-          cacheSize = 10;
-          break;
-#endif
-        default:
-          // Use a minimum number of tiles sice we don't know the device
-          cacheSize = 6;
-      }
-    }
+    let cacheSize = Services.prefs.getIntPref("tile.cache.size");
 
     this._tileManager = new TileManager(this._appendTile, this._removeTile, this, cacheSize, container);
     this._visibleRectFactory = visibleRectFactory;
 
     this._idleServiceObserver = new BrowserView.IdleServiceObserver(this);
     this._idleService = Cc["@mozilla.org/widget/idleservice;1"].getService(Ci.nsIIdleService);
     this._idleService.addIdleObserver(this._idleServiceObserver, kBrowserViewPrefetchBeginIdleWait);
     this._idleServiceWait = kBrowserViewPrefetchBeginIdleWait;