Bug 599497: Notify the SVG-as-image helper doc's parser of stop request before calling ContinueInterruptedParsing, to keep it from hanging when there's no data left. r=jst a=blocking-beta-7
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sat, 25 Sep 2010 10:51:37 -0700
changeset 54654 ec28605a1fc8e10e1b74a1d2243e4af3e2bb42b4
parent 54653 71e8b5aee972e1cd17226463be7a31b71dc50774
child 54655 2370ecfdcbb7b152ef000e21d10ff6e43109fb90
push idunknown
push userunknown
push dateunknown
reviewersjst, blocking-beta-7
bugs599497
milestone2.0b7pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 599497: Notify the SVG-as-image helper doc's parser of stop request before calling ContinueInterruptedParsing, to keep it from hanging when there's no data left. r=jst a=blocking-beta-7
modules/libpr0n/src/SVGDocumentWrapper.cpp
--- a/modules/libpr0n/src/SVGDocumentWrapper.cpp
+++ b/modules/libpr0n/src/SVGDocumentWrapper.cpp
@@ -261,25 +261,27 @@ SVGDocumentWrapper::OnStartRequest(nsIRe
 
 /* void onStopRequest (in nsIRequest request, in nsISupports ctxt,
                        in nsresult status); */
 NS_IMETHODIMP
 SVGDocumentWrapper::OnStopRequest(nsIRequest* aRequest, nsISupports* ctxt,
                                   nsresult status)
 {
   if (mListener) {
+    mListener->OnStopRequest(aRequest, ctxt, status);
     // A few levels up the stack, imgRequest::OnStopRequest is about to tell
     // all of its observers that we know our size and are ready to paint.  That
     // might not be true at this point, though -- so here, we synchronously
     // finish parsing & layout in our helper-document to make sure we can hold
     // up to this promise.
     nsCOMPtr<nsIParser> parser = do_QueryInterface(mListener);
-    parser->ContinueInterruptedParsing();
+    if (!parser->IsComplete()) {
+      parser->ContinueInterruptedParsing();
+    }
     FlushLayout();
-    mListener->OnStopRequest(aRequest, ctxt, status);
     mListener = nsnull;
 
     // In a normal document, this would be called by nsDocShell - but we don't
     // have a nsDocShell. So we do it ourselves. (If we don't, painting will
     // stay suppressed for a little while longer, for no good reason).
     mViewer->LoadComplete(NS_OK);
   }