Title: [87100] branches/chromium/742/Source/WebCore/dom
- Revision
- 87100
- Author
- [email protected]
- Date
- 2011-05-23 15:11:15 -0700 (Mon, 23 May 2011)
Log Message
Merge 87098 - 2011-05-23 James Simonsen <[email protected]>
Reviewed by Adam Barth.
Convert raw pointer to RefPtr.
https://bugs.webkit.org/show_bug.cgi?id=61196
* dom/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::endElementNs):
* dom/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::parseEndElement):
BUG=83012
Review URL: http://codereview.chromium.org/7064010
Modified Paths
Diff
Modified: branches/chromium/742/Source/WebCore/dom/XMLDocumentParserLibxml2.cpp (87099 => 87100)
--- branches/chromium/742/Source/WebCore/dom/XMLDocumentParserLibxml2.cpp 2011-05-23 21:50:03 UTC (rev 87099)
+++ branches/chromium/742/Source/WebCore/dom/XMLDocumentParserLibxml2.cpp 2011-05-23 22:11:15 UTC (rev 87100)
@@ -847,12 +847,16 @@
return;
}
+ // _javascript_ can detach the parser. Make sure this is not released
+ // before the end of this method.
+ RefPtr<XMLDocumentParser> protect(this);
+
exitText();
- Node* n = m_currentNode;
+ RefPtr<ContainerNode> n = m_currentNode;
n->finishParsingChildren();
- if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode() && toScriptElement(static_cast<Element*>(n))) {
+ if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode() && toScriptElement(static_cast<Element*>(n.get()))) {
popCurrentNode();
ExceptionCode ec;
n->remove(ec);
@@ -864,7 +868,7 @@
return;
}
- Element* element = static_cast<Element*>(n);
+ Element* element = static_cast<Element*>(n.get());
// The element's parent may have already been removed from document.
// Parsing continues in this case, but scripts aren't executed.
@@ -893,10 +897,6 @@
// FIXME: Script execution should be shared between
// the libxml2 and Qt XMLDocumentParser implementations.
- // _javascript_ can detach the parser. Make sure this is not released
- // before the end of this method.
- RefPtr<XMLDocumentParser> protect(this);
-
if (scriptElement->readyToBeParserExecuted())
scriptElement->executeScript(ScriptSourceCode(scriptElement->scriptContent(), document()->url(), m_scriptStartPosition));
else if (scriptElement->willBeParserExecuted()) {
Modified: branches/chromium/742/Source/WebCore/dom/XMLDocumentParserQt.cpp (87099 => 87100)
--- branches/chromium/742/Source/WebCore/dom/XMLDocumentParserQt.cpp 2011-05-23 21:50:03 UTC (rev 87099)
+++ branches/chromium/742/Source/WebCore/dom/XMLDocumentParserQt.cpp 2011-05-23 22:11:15 UTC (rev 87100)
@@ -556,10 +556,10 @@
{
exitText();
- Node* n = m_currentNode;
+ RefPtr<ContainerNode> n = m_currentNode;
n->finishParsingChildren();
- if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode() && toScriptElement(static_cast<Element*>(n))) {
+ if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode() && toScriptElement(static_cast<Element*>(n.get()))) {
popCurrentNode();
ExceptionCode ec;
n->remove(ec);
@@ -572,7 +572,7 @@
return;
}
- Element* element = static_cast<Element*>(n);
+ Element* element = static_cast<Element*>(n.get());
// The element's parent may have already been removed from document.
// Parsing continues in this case, but scripts aren't executed.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes