Changeset 872
- Timestamp:
- 2008-03-12 00:01:22 (2 years ago)
- Files:
-
- trunk/chrome/content/dta/manager.js (modified) (1 diff)
- trunk/chrome/content/dta/manager/prefs.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/chrome/content/dta/manager.js
r867 r872 488 488 unload: function D_unload() { 489 489 TimerManager.killAll(); 490 Prefs.shutdown(); 490 491 try { 491 492 this._cleanTmpDir(); trunk/chrome/content/dta/manager/prefs.js
r827 r872 63 63 // nsIObserver 64 64 observe: function(subject, topic, prefName) { 65 this._refreshPrefs( );65 this._refreshPrefs(prefName); 66 66 }, 67 67 … … 70 70 71 71 try { 72 this._resetConnPrefs(); 72 73 this._refreshPrefs(); 73 74 Preferences.addObserver('extensions.dta.', this); … … 79 80 }, 80 81 81 _refreshPrefs: function( ) {82 _refreshPrefs: function(prefName) { 82 83 Debug.logString("pref reload"); 83 84 this.mappings.forEach( … … 137 138 this.tempLocation = null; 138 139 } 139 var conns = (this.maxInProgress * this.maxChunks + 2) *2;140 ['network.http.max-connections', 'network.http.max-connections-per-server' , 'network.http.max-persistent-connections-per-server'].forEach(140 var conns = (this.maxInProgress * this.maxChunks) + 2; 141 ['network.http.max-connections', 'network.http.max-connections-per-server'].forEach( 141 142 function(e) { 143 if ((!prefName || prefName == e) && conns != Preferences.get(e, conns)) { 144 Preferences.setDTA(e, Preferences.get(e, conns)); 145 } 142 146 if (conns > Preferences.get(e, conns)) { 143 147 Preferences.set(e, conns); 144 148 } 145 conns /= 2; 149 conns = Math.floor(conns / 1.5); 150 } 151 ); 152 }, 153 shutdown: function() { 154 Preferences.removeObserver('network.', this); 155 this._resetConnPrefs(); 156 }, 157 _resetConnPrefs: function() { 158 ['network.http.max-connections', 'network.http.max-connections-per-server'].forEach( 159 function(e) { 160 let conn = Preferences.getDTA(e, 0); 161 if (conn) { 162 Preferences.set(e, conn); 163 Preferences.setDTA(e, 0); 164 } 146 165 } 147 166 );
