mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-02-06 02:30:56 +00:00
instrument script loads for debugging
This commit is contained in:
parent
842c3af2a3
commit
f71ffd52af
@ -531,6 +531,12 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
nsAutoCString scriptURISpec;
|
||||||
|
scriptURI->GetAsciiSpec(scriptURISpec);
|
||||||
|
fprintf(stderr, "Processing external script: %s\n", scriptURISpec.get());
|
||||||
|
#endif
|
||||||
|
|
||||||
// Double-check that the preload matches what we're asked to load now.
|
// Double-check that the preload matches what we're asked to load now.
|
||||||
mozilla::net::ReferrerPolicy ourRefPolicy = mDocument->GetReferrerPolicy();
|
mozilla::net::ReferrerPolicy ourRefPolicy = mDocument->GetReferrerPolicy();
|
||||||
CORSMode ourCORSMode = aElement->GetCORSMode();
|
CORSMode ourCORSMode = aElement->GetCORSMode();
|
||||||
@ -555,6 +561,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
// probably plans have changed; even though the preload was allowed seems
|
// probably plans have changed; even though the preload was allowed seems
|
||||||
// like the actual load is not; let's cancel the preload request.
|
// like the actual load is not; let's cancel the preload request.
|
||||||
|
NS_WARNING("Preload was cancelled");
|
||||||
request->Cancel();
|
request->Cancel();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -607,6 +614,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||||||
|
|
||||||
if (aElement->GetScriptAsync()) {
|
if (aElement->GetScriptAsync()) {
|
||||||
request->mIsAsync = true;
|
request->mIsAsync = true;
|
||||||
|
NS_WARNING("Current script is async");
|
||||||
if (request->IsDoneLoading()) {
|
if (request->IsDoneLoading()) {
|
||||||
mLoadedAsyncRequests.AppendElement(request);
|
mLoadedAsyncRequests.AppendElement(request);
|
||||||
// The script is available already. Run it ASAP when the event
|
// The script is available already. Run it ASAP when the event
|
||||||
@ -624,6 +632,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||||||
// Violate the HTML5 spec in order to make LABjs and the "order" plug-in
|
// Violate the HTML5 spec in order to make LABjs and the "order" plug-in
|
||||||
// for RequireJS work with their Gecko-sniffed code path. See
|
// for RequireJS work with their Gecko-sniffed code path. See
|
||||||
// http://lists.w3.org/Archives/Public/public-html/2010Oct/0088.html
|
// http://lists.w3.org/Archives/Public/public-html/2010Oct/0088.html
|
||||||
|
NS_WARNING("Parser not yet created for this script");
|
||||||
request->mIsNonAsyncScriptInserted = true;
|
request->mIsNonAsyncScriptInserted = true;
|
||||||
mNonAsyncExternalScriptInsertedRequests.AppendElement(request);
|
mNonAsyncExternalScriptInsertedRequests.AppendElement(request);
|
||||||
if (request->IsDoneLoading()) {
|
if (request->IsDoneLoading()) {
|
||||||
@ -636,6 +645,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||||||
// we now have a parser-inserted request that may or may not be still
|
// we now have a parser-inserted request that may or may not be still
|
||||||
// loading
|
// loading
|
||||||
if (aElement->GetScriptDeferred()) {
|
if (aElement->GetScriptDeferred()) {
|
||||||
|
NS_WARNING("Current script is deferred");
|
||||||
// We don't want to run this yet.
|
// We don't want to run this yet.
|
||||||
// If we come here, the script is a parser-created script and it has
|
// If we come here, the script is a parser-created script and it has
|
||||||
// the defer attribute but not the async attribute. Since a
|
// the defer attribute but not the async attribute. Since a
|
||||||
@ -1232,6 +1242,7 @@ nsScriptLoader::ProcessPendingRequests()
|
|||||||
|
|
||||||
if (mDocumentParsingDone && mXSLTRequests.isEmpty()) {
|
if (mDocumentParsingDone && mXSLTRequests.isEmpty()) {
|
||||||
while (!mDeferRequests.isEmpty() && mDeferRequests.getFirst()->IsReadyToRun()) {
|
while (!mDeferRequests.isEmpty() && mDeferRequests.getFirst()->IsReadyToRun()) {
|
||||||
|
NS_WARNING("Handling deferred request");
|
||||||
request = mDeferRequests.StealFirst();
|
request = mDeferRequests.StealFirst();
|
||||||
ProcessRequest(request);
|
ProcessRequest(request);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user