I have DocumentLoadListener working for the file:/// URL case, but I'm
running into the following problem with the LoadFromStream case.  

The problem is that nsLoadGroup.mForegroundCount never goes to zero in
the Stream case.  I've illustrated the incrementing and decrementing
of
mForegroundCount in the file:/// URL case (case 1) and the
LoadFromStream case (case 2).  Can anyone give any clues about this?

Case 1: Load a file:/// URL

  mForegroundCount == 0

  mForegroundCount += 1 when

    nsLoadGroup::AddRequest() line 607
    nsFileChannel::AsyncOpen() line 506
    nsDocumentOpenInfo::Open() line 221 + 18 bytes
    nsURILoader::OpenURI() line 791 + 19 bytes
    nsDocShell::DoChannelLoad() line 5662 + 39 bytes
    nsDocShell::DoURILoad() line 5435 + 38 bytes
    nsDocShell::InternalLoad() line 5225 + 55 bytes
    nsDocShell::LoadURI() line 734 + 82 bytes
    nsDocShell::LoadURI() line 2478 + 38 bytes
    nsWebBrowser::LoadURI() line 668
    Java_org_mozilla_webclient_impl_wrapper_1native_NavigationImpl_nativeLoadURL()
line 81 + 38 bytes

  mForegroundCount == 1

  mForegroundCount += 1 when

    nsLoadGroup::AddRequest() line 607
    HTMLContentSink::AddDummyParserRequest() line 4718 + 40 bytes
    HTMLContentSink::WillBuildModel() line 2300 + 11 bytes
    CNavDTD::WillBuildModel() line 398 + 12 bytes
    nsParser::WillBuildModel() line 1227 + 62 bytes
    nsParser::ResumeParse() line 1732 + 23 bytes
    nsParser::OnDataAvailable() line 2426 + 21 bytes
    nsDocumentOpenInfo::OnDataAvailable() line 308 + 46 bytes
    nsFileChannel::OnDataAvailable() line 595
    nsInputStreamPump::OnStateTransfer() line 433 + 65 bytes
    nsInputStreamPump::OnInputStreamReady() line 336 + 11 bytes
    nsInputStreamReadyEvent::EventHandler() line 117
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_TimerProc() line 977 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e120d5()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  mForegroundCount == 2

  mForegroundCount += 1 when

    nsLoadGroup::AddRequest() line 607
    PresShell::AddDummyLayoutRequest() line 6704 + 40 bytes
    PresShell::ReflowCommandAdded() line 6659
    PresShell::AppendReflowCommand() line 3770
    nsFrame::CreateAndPostReflowCommand() line 4590
    nsBlockFrame::ReflowDirtyChild() line 5830 + 21 bytes
    nsBlockFrame::AppendFrames() line 4506
    FrameManager::AppendFrames() line 935
    nsCSSFrameConstructor::AppendFrames() line 7565 + 22 bytes
    nsCSSFrameConstructor::ContentAppended() line 8393
    StyleSetImpl::ContentAppended() line 1629
    PresShell::ContentAppended() line 5316 + 36 bytes
    nsDocument::ContentAppended() line 1863
    nsHTMLDocument::ContentAppended() line 1365
    HTMLContentSink::NotifyAppend() line 4240
    SinkContext::FlushTags() line 1870
    SinkContext::DidAddContent() line 1257
    SinkContext::FlushText() line 1966
    SinkContext::FlushTags() line 1817
    HTMLContentSink::WillInterrupt() line 2506 + 16 bytes
    CNavDTD::WillInterruptParse() line 3929 + 18 bytes
    nsParser::ResumeParse() line 1852
    nsParser::OnDataAvailable() line 2426 + 21 bytes
    nsDocumentOpenInfo::OnDataAvailable() line 308 + 46 bytes
    nsFileChannel::OnDataAvailable() line 595
    nsInputStreamPump::OnStateTransfer() line 433 + 65 bytes
    nsInputStreamPump::OnInputStreamReady() line 336 + 11 bytes
    nsInputStreamReadyEvent::EventHandler() line 117
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_TimerProc() line 977 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e120d5()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  mForegroundCount == 3

  mForegroundCount -= 1 when

    nsLoadGroup::RemoveRequest() line 687
    HTMLContentSink::RemoveDummyParserRequest() line 4735 + 42 bytes
    HTMLContentSink::DidBuildModel() line 2440
    CNavDTD::DidBuildModel() line 705
    nsParser::DidBuildModel() line 1245 + 46 bytes
    nsParser::ResumeParse() line 1820
    nsParser::OnStopRequest() line 2472 + 21 bytes
    nsDocumentOpenInfo::OnStopRequest() line 326
    nsFileChannel::OnStopRequest() line 578
    nsInputStreamPump::OnStateStop() line 499
    nsInputStreamPump::OnInputStreamReady() line 339 + 11 bytes
    nsInputStreamReadyEvent::EventHandler() line 117
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_TimerProc() line 977 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e120d5()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  mForegroundCount == 2

  mForegroundCount -= 1 when

    nsLoadGroup::RemoveRequest() line 687
    nsFileChannel::OnStopRequest() line 584
    nsInputStreamPump::OnStateStop() line 499
    nsInputStreamPump::OnInputStreamReady() line 339 + 11 bytes
    nsInputStreamReadyEvent::EventHandler() line 117
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_TimerProc() line 977 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e120d5()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  mForegroundCount == 1

  mForegroundCount -= 1 when

    nsLoadGroup::RemoveRequest() line 687
    PresShell::RemoveDummyLayoutRequest() line 6725 + 42 bytes
    PresShell::DoneRemovingReflowCommands() line 6686
    PresShell::ProcessReflowCommands() line 6546
    ReflowEvent::HandleEvent() line 6321
    HandlePLEvent() line 6335
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_EventReceiverProc() line 1412 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e120d5()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  NOW mForegroundCount == 0.  This ultimately causes the
  END_DOCUMENT_LOAD event to be sent to my nsIWebProgressListener.

Case 2: nsDocShell->LoadStream()

  mForegroundCount == 0

  mForegroundCount += 1 when

    nsLoadGroup::AddRequest() line 607
    nsDocShell::CreateContentViewer() line 4527
    nsDSURIContentListener::DoContent() line 109 + 33 bytes
    nsDocumentOpenInfo::TryContentListener() line 673 + 70 bytes
    nsDocumentOpenInfo::DispatchContent() line 413 + 57 bytes
    nsDocumentOpenInfo::OnStartRequest() line 287 + 16 bytes
    nsInputStreamChannel::OnStartRequest() line 356
    nsInputStreamPump::OnStateStart() line 377 + 42 bytes
    nsInputStreamPump::OnInputStreamReady() line 333 + 11 bytes
    nsInputStreamReadyEvent::EventHandler() line 117
    PL_HandleEvent() line 671 + 10 bytes
    NativeWrapperFactory::ProcessEventLoop() line 205 + 9 bytes
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvent()
line 133

  mForegroundCount == 1

  mForegroundCount += 1 when

    nsLoadGroup::AddRequest() line 607
    HTMLContentSink::AddDummyParserRequest() line 4718 + 40 bytes
    HTMLContentSink::WillBuildModel() line 2300 + 11 bytes
    CNavDTD::WillBuildModel() line 398 + 12 bytes
    nsParser::WillBuildModel() line 1227 + 62 bytes
    nsParser::ResumeParse() line 1732 + 23 bytes
    nsParser::OnDataAvailable() line 2426 + 21 bytes
    nsDocumentOpenInfo::OnDataAvailable() line 308 + 46 bytes
    nsInputStreamChannel::OnDataAvailable() line 383 + 57 bytes
    nsInputStreamPump::OnStateTransfer() line 433 + 65 bytes
    nsInputStreamPump::OnInputStreamReady() line 336 + 11 bytes
    nsInputStreamReadyEvent::EventHandler() line 117
    PL_HandleEvent() line 671 + 10 bytes
    NativeWrapperFactory::ProcessEventLoop() line 205 + 9 bytes
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  NOW, we go into an infinite loop of adding the dummy request then
  removing it.

  mForegroundCount == 2

  mForegroundCount += 1 when

    nsLoadGroup::AddRequest() line 607
    PresShell::AddDummyLayoutRequest() line 6704 + 40 bytes
    PresShell::ReflowCommandAdded() line 6659
    PresShell::AppendReflowCommand() line 3770
    nsFrame::CreateAndPostReflowCommand() line 4590
    nsBlockFrame::ReflowDirtyChild() line 5830 + 21 bytes
    nsBlockFrame::AppendFrames() line 4506
    FrameManager::AppendFrames() line 935
    nsCSSFrameConstructor::AppendFrames() line 7565 + 22 bytes
    nsCSSFrameConstructor::ContentAppended() line 8393
    StyleSetImpl::ContentAppended() line 1629
    PresShell::ContentAppended() line 5316 + 36 bytes
    nsDocument::ContentAppended() line 1863
    nsHTMLDocument::ContentAppended() line 1365
    HTMLContentSink::NotifyAppend() line 4240
    SinkContext::FlushTags() line 1870
    SinkContext::DidAddContent() line 1257
    SinkContext::FlushText() line 1966
    SinkContext::FlushTags() line 1817
    HTMLContentSink::Notify() line 2475
    nsTimerImpl::Fire() line 386
    handleTimerEvent() line 449
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_TimerProc() line 977 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e120d5()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  mForegroundCount == 3

  mForegroundCount -= 1 when

    nsLoadGroup::RemoveRequest() line 687
    PresShell::RemoveDummyLayoutRequest() line 6725 + 42 bytes
    PresShell::DoneRemovingReflowCommands() line 6686
    PresShell::ProcessReflowCommands() line 6546
    ReflowEvent::HandleEvent() line 6321
    HandlePLEvent() line 6335
    PL_HandleEvent() line 671 + 10 bytes
    PL_ProcessPendingEvents() line 606 + 9 bytes
    _md_EventReceiverProc() line 1412 + 9 bytes
    USER32! 77e11ef0()
    USER32! 77e1204c()
    USER32! 77e15f69()
    
Java_org_mozilla_webclient_impl_wrapper_1native_NativeEventThread_nativeProcessEvents()
line 133

  Also, the 

    nsLoadGroup::RemoveRequest() line 687
    nsFileChannel::OnStopRequest() line 584
    nsInputStreamPump::OnStateStop() line 499
    nsInputStreamPump::OnInputStreamReady() line 339 + 11 bytes

  scenario never happens for the LoadFromStream case, even though the
  nsIInputStream does indeed close.

Thanks,

Ed
_______________________________________________
mozilla-embedding mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to