| Index: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
|
| diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
|
| index aea42d3f11ea30db1395894dddab9ddc66dbbd1d..bdf9ccefdcaf326d0b21494ee72577c41b3f322b 100644
|
| --- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
|
| +++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
|
| @@ -311,8 +311,8 @@ private:
|
|
|
| void XMLDocumentParser::pushCurrentNode(ContainerNode* n)
|
| {
|
| - ASSERT(n);
|
| - ASSERT(m_currentNode);
|
| + DCHECK(n);
|
| + DCHECK(m_currentNode);
|
| m_currentNodeStack.append(m_currentNode);
|
| m_currentNode = n;
|
| if (m_currentNodeStack.size() > maxXMLTreeDepth)
|
| @@ -323,7 +323,7 @@ void XMLDocumentParser::popCurrentNode()
|
| {
|
| if (!m_currentNode)
|
| return;
|
| - ASSERT(m_currentNodeStack.size());
|
| + DCHECK(m_currentNodeStack.size());
|
| m_currentNode = m_currentNodeStack.last();
|
| m_currentNodeStack.removeLast();
|
| }
|
| @@ -340,7 +340,7 @@ void XMLDocumentParser::clearCurrentNodeStack()
|
|
|
| void XMLDocumentParser::insert(const SegmentedString&)
|
| {
|
| - ASSERT_NOT_REACHED();
|
| + NOTREACHED();
|
| }
|
|
|
| void XMLDocumentParser::append(const String& inputSource)
|
| @@ -374,7 +374,7 @@ void XMLDocumentParser::createLeafTextNodeIfNeeded()
|
| if (m_leafTextNode)
|
| return;
|
|
|
| - ASSERT(m_bufferedText.size() == 0);
|
| + DCHECK_EQ(m_bufferedText.size(), 0u);
|
| m_leafTextNode = Text::create(m_currentNode->document(), "");
|
| m_currentNode->parserAppendChild(m_leafTextNode.get());
|
| }
|
| @@ -411,7 +411,7 @@ void XMLDocumentParser::end()
|
| TRACE_EVENT0("blink", "XMLDocumentParser::end");
|
| // XMLDocumentParserLibxml2 will do bad things to the document if doEnd() is called.
|
| // I don't believe XMLDocumentParserQt needs doEnd called in the fragment case.
|
| - ASSERT(!m_parsingFragment);
|
| + DCHECK(!m_parsingFragment);
|
|
|
| doEnd();
|
|
|
| @@ -438,7 +438,7 @@ void XMLDocumentParser::end()
|
|
|
| void XMLDocumentParser::finish()
|
| {
|
| - // FIXME: We should ASSERT(!m_parserStopped) here, since it does not
|
| + // FIXME: We should DCHECK(!m_parserStopped) here, since it does not
|
| // makes sense to call any methods on DocumentParser once it's been stopped.
|
| // However, FrameLoader::stop calls DocumentParser::finish unconditionally.
|
|
|
| @@ -459,7 +459,7 @@ void XMLDocumentParser::insertErrorMessageBlock()
|
|
|
| void XMLDocumentParser::notifyFinished(Resource* unusedResource)
|
| {
|
| - ASSERT_UNUSED(unusedResource, unusedResource == m_pendingScript);
|
| + DCHECK_EQ(unusedResource, m_pendingScript);
|
|
|
| ScriptSourceCode sourceCode(m_pendingScript.get());
|
| bool errorOccurred = m_pendingScript->errorOccurred();
|
| @@ -474,7 +474,7 @@ void XMLDocumentParser::notifyFinished(Resource* unusedResource)
|
| m_scriptElement = nullptr;
|
|
|
| ScriptLoader* scriptLoader = toScriptLoaderIfPossible(e);
|
| - ASSERT(scriptLoader);
|
| + DCHECK(scriptLoader);
|
|
|
| if (errorOccurred) {
|
| scriptLoader->dispatchErrorEvent();
|
| @@ -639,8 +639,8 @@ static bool shouldAllowExternalLoad(const KURL& url)
|
|
|
| static void* openFunc(const char* uri)
|
| {
|
| - ASSERT(XMLDocumentParserScope::currentDocument);
|
| - ASSERT(currentThread() == libxmlLoaderThread);
|
| + DCHECK(XMLDocumentParserScope::currentDocument);
|
| + DCHECK_EQ(currentThread(), libxmlLoaderThread);
|
|
|
| KURL url(KURL(), uri);
|
|
|
| @@ -850,7 +850,7 @@ XMLParserContext::~XMLParserContext()
|
|
|
| XMLDocumentParser::~XMLDocumentParser()
|
| {
|
| - ASSERT(!m_pendingScript);
|
| + DCHECK(!m_pendingScript);
|
| }
|
|
|
| DEFINE_TRACE(XMLDocumentParser)
|
| @@ -868,7 +868,7 @@ DEFINE_TRACE(XMLDocumentParser)
|
| void XMLDocumentParser::doWrite(const String& parseString)
|
| {
|
| TRACE_EVENT0("blink", "XMLDocumentParser::doWrite");
|
| - ASSERT(!isDetached());
|
| + DCHECK(!isDetached());
|
| if (!m_context)
|
| initializeParserContext();
|
|
|
| @@ -1087,7 +1087,7 @@ void XMLDocumentParser::endElementNs()
|
| }
|
|
|
| // Don't load external scripts for standalone documents (for now).
|
| - ASSERT(!m_pendingScript);
|
| + DCHECK(!m_pendingScript);
|
| m_requestingScript = true;
|
|
|
| if (scriptLoader->prepareScript(m_scriptStartPosition, ScriptLoader::AllowLegacyTypeInTypeAttribute)) {
|
| @@ -1351,7 +1351,7 @@ static size_t convertUTF16EntityToUTF8(const UChar* utf16Entity, size_t numberOf
|
| return 0;
|
|
|
| // Even though we must pass the length, libxml expects the entity string to be null terminated.
|
| - ASSERT(target > originalTarget + 1);
|
| + DCHECK_GT(target, originalTarget + 1);
|
| *target = '\0';
|
| return target - originalTarget;
|
| }
|
| @@ -1363,7 +1363,7 @@ static xmlEntityPtr getXHTMLEntity(const xmlChar* name)
|
| if (!numberOfCodeUnits)
|
| return 0;
|
|
|
| - ASSERT(numberOfCodeUnits <= 4);
|
| + DCHECK_LE(numberOfCodeUnits, 4u);
|
| size_t entityLengthInUTF8 = convertUTF16EntityToUTF8(utf16DecodedEntity, numberOfCodeUnits,
|
| reinterpret_cast<char*>(sharedXHTMLEntityResult), WTF_ARRAY_LENGTH(sharedXHTMLEntityResult));
|
| if (!entityLengthInUTF8)
|
| @@ -1475,7 +1475,7 @@ void XMLDocumentParser::initializeParserContext(const CString& chunk)
|
| if (m_parsingFragment) {
|
| m_context = XMLParserContext::createMemoryParser(&sax, this, chunk);
|
| } else {
|
| - ASSERT(!chunk.data());
|
| + DCHECK(!chunk.data());
|
| m_context = XMLParserContext::createStringParser(&sax, this);
|
| }
|
| }
|
| @@ -1545,8 +1545,8 @@ void XMLDocumentParser::stopParsing()
|
|
|
| void XMLDocumentParser::resumeParsing()
|
| {
|
| - ASSERT(!isDetached());
|
| - ASSERT(m_parserPaused);
|
| + DCHECK(!isDetached());
|
| + DCHECK(m_parserPaused);
|
|
|
| m_parserPaused = false;
|
|
|
| @@ -1576,8 +1576,8 @@ void XMLDocumentParser::resumeParsing()
|
|
|
| bool XMLDocumentParser::appendFragmentSource(const String& chunk)
|
| {
|
| - ASSERT(!m_context);
|
| - ASSERT(m_parsingFragment);
|
| + DCHECK(!m_context);
|
| + DCHECK(m_parsingFragment);
|
|
|
| CString chunkAsUtf8 = chunk.utf8();
|
|
|
| @@ -1599,9 +1599,9 @@ bool XMLDocumentParser::appendFragmentSource(const String& chunk)
|
| long bytesProcessed = xmlByteConsumed(context());
|
| if (bytesProcessed == -1 || static_cast<unsigned long>(bytesProcessed) != chunkAsUtf8.length()) {
|
| // FIXME: I don't believe we can hit this case without also having seen
|
| - // an error or a null byte. If we hit this ASSERT, we've found a test
|
| + // an error or a null byte. If we hit this DCHECK, we've found a test
|
| // case which demonstrates the need for this code.
|
| - ASSERT(m_sawError || (bytesProcessed >= 0 && !chunkAsUtf8.data()[bytesProcessed]));
|
| + DCHECK(m_sawError || (bytesProcessed >= 0 && !chunkAsUtf8.data()[bytesProcessed]));
|
| return false;
|
| }
|
|
|
|
|