Bug 530013: Fennec should take steps to auto-connect network connections [r=gavin.sharp]

This commit is contained in:
Mark Finkle 2009-11-24 13:23:41 -05:00
Родитель 8d01b9bab1
Коммит 88938953a4
5 изменённых файлов: 37 добавлений и 5 удалений

Просмотреть файл

@ -100,6 +100,9 @@ pref("network.http.max-connections", 6);
pref("network.http.max-connections-per-server", 4);
pref("network.http.max-persistent-connections-per-server", 4);
pref("network.http.max-persistent-connections-per-proxy", 4);
#ifdef MOZ_PLATFORM_HILDON
pref("network.autodial-helper.enabled", true);
#endif
/* session history */
pref("browser.sessionhistory.max_total_viewers", 1);

Просмотреть файл

@ -165,6 +165,14 @@ let Util = {
}
return "none";
},
// Put the Mozilla networking code into a state that will kick the auto-connection
// process.
forceOnline: function forceOnline() {
#ifdef MOZ_PLATFORM_HILDON
gIOService.offline = false;
#endif
}
};

Просмотреть файл

@ -495,6 +495,9 @@ var BrowserUI = {
if (!aURI)
return;
// Make sure we're online before attempting to load
Util.forceOnline();
// Give the new page lots of room
Browser.hideSidebars();
@ -530,6 +533,9 @@ var BrowserUI = {
this._edit.popup.closePopup();
// Make sure we're online before attempting to load
Util.forceOnline();
var submission = button.engine.getSubmission(this._edit.value, null);
getBrowser().loadURI(submission.uri.spec, null, submission.postData, false);
},

Просмотреть файл

@ -475,11 +475,11 @@ var Browser = {
window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
let browsers = document.getElementById("browsers");
browsers.addEventListener("command", this._handleContentCommand, false);
browsers.addEventListener("command", this._handleContentCommand, true);
browsers.addEventListener("MozApplicationManifest", OfflineApps, false);
browsers.addEventListener("DOMUpdatePageReport", gPopupBlockerObserver.onUpdatePageReport, false);
/* Initialize Spatial Navigation */
// Initialize Spatial Navigation
function panCallback(aElement) {
if (!aElement)
return;
@ -491,10 +491,13 @@ var Browser = {
// for all of our <browser>s
SpatialNavigation.init(browsers, panCallback);
/* Login Manager */
// Login Manager
Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
/* Command line arguments/initial homepage */
// Make sure we're online before attempting to load
Util.forceOnline();
// Command line arguments/initial homepage
let whereURI = "about:blank";
switch (Util.needHomepageOverride()) {
case "new profile":
@ -894,6 +897,12 @@ var Browser = {
Browser.selectedBrowser.loadURI(url, null, null, false);
}
}
else if (/^about:neterror\?e=netOffline/.test(errorDoc.documentURI)) {
if (ot == errorDoc.getElementById("errorTryAgain") {
// Make sure we're online before attempting to load
Util.forceOnline();
}
}
},

Просмотреть файл

@ -507,6 +507,9 @@ var ExtensionsView = {
getAddonsFromRepo: function ev_getAddonsFromRepo(aTerms, aSelectFirstResult) {
this.clearSection("repo");
// Make sure we're online before attempting to load
Util.forceOnline();
if (this._repo.isSearching)
this._repo.cancelSearch();
@ -607,7 +610,10 @@ var ExtensionsView = {
updateAll: function ev_updateAll() {
if (!this._isXPInstallEnabled())
return;
// Make sure we're online before attempting to load
Util.forceOnline();
// To support custom views we check the add-ons displayed in the list
let items = [];
let start = this._localItem.nextSibling;