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

Unified Diff: Source/core/html/parser/HTMLDocumentParser.cpp

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use nullptr Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index 16358fa8ea624b9bf6cf43fc49b2b0685eccd2d9..5e89dc7c97a5cbb5cd0efdcf1bac319f77b55eb2 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -95,7 +95,7 @@ public:
if (HTMLParserThread::shared())
return &HTMLParserThread::shared()->platformThread();
- return 0;
+ return nullptr;
}
private:
@@ -435,9 +435,9 @@ void HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Parse
HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::startedChunkWithCheckpoint, m_backgroundParser, chunk->inputCheckpoint));
- for (XSSInfoStream::const_iterator it = chunk->xssInfos.begin(); it != chunk->xssInfos.end(); ++it) {
- m_textPosition = (*it)->m_textPosition;
- m_xssAuditorDelegate.didBlockScript(**it);
+ for (const auto& xssInfo : chunk->xssInfos) {
+ m_textPosition = xssInfo->m_textPosition;
+ m_xssAuditorDelegate.didBlockScript(*xssInfo);
if (isStopped())
break;
}
@@ -543,7 +543,7 @@ Document* HTMLDocumentParser::contextForParsingSession()
// The parsing session should interact with the document only when parsing
// non-fragments. Otherwise, we might delay the load event mistakenly.
if (isParsingFragment())
- return 0;
+ return nullptr;
return document();
}
@@ -716,7 +716,7 @@ void HTMLDocumentParser::startBackgroundParser()
ASSERT(!m_haveBackgroundParser);
m_haveBackgroundParser = true;
- RefPtr<WeakReference<BackgroundHTMLParser> > reference = WeakReference<BackgroundHTMLParser>::createUnbound();
+ RefPtr<WeakReference<BackgroundHTMLParser>> reference = WeakReference<BackgroundHTMLParser>::createUnbound();
m_backgroundParser = WeakPtr<BackgroundHTMLParser>(reference);
// TODO(oysteine): Disabled due to crbug.com/398076 until a full fix can be implemented.
@@ -1022,7 +1022,7 @@ void HTMLDocumentParser::appendBytes(const char* data, size_t length)
if (!m_haveBackgroundParser)
startBackgroundParser();
- OwnPtr<Vector<char> > buffer = adoptPtr(new Vector<char>(length));
+ OwnPtr<Vector<char>> buffer = adoptPtr(new Vector<char>(length));
memcpy(buffer->data(), data, length);
TRACE_EVENT1("net", "HTMLDocumentParser::appendBytes", "size", (unsigned)length);

Powered by Google App Engine
This is Rietveld 408576698