Bug 471227: Add some temporary debugging spew to help narrow down what's failing.

This commit is contained in:
Dave Camp 2009-02-23 23:02:00 -08:00
parent 0e2a16f22b
commit 6ca99867e0

View File

@ -92,6 +92,11 @@
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "nsCommaSeparatedTokenizer.h" #include "nsCommaSeparatedTokenizer.h"
// XXX: Needed for debugging bug 471227, these two includes should not
// stick around
#include <nsIApplicationCache.h>
#include <nsIApplicationCacheChannel.h>
#define LOAD_STR "load" #define LOAD_STR "load"
#define ERROR_STR "error" #define ERROR_STR "error"
#define ABORT_STR "abort" #define ABORT_STR "abort"
@ -2300,6 +2305,30 @@ nsXMLHttpRequest::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult
// reasons are that the user leaves the page or hits the ESC key. // reasons are that the user leaves the page or hits the ESC key.
Error(nsnull); Error(nsnull);
{
// XXX: Some debugging spew for bug 471227, this should not stay
// in the tree.
// verify whether the application cache channel was associated
// with a channel.
nsCOMPtr<nsIApplicationCacheChannel> appCacheChannel =
do_QueryInterface(request);
nsCOMPtr<nsIApplicationCache> appCache;
if (appCacheChannel) {
appCacheChannel->GetApplicationCache(getter_AddRefs(appCache));
}
nsCAutoString spec;
nsCOMPtr<nsIURI> uri;
channel->GetURI(getter_AddRefs(uri));
if (uri) {
uri->GetSpec(spec);
}
printf("(Bug 471227): XHR failed for %s: status: %x, appcache: %p\n",
spec.get(), status, appCache.get());
}
// By nulling out channel here we make it so that Send() can test // By nulling out channel here we make it so that Send() can test
// for that and throw. Also calling the various status // for that and throw. Also calling the various status
// methods/members will not throw. // methods/members will not throw.