зеркало из https://github.com/mozilla/pjs.git
Bug 252836 Exception ``[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: onxbldestructor :: line 402" data: no]'' thrown from function onxbldestructor(event=Event:{0}) in <chrome://global/content/bindings/browser.xml> line 402.
r=neil sr=bz
This commit is contained in:
Родитель
2009617be2
Коммит
e0e3a32c7d
|
@ -649,7 +649,7 @@ function getPostData()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
var sessionHistory = getWebNavigation().sessionHistory;
|
var sessionHistory = getWebNavigation().sessionHistory;
|
||||||
entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false);
|
var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false);
|
||||||
entry = entry.QueryInterface(Components.interfaces.nsISHEntry);
|
entry = entry.QueryInterface(Components.interfaces.nsISHEntry);
|
||||||
return entry.postData;
|
return entry.postData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2984,16 +2984,11 @@ NS_IMETHODIMP
|
||||||
nsDocShell::GetSessionHistory(nsISHistory ** aSessionHistory)
|
nsDocShell::GetSessionHistory(nsISHistory ** aSessionHistory)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aSessionHistory);
|
NS_ENSURE_ARG_POINTER(aSessionHistory);
|
||||||
if (mSessionHistory) {
|
|
||||||
*aSessionHistory = mSessionHistory;
|
*aSessionHistory = mSessionHistory;
|
||||||
NS_IF_ADDREF(*aSessionHistory);
|
NS_IF_ADDREF(*aSessionHistory);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
// nsDocShell::nsIWebPageDescriptor
|
// nsDocShell::nsIWebPageDescriptor
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
|
@ -61,28 +61,28 @@ function sHistoryInit(theWindow)
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
alert("Unable to get interface requestor object: " + e);
|
alert("Unable to get interface requestor object: " + e);
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
webNav = ifaceReq.getInterface(Components.interfaces.nsIWebNavigation);
|
webNav = ifaceReq.getInterface(Components.interfaces.nsIWebNavigation);
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
alert("Unable to get WebNavigation: " + e);
|
alert("Unable to get WebNavigation: " + e);
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
sHistory = webNav.sessionHistory;
|
sHistory = webNav.sessionHistory;
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
alert("Didn't get SessionHistory object: " + e);
|
alert("Didn't get SessionHistory object: " + e);
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
return sHistory;
|
return sHistory;
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
alert("Could not find Session History component: " + e);
|
alert("Could not find Session History component: " + e);
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ function testHistoryCount(sHistory)
|
||||||
{
|
{
|
||||||
if (!sHistory) {
|
if (!sHistory) {
|
||||||
alert("Didn't get SessionHistory object");
|
alert("Didn't get SessionHistory object");
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
var cnt = sHistory.count; // GetCount()
|
var cnt = sHistory.count; // GetCount()
|
||||||
return cnt;
|
return cnt;
|
||||||
|
@ -101,13 +101,14 @@ function testHistoryCount(sHistory)
|
||||||
|
|
||||||
// *************************************************************************
|
// *************************************************************************
|
||||||
// testHistoryIndex() returns the current session history index.
|
// testHistoryIndex() returns the current session history index.
|
||||||
|
// returns negative one if the history object is null.
|
||||||
// It accepts the session history object as the input parameter.
|
// It accepts the session history object as the input parameter.
|
||||||
// In your test script,
|
// In your test script,
|
||||||
function testHistoryIndex(sHistory)
|
function testHistoryIndex(sHistory)
|
||||||
{
|
{
|
||||||
if (!sHistory) {
|
if (!sHistory) {
|
||||||
alert("Didn't get SessionHistory object");
|
alert("Didn't get SessionHistory object");
|
||||||
return false;
|
return -1;
|
||||||
}
|
}
|
||||||
var shIndex = sHistory.index; // GetIndex()
|
var shIndex = sHistory.index; // GetIndex()
|
||||||
return shIndex;
|
return shIndex;
|
||||||
|
@ -120,7 +121,7 @@ function testMaxLength(sHistory)
|
||||||
{
|
{
|
||||||
if (!sHistory) {
|
if (!sHistory) {
|
||||||
alert("Didn't get SessionHistory object");
|
alert("Didn't get SessionHistory object");
|
||||||
return false;
|
return 0;
|
||||||
}
|
}
|
||||||
var maxLen = sHistory.maxLength; // GetMaxLength
|
var maxLen = sHistory.maxLength; // GetMaxLength
|
||||||
return maxLen;
|
return maxLen;
|
||||||
|
@ -136,7 +137,7 @@ function testGetEntryAtIndex(sHistory, cnt, modIndex)
|
||||||
{
|
{
|
||||||
if (!sHistory) {
|
if (!sHistory) {
|
||||||
alert("Didn't get SessionHistory object");
|
alert("Didn't get SessionHistory object");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
var entry = sHistory.getEntryAtIndex(cnt, modIndex);
|
var entry = sHistory.getEntryAtIndex(cnt, modIndex);
|
||||||
|
|
||||||
|
@ -150,7 +151,7 @@ function testSimpleEnum(sHistory)
|
||||||
{
|
{
|
||||||
if (!sHistory) {
|
if (!sHistory) {
|
||||||
alert("Didn't get SessionHistory object");
|
alert("Didn't get SessionHistory object");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
var simpleEnum = sHistory.SHistoryEnumerator;
|
var simpleEnum = sHistory.SHistoryEnumerator;
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ function testHistoryEntryUri(nextHE, index)
|
||||||
{
|
{
|
||||||
if (!nextHE) {
|
if (!nextHE) {
|
||||||
alert("Didn't get history entry object");
|
alert("Didn't get history entry object");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
// Get URI for the next Entry
|
// Get URI for the next Entry
|
||||||
Uri = entry.URI;
|
Uri = entry.URI;
|
||||||
|
@ -206,7 +207,7 @@ function testHistoryEntryTitle(nextHE, index)
|
||||||
{
|
{
|
||||||
if (!nextHE) {
|
if (!nextHE) {
|
||||||
alert("Didn't get history entry object");
|
alert("Didn't get history entry object");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
// Get Title for the nextEntry
|
// Get Title for the nextEntry
|
||||||
title = entry.title;
|
title = entry.title;
|
||||||
|
@ -222,7 +223,7 @@ function testHistoryEntryFrame(nextHE, index)
|
||||||
{
|
{
|
||||||
if (!nextHE) {
|
if (!nextHE) {
|
||||||
alert("Didn't get history entry object");
|
alert("Didn't get history entry object");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
// Get SubFrame Status for the nextEntry
|
// Get SubFrame Status for the nextEntry
|
||||||
frameStatus = entry.isSubFrame;
|
frameStatus = entry.isSubFrame;
|
||||||
|
|
|
@ -275,7 +275,7 @@ function testSessionHistory(webNav)
|
||||||
{
|
{
|
||||||
if (!webNav) {
|
if (!webNav) {
|
||||||
alert("Didn't get web navigation object");
|
alert("Didn't get web navigation object");
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
// Get the session history
|
// Get the session history
|
||||||
getSHistory = webNav.sessionHistory;
|
getSHistory = webNav.sessionHistory;
|
||||||
|
|
|
@ -516,14 +516,7 @@ function Startup()
|
||||||
|
|
||||||
//initConsoleListener();
|
//initConsoleListener();
|
||||||
|
|
||||||
// XXXjag work-around for bug 113076
|
if (!getBrowser().sessionHistory) {
|
||||||
// there's another bug where we throw an exception when getting
|
|
||||||
// sessionHistory if it is null, which I'm exploiting here to
|
|
||||||
// detect the situation described in bug 113076.
|
|
||||||
// The same problem caused bug 139522, also worked around below.
|
|
||||||
try {
|
|
||||||
getBrowser().sessionHistory;
|
|
||||||
} catch (e) {
|
|
||||||
/* Session history might not be available,
|
/* Session history might not be available,
|
||||||
so we wrap access to it in a try block */
|
so we wrap access to it in a try block */
|
||||||
try {
|
try {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче