Bug 746380 - Use URI of nsIChannel on state change. r=mfinkle a=blocking-fennec

This commit is contained in:
Brian Nicholson 2012-04-23 10:34:14 -04:00
Родитель 3932c32a82
Коммит 5323073c13
1 изменённых файлов: 4 добавлений и 5 удалений

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

@ -2044,11 +2044,6 @@ Tab.prototype = {
return; return;
} }
let browser = BrowserApp.getBrowserForWindow(aWebProgress.DOMWindow);
let uri = "";
if (browser)
uri = browser.currentURI.spec;
// Check to see if we restoring the content from a previous presentation (session) // Check to see if we restoring the content from a previous presentation (session)
// since there should be no real network activity // since there should be no real network activity
let restoring = aStateFlags & Ci.nsIWebProgressListener.STATE_RESTORING; let restoring = aStateFlags & Ci.nsIWebProgressListener.STATE_RESTORING;
@ -2056,6 +2051,10 @@ Tab.prototype = {
// true if the page loaded successfully (i.e., no 404s or other errors) // true if the page loaded successfully (i.e., no 404s or other errors)
let success = false; let success = false;
let uri = "";
try {
uri = aRequest.QueryInterface(Components.interfaces.nsIChannel).originalURI.spec;
} catch (e) { }
try { try {
success = aRequest.QueryInterface(Components.interfaces.nsIHttpChannel).requestSucceeded; success = aRequest.QueryInterface(Components.interfaces.nsIHttpChannel).requestSucceeded;
} catch (e) { } } catch (e) { }