Bug 943519 - Handle errors returned from calls to Perform. r=hsivonen
☠☠ backed out by b2c07abf977a ☠ ☠
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Mon, 16 Dec 2013 09:01:30 -0500
changeset 160591 b9c5750d818a3f3497eee00124c3c9be71c4014b
parent 160590 41fc2afc8465601b520197ef6f7a8f17c16d6b8f
child 160592 01de929d4b858b78f85ff666239041eeedfa9afe
push id37650
push userryanvm@gmail.com
push dateMon, 16 Dec 2013 14:01:31 +0000
treeherdermozilla-inbound@bac23ed0f7f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs943519
milestone29.0a1
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 943519 - Handle errors returned from calls to Perform. r=hsivonen
parser/html/nsHtml5TreeOpExecutor.cpp
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -515,17 +515,21 @@ nsHtml5TreeOpExecutor::RunFlushLoop()
     const nsHtml5TreeOperation* last = first + numberOfOpsToFlush - 1;
     for (nsHtml5TreeOperation* iter = const_cast<nsHtml5TreeOperation*>(first);;) {
       if (MOZ_UNLIKELY(!mParser)) {
         // The previous tree op caused a call to nsIParser::Terminate().
         break;
       }
       NS_ASSERTION(mFlushState == eInDocUpdate, 
         "Tried to perform tree op outside update batch.");
-      iter->Perform(this, &scriptElement);
+      nsresult rv = iter->Perform(this, &scriptElement);
+      if (NS_FAILED(rv)) {
+        MarkAsBroken(rv);
+        break;
+      }
 
       // Be sure not to check the deadline if the last op was just performed.
       if (MOZ_UNLIKELY(iter == last)) {
         break;
       } else if (MOZ_UNLIKELY(nsContentSink::DidProcessATokenImpl() == 
                  NS_ERROR_HTMLPARSER_INTERRUPTED)) {
         mOpQueue.RemoveElementsAt(0, (iter - first) + 1);
         
@@ -617,17 +621,21 @@ nsHtml5TreeOpExecutor::FlushDocumentWrit
        iter < end;
        ++iter) {
     if (MOZ_UNLIKELY(!mParser)) {
       // The previous tree op caused a call to nsIParser::Terminate().
       break;
     }
     NS_ASSERTION(mFlushState == eInDocUpdate, 
       "Tried to perform tree op outside update batch.");
-    iter->Perform(this, &scriptElement);
+    nsresult rv = iter->Perform(this, &scriptElement);
+    if (NS_FAILED(rv)) {
+      MarkAsBroken(rv);
+      break;
+    }
   }
 
   mOpQueue.Clear();
   
   EndDocUpdate();
 
   mFlushState = eNotFlushing;