Title: [139382] branches/chromium/1364/Source/WebCore

Diff

Modified: branches/chromium/1364/Source/WebCore/dom/Document.cpp (139381 => 139382)


--- branches/chromium/1364/Source/WebCore/dom/Document.cpp	2013-01-10 23:40:13 UTC (rev 139381)
+++ branches/chromium/1364/Source/WebCore/dom/Document.cpp	2013-01-10 23:41:14 UTC (rev 139382)
@@ -2356,8 +2356,8 @@
 
 void Document::explicitClose()
 {
-    if (m_parser)
-        m_parser->finish();
+    if (RefPtr<DocumentParser> parser = m_parser)
+        parser->finish();
 
     if (!m_frame) {
         // Because we have no frame, we don't know if all loading has completed,

Modified: branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParser.cpp (139381 => 139382)


--- branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParser.cpp	2013-01-10 23:40:13 UTC (rev 139381)
+++ branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParser.cpp	2013-01-10 23:41:14 UTC (rev 139382)
@@ -194,6 +194,11 @@
 
     doEnd();
 
+    // doEnd() call above can detach the parser and null out its document.
+    // In that case, we just bail out.
+    if (isDetached())
+        return;
+
     // doEnd() could process a script tag, thus pausing parsing.
     if (m_parserPaused)
         return;

Modified: branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (139381 => 139382)


--- branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2013-01-10 23:40:13 UTC (rev 139381)
+++ branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2013-01-10 23:41:14 UTC (rev 139382)
@@ -1338,8 +1338,13 @@
 
         document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
         document()->styleResolverChanged(RecalcStyleImmediately);
+
+        // styleResolverChanged() call can detach the parser and null out its document.
+        // In that case, we just bail out.
+        if (isDetached())
+            return;
+
         document()->setParsing(true);
-
         DocumentParser::stopParsing();
     }
 #endif

Modified: branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp (139381 => 139382)


--- branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp	2013-01-10 23:40:13 UTC (rev 139381)
+++ branches/chromium/1364/Source/WebCore/xml/parser/XMLDocumentParserQt.cpp	2013-01-10 23:41:14 UTC (rev 139382)
@@ -204,6 +204,12 @@
         document()->setTransformSource(adoptPtr(new TransformSource(m_originalSourceForTransform.toString())));
         document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
         document()->styleResolverChanged(RecalcStyleImmediately);
+
+        // styleResolverChanged() call can detach the parser and null out its document.
+        // In that case, we just bail out.
+        if (isDetached())
+            return;
+
         document()->setParsing(true);
         DocumentParser::stopParsing();
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to