From dae428b1ccab8af7331af9aeda38f9e199512784 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Wed, 1 Dec 1999 00:16:25 +0000 Subject: [PATCH] uri dispatching nit...if the webshell doesn't have a parent content uri listener then return an error code instead of NS_OK. git-svn-id: svn://10.0.0.236/trunk@54825 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 9 ++++++++- mozilla/webshell/src/nsWebShell.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 9c12f9cce70..7667dca31d1 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1839,7 +1839,12 @@ NS_IMETHODIMP nsWebShell::CanHandleContent(const char * aContentType, rv = parentListener->CanHandleContent(aContentType, aCommand, aWindowTarget, aDesiredContentType, aCanHandleContent); else - *aCanHandleContent = PR_FALSE; + // i'm going to try something interesting...if we don't have a parent to dictate whether we + // can handle the content, let's say that we CAN handle the content instead of saying that we + // can't. I was running into the scenario where we were running a chrome url to bring up the first window + // in the top level webshell. We didn't have a parent content listener yet because it was too early in + // the start up process...so we'd fail to load the url.... + *aCanHandleContent = PR_TRUE; return NS_OK; } @@ -4348,6 +4353,8 @@ NS_IMETHODIMP nsWebShell::GetParentURIContentListener(nsIURIContentListener** *aParent = mParentContentListener; NS_ADDREF(*aParent); } + else + rv = NS_ERROR_NULL_POINTER; return rv; } diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 9c12f9cce70..7667dca31d1 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -1839,7 +1839,12 @@ NS_IMETHODIMP nsWebShell::CanHandleContent(const char * aContentType, rv = parentListener->CanHandleContent(aContentType, aCommand, aWindowTarget, aDesiredContentType, aCanHandleContent); else - *aCanHandleContent = PR_FALSE; + // i'm going to try something interesting...if we don't have a parent to dictate whether we + // can handle the content, let's say that we CAN handle the content instead of saying that we + // can't. I was running into the scenario where we were running a chrome url to bring up the first window + // in the top level webshell. We didn't have a parent content listener yet because it was too early in + // the start up process...so we'd fail to load the url.... + *aCanHandleContent = PR_TRUE; return NS_OK; } @@ -4348,6 +4353,8 @@ NS_IMETHODIMP nsWebShell::GetParentURIContentListener(nsIURIContentListener** *aParent = mParentContentListener; NS_ADDREF(*aParent); } + else + rv = NS_ERROR_NULL_POINTER; return rv; }