Merge
This commit is contained in:
@@ -83,7 +83,10 @@
|
||||
#include "nsISHistory.h"
|
||||
#include "nsISHistoryInternal.h"
|
||||
#include "nsIDOMNSHTMLDocument.h"
|
||||
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsPLDOMEvent.h"
|
||||
|
||||
#include "nsIURI.h"
|
||||
#include "nsIURL.h"
|
||||
@@ -211,8 +214,28 @@ nsFrameLoader::LoadFrame()
|
||||
charset, base_uri);
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return LoadURI(uri);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = LoadURI(uri);
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
FireErrorEvent();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsFrameLoader::FireErrorEvent()
|
||||
{
|
||||
if (mOwnerContent) {
|
||||
nsRefPtr<nsPLDOMEvent> event =
|
||||
new nsLoadBlockingPLDOMEvent(mOwnerContent, NS_LITERAL_STRING("error"),
|
||||
PR_FALSE, PR_FALSE);
|
||||
event->PostDOMEvent();
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@@ -240,6 +263,17 @@ nsFrameLoader::LoadURI(nsIURI* aURI)
|
||||
|
||||
nsresult
|
||||
nsFrameLoader::ReallyStartLoading()
|
||||
{
|
||||
nsresult rv = ReallyStartLoadingInternal();
|
||||
if (NS_FAILED(rv)) {
|
||||
FireErrorEvent();
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrameLoader::ReallyStartLoadingInternal()
|
||||
{
|
||||
NS_ENSURE_STATE(mURIToLoad && mOwnerContent && mOwnerContent->IsInDoc());
|
||||
|
||||
@@ -294,11 +328,8 @@ nsFrameLoader::ReallyStartLoading()
|
||||
nsIWebNavigation::LOAD_FLAGS_NONE, PR_FALSE);
|
||||
mNeedsAsyncDestroy = tmpState;
|
||||
mURIToLoad = nsnull;
|
||||
#ifdef DEBUG
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to load the URL");
|
||||
}
|
||||
#endif
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user