[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
This commit is contained in:
ben%netscape.com 2002-05-03 03:00:20 +00:00
parent e7a1684e98
commit 181a218f38
2 changed files with 34 additions and 4 deletions

View File

@ -606,8 +606,23 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIXULPrototypeDocument> 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

View File

@ -606,8 +606,23 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIXULPrototypeDocument> 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