mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug #24274--> delay creating a dummy channel in DoLoadURL until we are sure
we are going to need it. r=bienvenu,travis a=chofmann
This commit is contained in:
parent
54fc7472cf
commit
2fc75424f3
@ -1627,9 +1627,11 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
|
||||
*/
|
||||
nsIInterfaceRequestor * interfaceRequestor = NS_STATIC_CAST(nsIInterfaceRequestor *, this);
|
||||
nsCOMPtr<nsIChannel> dummyChannel;
|
||||
rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull, interfaceRequestor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// creating a channel is expensive...don't create it unless we know we have to
|
||||
// so move the creation down into each of the if clauses...
|
||||
if (nsnull != (const char *) ref) {
|
||||
rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull, interfaceRequestor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = OnStartDocumentLoad(mDocLoader, aUri, "load");
|
||||
// Go to the anchor in the current document
|
||||
rv = presShell->GoToAnchor(nsAutoString(ref));
|
||||
@ -1645,6 +1647,8 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
|
||||
}
|
||||
else if (aType == nsISessionHistory::LOAD_HISTORY)
|
||||
{
|
||||
rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull, interfaceRequestor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = OnStartDocumentLoad(mDocLoader, aUri, "load");
|
||||
// Go to the top of the current document
|
||||
nsCOMPtr<nsIViewManager> viewMgr;
|
||||
|
@ -1627,9 +1627,11 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
|
||||
*/
|
||||
nsIInterfaceRequestor * interfaceRequestor = NS_STATIC_CAST(nsIInterfaceRequestor *, this);
|
||||
nsCOMPtr<nsIChannel> dummyChannel;
|
||||
rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull, interfaceRequestor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// creating a channel is expensive...don't create it unless we know we have to
|
||||
// so move the creation down into each of the if clauses...
|
||||
if (nsnull != (const char *) ref) {
|
||||
rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull, interfaceRequestor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = OnStartDocumentLoad(mDocLoader, aUri, "load");
|
||||
// Go to the anchor in the current document
|
||||
rv = presShell->GoToAnchor(nsAutoString(ref));
|
||||
@ -1645,6 +1647,8 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
|
||||
}
|
||||
else if (aType == nsISessionHistory::LOAD_HISTORY)
|
||||
{
|
||||
rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull, interfaceRequestor);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = OnStartDocumentLoad(mDocLoader, aUri, "load");
|
||||
// Go to the top of the current document
|
||||
nsCOMPtr<nsIViewManager> viewMgr;
|
||||
|
Loading…
Reference in New Issue
Block a user