From 181a218f38ffc2a95fcb4b2aa8a4dd923b9c9205 Mon Sep 17 00:00:00 2001 From: "ben%netscape.com" Date: Fri, 3 May 2002 03:00:20 +0000 Subject: [PATCH] [Chrome FastLoad] Add a comment describing the meaning of error code return values from nsXULPrototypeCache::GetPrototype. r=hyatt, sr=brendan git-svn-id: svn://10.0.0.236/trunk@120644 18797224-902f-48f8-a5cc-f745e15eee43 --- .../chrome/src/nsChromeProtocolHandler.cpp | 19 +++++++++++++++++-- .../chrome/src/nsChromeProtocolHandler.cpp | 19 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/mozilla/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/chrome/src/nsChromeProtocolHandler.cpp index c75050c1073..fca807551cc 100644 --- a/mozilla/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/chrome/src/nsChromeProtocolHandler.cpp @@ -606,8 +606,23 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, if (NS_FAILED(rv)) return rv; nsCOMPtr proto; - rv = cache->GetPrototype(aURI, getter_AddRefs(proto)); - if (NS_FAILED(rv)) return rv; + cache->GetPrototype(aURI, getter_AddRefs(proto)); + + // Same comment as nsXULDocument::StartDocumentLoad and + // nsXULDocument::ResumeWalk + // - Ben Goodger + // + // We don't abort on failure here because there are too many valid + // cases that can return failure, and the null-ness of |proto| is enough + // to trigger the fail-safe parse-from-disk solution. Example failure cases + // (for reference) include: + // + // NS_ERROR_NOT_AVAILABLE: the URI cannot be found in the FastLoad cache, + // parse from disk + // other: the FastLoad cache file, XUL.mfl, could not be found, probably + // due to being accessed before a profile has been selected (e.g. + // loading chrome for the profile manager itself). This must be + // parsed from disk. if (proto) { // ...in which case, we'll create a dummy stream that'll just diff --git a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp index c75050c1073..fca807551cc 100644 --- a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp @@ -606,8 +606,23 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, if (NS_FAILED(rv)) return rv; nsCOMPtr proto; - rv = cache->GetPrototype(aURI, getter_AddRefs(proto)); - if (NS_FAILED(rv)) return rv; + cache->GetPrototype(aURI, getter_AddRefs(proto)); + + // Same comment as nsXULDocument::StartDocumentLoad and + // nsXULDocument::ResumeWalk + // - Ben Goodger + // + // We don't abort on failure here because there are too many valid + // cases that can return failure, and the null-ness of |proto| is enough + // to trigger the fail-safe parse-from-disk solution. Example failure cases + // (for reference) include: + // + // NS_ERROR_NOT_AVAILABLE: the URI cannot be found in the FastLoad cache, + // parse from disk + // other: the FastLoad cache file, XUL.mfl, could not be found, probably + // due to being accessed before a profile has been selected (e.g. + // loading chrome for the profile manager itself). This must be + // parsed from disk. if (proto) { // ...in which case, we'll create a dummy stream that'll just