Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 24395004: Merge 157914 "Prevent crash due to XMLDocumentParser destruction" (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1599/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2008 Holger Hans Peter Freyther 7 * Copyright (C) 2008 Holger Hans Peter Freyther
8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 m_originalSourceForTransform.append(source); 342 m_originalSourceForTransform.append(source);
343 343
344 if (isStopped() || m_sawXSLTransform) 344 if (isStopped() || m_sawXSLTransform)
345 return; 345 return;
346 346
347 if (m_parserPaused) { 347 if (m_parserPaused) {
348 m_pendingSrc.append(source); 348 m_pendingSrc.append(source);
349 return; 349 return;
350 } 350 }
351 351
352 // JavaScript can detach the parser. Make sure this is not released
353 // before the end of this method.
354 RefPtr<XMLDocumentParser> protect(this);
355
352 doWrite(source.toString()); 356 doWrite(source.toString());
353 357
354 if (isStopped()) 358 if (isStopped())
355 return; 359 return;
356 360
357 if (document()->frame() && document()->frame()->script()->canExecuteScripts( NotAboutToExecuteScript)) 361 if (document()->frame() && document()->frame()->script()->canExecuteScripts( NotAboutToExecuteScript))
358 ImageLoader::dispatchPendingBeforeLoadEvents(); 362 ImageLoader::dispatchPendingBeforeLoadEvents();
359 } 363 }
360 364
361 void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* forma ttedMessage, TextPosition position) 365 void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* forma ttedMessage, TextPosition position)
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 sax.initialized = XML_SAX2_MAGIC; 1620 sax.initialized = XML_SAX2_MAGIC;
1617 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1621 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1618 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1622 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1619 parseChunk(parser->context(), parseString); 1623 parseChunk(parser->context(), parseString);
1620 finishParsing(parser->context()); 1624 finishParsing(parser->context());
1621 attrsOK = state.gotAttributes; 1625 attrsOK = state.gotAttributes;
1622 return state.attributes; 1626 return state.attributes;
1623 } 1627 }
1624 1628
1625 } // namespace WebCore 1629 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698