forked from mirrors/gecko-dev
Bug 1129015, part 2 - Remove trailing whitespace from docloader. r=smaug
This commit is contained in:
parent
7dbe705433
commit
1430792c6b
2 changed files with 60 additions and 60 deletions
|
|
@ -125,7 +125,7 @@ nsDocLoader::nsDocLoader()
|
||||||
|
|
||||||
ClearInternalProgress();
|
ClearInternalProgress();
|
||||||
|
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: created.\n", this));
|
("DocLoader:%p: created.\n", this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,7 +133,7 @@ nsresult
|
||||||
nsDocLoader::SetDocLoaderParent(nsDocLoader *aParent)
|
nsDocLoader::SetDocLoaderParent(nsDocLoader *aParent)
|
||||||
{
|
{
|
||||||
mParent = aParent;
|
mParent = aParent;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
@ -146,7 +146,7 @@ nsDocLoader::Init()
|
||||||
nsresult rv = NS_NewLoadGroup(getter_AddRefs(mLoadGroup), this);
|
nsresult rv = NS_NewLoadGroup(getter_AddRefs(mLoadGroup), this);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: load group %x.\n", this, mLoadGroup.get()));
|
("DocLoader:%p: load group %x.\n", this, mLoadGroup.get()));
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
@ -190,7 +190,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocLoader)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIDocumentLoader)
|
NS_INTERFACE_MAP_ENTRY(nsIDocumentLoader)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWebProgress)
|
NS_INTERFACE_MAP_ENTRY(nsIWebProgress)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIProgressEventSink)
|
NS_INTERFACE_MAP_ENTRY(nsIProgressEventSink)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
|
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsISecurityEventSink)
|
NS_INTERFACE_MAP_ENTRY(nsISecurityEventSink)
|
||||||
|
|
@ -249,7 +249,7 @@ nsDocLoader::Stop(void)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: Stop() called\n", this));
|
("DocLoader:%p: Stop() called\n", this));
|
||||||
|
|
||||||
NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mChildList, nsDocLoader, Stop, ());
|
NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mChildList, nsDocLoader, Stop, ());
|
||||||
|
|
@ -279,9 +279,9 @@ nsDocLoader::Stop(void)
|
||||||
|
|
||||||
NS_ASSERTION(!IsBusy(), "Shouldn't be busy here");
|
NS_ASSERTION(!IsBusy(), "Shouldn't be busy here");
|
||||||
DocLoaderIsEmpty(false);
|
DocLoaderIsEmpty(false);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -307,7 +307,7 @@ nsDocLoader::IsBusy()
|
||||||
if (!mIsLoadingDocument) {
|
if (!mIsLoadingDocument) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool busy;
|
bool busy;
|
||||||
rv = mLoadGroup->IsPending(&busy);
|
rv = mLoadGroup->IsPending(&busy);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
@ -359,7 +359,7 @@ nsDocLoader::Destroy()
|
||||||
Stop();
|
Stop();
|
||||||
|
|
||||||
// Remove the document loader from the parent list of loaders...
|
// Remove the document loader from the parent list of loaders...
|
||||||
if (mParent)
|
if (mParent)
|
||||||
{
|
{
|
||||||
mParent->RemoveChildLoader(this);
|
mParent->RemoveChildLoader(this);
|
||||||
}
|
}
|
||||||
|
|
@ -453,7 +453,7 @@ nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt)
|
||||||
|
|
||||||
// This request is associated with the entire document...
|
// This request is associated with the entire document...
|
||||||
mDocumentRequest = request;
|
mDocumentRequest = request;
|
||||||
mLoadGroup->SetDefaultLoadRequest(request);
|
mLoadGroup->SetDefaultLoadRequest(request);
|
||||||
|
|
||||||
// Only fire the start document load notification for the first
|
// Only fire the start document load notification for the first
|
||||||
// document URI... Do not fire it again for redirections
|
// document URI... Do not fire it again for redirections
|
||||||
|
|
@ -466,7 +466,7 @@ nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt)
|
||||||
doStartDocumentLoad();
|
doStartDocumentLoad();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(!mIsLoadingDocument || mDocumentRequest,
|
NS_ASSERTION(!mIsLoadingDocument || mDocumentRequest,
|
||||||
|
|
@ -478,7 +478,7 @@ nsDocLoader::OnStartRequest(nsIRequest *request, nsISupports *aCtxt)
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
||||||
nsISupports *aCtxt,
|
nsISupports *aCtxt,
|
||||||
nsresult aStatus)
|
nsresult aStatus)
|
||||||
{
|
{
|
||||||
|
|
@ -519,7 +519,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
||||||
int64_t oldMax = info->mMaxProgress;
|
int64_t oldMax = info->mMaxProgress;
|
||||||
|
|
||||||
info->mMaxProgress = info->mCurrentProgress;
|
info->mMaxProgress = info->mCurrentProgress;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If a request whose content-length was previously unknown has just
|
// If a request whose content-length was previously unknown has just
|
||||||
// finished loading, then use this new data to try to calculate a
|
// finished loading, then use this new data to try to calculate a
|
||||||
|
|
@ -533,7 +533,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
||||||
// of CalculateMaxProgress() result. We need to remove the info from the
|
// of CalculateMaxProgress() result. We need to remove the info from the
|
||||||
// hash, see bug 480713.
|
// hash, see bug 480713.
|
||||||
mCompletedTotalProgress += info->mMaxProgress;
|
mCompletedTotalProgress += info->mMaxProgress;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Determine whether a STATE_TRANSFERRING notification should be
|
// Determine whether a STATE_TRANSFERRING notification should be
|
||||||
// 'synthesized'.
|
// 'synthesized'.
|
||||||
|
|
@ -587,7 +587,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
||||||
if (bFireTransferring) {
|
if (bFireTransferring) {
|
||||||
// Send a STATE_TRANSFERRING notification for the request.
|
// Send a STATE_TRANSFERRING notification for the request.
|
||||||
int32_t flags;
|
int32_t flags;
|
||||||
|
|
||||||
flags = nsIWebProgressListener::STATE_TRANSFERRING |
|
flags = nsIWebProgressListener::STATE_TRANSFERRING |
|
||||||
nsIWebProgressListener::STATE_IS_REQUEST;
|
nsIWebProgressListener::STATE_IS_REQUEST;
|
||||||
//
|
//
|
||||||
|
|
@ -607,11 +607,11 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
||||||
// Fire the OnStateChange(...) notification for stop request
|
// Fire the OnStateChange(...) notification for stop request
|
||||||
//
|
//
|
||||||
doStopURLLoad(aRequest, aStatus);
|
doStopURLLoad(aRequest, aStatus);
|
||||||
|
|
||||||
// Clear this request out of the hash to avoid bypass of FireOnStateChange
|
// Clear this request out of the hash to avoid bypass of FireOnStateChange
|
||||||
// when address of the request is reused.
|
// when address of the request is reused.
|
||||||
RemoveRequestInfo(aRequest);
|
RemoveRequestInfo(aRequest);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Only fire the DocLoaderIsEmpty(...) if the document loader has initiated a
|
// Only fire the DocLoaderIsEmpty(...) if the document loader has initiated a
|
||||||
// load. This will handle removing the request from our hashtable as needed.
|
// load. This will handle removing the request from our hashtable as needed.
|
||||||
|
|
@ -619,7 +619,7 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest,
|
||||||
if (mIsLoadingDocument) {
|
if (mIsLoadingDocument) {
|
||||||
DocLoaderIsEmpty(true);
|
DocLoaderIsEmpty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -648,7 +648,7 @@ NS_IMETHODIMP nsDocLoader::GetDocumentChannel(nsIChannel ** aChannel)
|
||||||
*aChannel = nullptr;
|
*aChannel = nullptr;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CallQueryInterface(mDocumentRequest, aChannel);
|
return CallQueryInterface(mDocumentRequest, aChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -699,7 +699,7 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout)
|
||||||
// we don't need it anymore to CalculateMaxProgress().
|
// we don't need it anymore to CalculateMaxProgress().
|
||||||
ClearInternalProgress();
|
ClearInternalProgress();
|
||||||
|
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: Is now idle...\n", this));
|
("DocLoader:%p: Is now idle...\n", this));
|
||||||
|
|
||||||
nsCOMPtr<nsIRequest> docRequest = mDocumentRequest;
|
nsCOMPtr<nsIRequest> docRequest = mDocumentRequest;
|
||||||
|
|
@ -712,14 +712,14 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout)
|
||||||
mProgressStateFlags = nsIWebProgressListener::STATE_STOP;
|
mProgressStateFlags = nsIWebProgressListener::STATE_STOP;
|
||||||
|
|
||||||
|
|
||||||
nsresult loadGroupStatus = NS_OK;
|
nsresult loadGroupStatus = NS_OK;
|
||||||
mLoadGroup->GetStatus(&loadGroupStatus);
|
mLoadGroup->GetStatus(&loadGroupStatus);
|
||||||
|
|
||||||
//
|
//
|
||||||
// New code to break the circular reference between
|
// New code to break the circular reference between
|
||||||
// the load group and the docloader...
|
// the load group and the docloader...
|
||||||
//
|
//
|
||||||
mLoadGroup->SetDefaultLoadRequest(nullptr);
|
mLoadGroup->SetDefaultLoadRequest(nullptr);
|
||||||
|
|
||||||
// Take a ref to our parent now so that we can call DocLoaderIsEmpty() on
|
// Take a ref to our parent now so that we can call DocLoaderIsEmpty() on
|
||||||
// it even if our onload handler removes us from the docloader tree.
|
// it even if our onload handler removes us from the docloader tree.
|
||||||
|
|
@ -750,7 +750,7 @@ void nsDocLoader::doStartDocumentLoad(void)
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(mDocumentRequest, buffer);
|
GetURIStringFromRequest(mDocumentRequest, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: ++ Firing OnStateChange for start document load (...)."
|
("DocLoader:%p: ++ Firing OnStateChange for start document load (...)."
|
||||||
"\tURI: %s \n",
|
"\tURI: %s \n",
|
||||||
this, buffer.get()));
|
this, buffer.get()));
|
||||||
|
|
@ -775,7 +775,7 @@ void nsDocLoader::doStartURLLoad(nsIRequest *request)
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(request, buffer);
|
GetURIStringFromRequest(request, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: ++ Firing OnStateChange start url load (...)."
|
("DocLoader:%p: ++ Firing OnStateChange start url load (...)."
|
||||||
"\tURI: %s\n",
|
"\tURI: %s\n",
|
||||||
this, buffer.get()));
|
this, buffer.get()));
|
||||||
|
|
@ -794,7 +794,7 @@ void nsDocLoader::doStopURLLoad(nsIRequest *request, nsresult aStatus)
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(request, buffer);
|
GetURIStringFromRequest(request, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: ++ Firing OnStateChange for end url load (...)."
|
("DocLoader:%p: ++ Firing OnStateChange for end url load (...)."
|
||||||
"\tURI: %s status=%x\n",
|
"\tURI: %s status=%x\n",
|
||||||
this, buffer.get(), aStatus));
|
this, buffer.get(), aStatus));
|
||||||
|
|
@ -823,7 +823,7 @@ void nsDocLoader::doStopDocumentLoad(nsIRequest *request,
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(request, buffer);
|
GetURIStringFromRequest(request, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: ++ Firing OnStateChange for end document load (...)."
|
("DocLoader:%p: ++ Firing OnStateChange for end document load (...)."
|
||||||
"\tURI: %s Status=%x\n",
|
"\tURI: %s Status=%x\n",
|
||||||
this, buffer.get(), aStatus));
|
this, buffer.get(), aStatus));
|
||||||
|
|
@ -835,7 +835,7 @@ void nsDocLoader::doStopDocumentLoad(nsIRequest *request,
|
||||||
// the onload handlers rearrange the docshell tree.
|
// the onload handlers rearrange the docshell tree.
|
||||||
WebProgressList list;
|
WebProgressList list;
|
||||||
GatherAncestorWebProgresses(list);
|
GatherAncestorWebProgresses(list);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fire an OnStateChange(...) notification indicating the the
|
// Fire an OnStateChange(...) notification indicating the the
|
||||||
// current document has finished loading...
|
// current document has finished loading...
|
||||||
|
|
@ -952,7 +952,7 @@ int64_t nsDocLoader::GetMaxTotalProgress()
|
||||||
|
|
||||||
uint32_t count = mChildList.Length();
|
uint32_t count = mChildList.Length();
|
||||||
nsCOMPtr<nsIWebProgress> webProgress;
|
nsCOMPtr<nsIWebProgress> webProgress;
|
||||||
for (uint32_t i=0; i < count; i++)
|
for (uint32_t i=0; i < count; i++)
|
||||||
{
|
{
|
||||||
int64_t individualProgress = 0;
|
int64_t individualProgress = 0;
|
||||||
nsIDocumentLoader* docloader = ChildAt(i);
|
nsIDocumentLoader* docloader = ChildAt(i);
|
||||||
|
|
@ -974,17 +974,17 @@ int64_t nsDocLoader::GetMaxTotalProgress()
|
||||||
int64_t progress = -1;
|
int64_t progress = -1;
|
||||||
if (mMaxSelfProgress >= int64_t(0) && newMaxTotal >= int64_t(0))
|
if (mMaxSelfProgress >= int64_t(0) && newMaxTotal >= int64_t(0))
|
||||||
progress = newMaxTotal + mMaxSelfProgress;
|
progress = newMaxTotal + mMaxSelfProgress;
|
||||||
|
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
// The following section contains support for nsIProgressEventSink which is used to
|
// The following section contains support for nsIProgressEventSink which is used to
|
||||||
// pass progress and status between the actual request and the doc loader. The doc loader
|
// pass progress and status between the actual request and the doc loader. The doc loader
|
||||||
// then turns around and makes the right web progress calls based on this information.
|
// then turns around and makes the right web progress calls based on this information.
|
||||||
////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
||||||
int64_t aProgress, int64_t aProgressMax)
|
int64_t aProgress, int64_t aProgressMax)
|
||||||
{
|
{
|
||||||
int64_t progressDelta = 0;
|
int64_t progressDelta = 0;
|
||||||
|
|
@ -1010,7 +1010,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
||||||
nsLoadFlags lf = 0;
|
nsLoadFlags lf = 0;
|
||||||
aRequest->GetLoadFlags(&lf);
|
aRequest->GetLoadFlags(&lf);
|
||||||
if ((lf & nsIChannel::LOAD_DOCUMENT_URI) && !(lf & nsIChannel::LOAD_TARGETED)) {
|
if ((lf & nsIChannel::LOAD_DOCUMENT_URI) && !(lf & nsIChannel::LOAD_TARGETED)) {
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p Ignoring OnProgress while load is not targeted\n", this));
|
("DocLoader:%p Ignoring OnProgress while load is not targeted\n", this));
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -1031,8 +1031,8 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
||||||
|
|
||||||
// Send a STATE_TRANSFERRING notification for the request.
|
// Send a STATE_TRANSFERRING notification for the request.
|
||||||
int32_t flags;
|
int32_t flags;
|
||||||
|
|
||||||
flags = nsIWebProgressListener::STATE_TRANSFERRING |
|
flags = nsIWebProgressListener::STATE_TRANSFERRING |
|
||||||
nsIWebProgressListener::STATE_IS_REQUEST;
|
nsIWebProgressListener::STATE_IS_REQUEST;
|
||||||
//
|
//
|
||||||
// Move the WebProgress into the STATE_TRANSFERRING state if necessary...
|
// Move the WebProgress into the STATE_TRANSFERRING state if necessary...
|
||||||
|
|
@ -1059,7 +1059,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(aRequest, buffer);
|
GetURIStringFromRequest(aRequest, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p OOPS - No Request Info for: %s\n",
|
("DocLoader:%p OOPS - No Request Info for: %s\n",
|
||||||
this, buffer.get()));
|
this, buffer.get()));
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
@ -1076,7 +1076,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocLoader::OnStatus(nsIRequest* aRequest, nsISupports* ctxt,
|
NS_IMETHODIMP nsDocLoader::OnStatus(nsIRequest* aRequest, nsISupports* ctxt,
|
||||||
nsresult aStatus, const char16_t* aStatusArg)
|
nsresult aStatus, const char16_t* aStatusArg)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
|
@ -1189,7 +1189,7 @@ void nsDocLoader::FireOnProgressChange(nsDocLoader *aLoadInitiator,
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(request, buffer);
|
GetURIStringFromRequest(request, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: Progress (%s): curSelf: %d maxSelf: %d curTotal: %d maxTotal %d\n",
|
("DocLoader:%p: Progress (%s): curSelf: %d maxSelf: %d curTotal: %d maxTotal %d\n",
|
||||||
this, buffer.get(), aProgress, aProgressMax, aTotalProgress, aMaxTotalProgress));
|
this, buffer.get(), aProgress, aProgressMax, aTotalProgress, aMaxTotalProgress));
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
@ -1242,7 +1242,7 @@ void nsDocLoader::DoFireOnStateChange(nsIWebProgress * const aProgress,
|
||||||
// active...
|
// active...
|
||||||
//
|
//
|
||||||
if (mIsLoadingDocument &&
|
if (mIsLoadingDocument &&
|
||||||
(aStateFlags & nsIWebProgressListener::STATE_IS_NETWORK) &&
|
(aStateFlags & nsIWebProgressListener::STATE_IS_NETWORK) &&
|
||||||
(this != aProgress)) {
|
(this != aProgress)) {
|
||||||
aStateFlags &= ~nsIWebProgressListener::STATE_IS_NETWORK;
|
aStateFlags &= ~nsIWebProgressListener::STATE_IS_NETWORK;
|
||||||
}
|
}
|
||||||
|
|
@ -1255,7 +1255,7 @@ void nsDocLoader::DoFireOnStateChange(nsIWebProgress * const aProgress,
|
||||||
nsAutoCString buffer;
|
nsAutoCString buffer;
|
||||||
|
|
||||||
GetURIStringFromRequest(aRequest, buffer);
|
GetURIStringFromRequest(aRequest, buffer);
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: Status (%s): code: %x\n",
|
("DocLoader:%p: Status (%s): code: %x\n",
|
||||||
this, buffer.get(), aStateFlags));
|
this, buffer.get(), aStateFlags));
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
@ -1295,7 +1295,7 @@ nsDocLoader::FireOnStatusChange(nsIWebProgress* aWebProgress,
|
||||||
NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_STATUS,
|
NOTIFY_LISTENERS(nsIWebProgress::NOTIFY_STATUS,
|
||||||
listener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
|
listener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pass the notification up to the parent...
|
// Pass the notification up to the parent...
|
||||||
if (mParent) {
|
if (mParent) {
|
||||||
mParent->FireOnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
|
mParent->FireOnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
|
||||||
|
|
@ -1444,9 +1444,9 @@ NS_IMETHODIMP nsDocLoader::OnSecurityChange(nsISupports * aContext,
|
||||||
uint32_t aState)
|
uint32_t aState)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Fire progress notifications out to any registered nsIWebProgressListeners.
|
// Fire progress notifications out to any registered nsIWebProgressListeners.
|
||||||
//
|
//
|
||||||
|
|
||||||
nsCOMPtr<nsIRequest> request = do_QueryInterface(aContext);
|
nsCOMPtr<nsIRequest> request = do_QueryInterface(aContext);
|
||||||
nsIWebProgress* webProgress = static_cast<nsIWebProgress*>(this);
|
nsIWebProgress* webProgress = static_cast<nsIWebProgress*>(this);
|
||||||
|
|
||||||
|
|
@ -1467,7 +1467,7 @@ NS_IMETHODIMP nsDocLoader::OnSecurityChange(nsISupports * aContext,
|
||||||
* The priority of the DocLoader _is_ the priority of its LoadGroup.
|
* The priority of the DocLoader _is_ the priority of its LoadGroup.
|
||||||
*
|
*
|
||||||
* XXX(darin): Once we start storing loadgroups in loadgroups, this code will
|
* XXX(darin): Once we start storing loadgroups in loadgroups, this code will
|
||||||
* go away.
|
* go away.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocLoader::GetPriority(int32_t *aPriority)
|
NS_IMETHODIMP nsDocLoader::GetPriority(int32_t *aPriority)
|
||||||
|
|
@ -1482,7 +1482,7 @@ NS_IMETHODIMP nsDocLoader::GetPriority(int32_t *aPriority)
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocLoader::SetPriority(int32_t aPriority)
|
NS_IMETHODIMP nsDocLoader::SetPriority(int32_t aPriority)
|
||||||
{
|
{
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: SetPriority(%d) called\n", this, aPriority));
|
("DocLoader:%p: SetPriority(%d) called\n", this, aPriority));
|
||||||
|
|
||||||
nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(mLoadGroup);
|
nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(mLoadGroup);
|
||||||
|
|
@ -1497,7 +1497,7 @@ NS_IMETHODIMP nsDocLoader::SetPriority(int32_t aPriority)
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocLoader::AdjustPriority(int32_t aDelta)
|
NS_IMETHODIMP nsDocLoader::AdjustPriority(int32_t aDelta)
|
||||||
{
|
{
|
||||||
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
|
||||||
("DocLoader:%p: AdjustPriority(%d) called\n", this, aDelta));
|
("DocLoader:%p: AdjustPriority(%d) called\n", this, aDelta));
|
||||||
|
|
||||||
nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(mLoadGroup);
|
nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(mLoadGroup);
|
||||||
|
|
@ -1520,7 +1520,7 @@ void nsDocLoader::DumpChannelInfo()
|
||||||
int32_t i, count;
|
int32_t i, count;
|
||||||
int32_t current=0, max=0;
|
int32_t current=0, max=0;
|
||||||
|
|
||||||
|
|
||||||
printf("==== DocLoader=%x\n", this);
|
printf("==== DocLoader=%x\n", this);
|
||||||
|
|
||||||
count = mChannelInfoList.Count();
|
count = mChannelInfoList.Count();
|
||||||
|
|
@ -1535,7 +1535,7 @@ void nsDocLoader::DumpChannelInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" [%d] current=%d max=%d [%s]\n", i,
|
printf(" [%d] current=%d max=%d [%s]\n", i,
|
||||||
info->mCurrentProgress,
|
info->mCurrentProgress,
|
||||||
info->mMaxProgress, buffer.get());
|
info->mMaxProgress, buffer.get());
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef nsDocLoader_h__
|
#ifndef nsDocLoader_h__
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
{0x93, 0xb6, 0x6d, 0x23, 0x06, 0x9c, 0x06, 0xf2} \
|
{0x93, 0xb6, 0x6d, 0x23, 0x06, 0x9c, 0x06, 0xf2} \
|
||||||
}
|
}
|
||||||
|
|
||||||
class nsDocLoader : public nsIDocumentLoader,
|
class nsDocLoader : public nsIDocumentLoader,
|
||||||
public nsIRequestObserver,
|
public nsIRequestObserver,
|
||||||
public nsSupportsWeakReference,
|
public nsSupportsWeakReference,
|
||||||
public nsIProgressEventSink,
|
public nsIProgressEventSink,
|
||||||
|
|
@ -71,7 +71,7 @@ public:
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
NS_DECL_NSIDOCUMENTLOADER
|
NS_DECL_NSIDOCUMENTLOADER
|
||||||
|
|
||||||
// nsIProgressEventSink
|
// nsIProgressEventSink
|
||||||
NS_DECL_NSIPROGRESSEVENTSINK
|
NS_DECL_NSIPROGRESSEVENTSINK
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ public:
|
||||||
nsDocLoader* GetParent() const { return mParent; }
|
nsDocLoader* GetParent() const { return mParent; }
|
||||||
|
|
||||||
struct nsListenerInfo {
|
struct nsListenerInfo {
|
||||||
nsListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask)
|
nsListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask)
|
||||||
: mWeakListener(aListener),
|
: mWeakListener(aListener),
|
||||||
mNotifyMask(aNotifyMask)
|
mNotifyMask(aNotifyMask)
|
||||||
{
|
{
|
||||||
|
|
@ -199,7 +199,7 @@ protected:
|
||||||
void ChildDoneWithOnload(nsIDocumentLoader* aChild) {
|
void ChildDoneWithOnload(nsIDocumentLoader* aChild) {
|
||||||
mChildrenInOnload.RemoveObject(aChild);
|
mChildrenInOnload.RemoveObject(aChild);
|
||||||
DocLoaderIsEmpty(true);
|
DocLoaderIsEmpty(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct nsStatusInfo : public mozilla::LinkedListElement<nsStatusInfo>
|
struct nsStatusInfo : public mozilla::LinkedListElement<nsStatusInfo>
|
||||||
|
|
@ -255,7 +255,7 @@ protected:
|
||||||
// for owning pointers and raw COM interface pointers for weak
|
// for owning pointers and raw COM interface pointers for weak
|
||||||
// (ie, non owning) references. If you add any members to this
|
// (ie, non owning) references. If you add any members to this
|
||||||
// class, please make the ownership explicit (pinkerton, scc).
|
// class, please make the ownership explicit (pinkerton, scc).
|
||||||
|
|
||||||
nsCOMPtr<nsIRequest> mDocumentRequest; // [OWNER] ???compare with document
|
nsCOMPtr<nsIRequest> mDocumentRequest; // [OWNER] ???compare with document
|
||||||
|
|
||||||
nsDocLoader* mParent; // [WEAK]
|
nsDocLoader* mParent; // [WEAK]
|
||||||
|
|
@ -267,7 +267,7 @@ protected:
|
||||||
// We hold weak refs to all our kids
|
// We hold weak refs to all our kids
|
||||||
nsTObserverArray<nsDocLoader*> mChildList;
|
nsTObserverArray<nsDocLoader*> mChildList;
|
||||||
|
|
||||||
// The following member variables are related to the new nsIWebProgress
|
// The following member variables are related to the new nsIWebProgress
|
||||||
// feedback interfaces that travis cooked up.
|
// feedback interfaces that travis cooked up.
|
||||||
int32_t mProgressStateFlags;
|
int32_t mProgressStateFlags;
|
||||||
|
|
||||||
|
|
@ -308,7 +308,7 @@ private:
|
||||||
// DocLoaderIsEmpty calls (those coming from requests finishing in our
|
// DocLoaderIsEmpty calls (those coming from requests finishing in our
|
||||||
// loadgroup) unless this is empty.
|
// loadgroup) unless this is empty.
|
||||||
nsCOMArray<nsIDocumentLoader> mChildrenInOnload;
|
nsCOMArray<nsIDocumentLoader> mChildrenInOnload;
|
||||||
|
|
||||||
// DocLoaderIsEmpty should be called whenever the docloader may be empty.
|
// DocLoaderIsEmpty should be called whenever the docloader may be empty.
|
||||||
// This method is idempotent and does nothing if the docloader is not in
|
// This method is idempotent and does nothing if the docloader is not in
|
||||||
// fact empty. This method _does_ make sure that layout is flushed if our
|
// fact empty. This method _does_ make sure that layout is flushed if our
|
||||||
|
|
@ -329,7 +329,7 @@ private:
|
||||||
/// void DumpChannelInfo(void);
|
/// void DumpChannelInfo(void);
|
||||||
|
|
||||||
// used to clear our internal progress state between loads...
|
// used to clear our internal progress state between loads...
|
||||||
void ClearInternalProgress();
|
void ClearInternalProgress();
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsDocLoader, NS_THIS_DOCLOADER_IMPL_CID)
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsDocLoader, NS_THIS_DOCLOADER_IMPL_CID)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue