| Index: Source/platform/mhtml/MHTMLParser.cpp
|
| diff --git a/Source/platform/mhtml/MHTMLParser.cpp b/Source/platform/mhtml/MHTMLParser.cpp
|
| index 36ad5b50f47a4948bc390fbe915c96e7e217ead3..d3158f4ea53e93f8ac1ee9fff300ef1a36696d7e 100644
|
| --- a/Source/platform/mhtml/MHTMLParser.cpp
|
| +++ b/Source/platform/mhtml/MHTMLParser.cpp
|
| @@ -138,7 +138,7 @@ PassRefPtr<MIMEHeader> MIMEHeader::parseHeader(SharedBufferChunkReader* buffer)
|
| mimeHeader->m_endOfPartBoundary = parsedContentType.parameterValueForName("boundary");
|
| if (mimeHeader->m_endOfPartBoundary.isNull()) {
|
| WTF_LOG_ERROR("No boundary found in multipart MIME header.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| mimeHeader->m_endOfPartBoundary.insert("--", 0);
|
| mimeHeader->m_endOfDocumentBoundary = mimeHeader->m_endOfPartBoundary;
|
| @@ -204,7 +204,7 @@ PassRefPtr<MHTMLArchive> MHTMLParser::parseArchiveWithHeader(MIMEHeader* header)
|
| {
|
| if (!header) {
|
| WTF_LOG_ERROR("Failed to parse MHTML part: no header.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
|
|
| RefPtr<MHTMLArchive> archive = MHTMLArchive::create();
|
| @@ -213,7 +213,7 @@ PassRefPtr<MHTMLArchive> MHTMLParser::parseArchiveWithHeader(MIMEHeader* header)
|
| bool endOfArchiveReached = false;
|
| RefPtr<ArchiveResource> resource = parseNextPart(*header, String(), String(), endOfArchiveReached);
|
| if (!resource)
|
| - return 0;
|
| + return nullptr;
|
| archive->setMainResource(resource);
|
| return archive;
|
| }
|
| @@ -226,14 +226,14 @@ PassRefPtr<MHTMLArchive> MHTMLParser::parseArchiveWithHeader(MIMEHeader* header)
|
| RefPtr<MIMEHeader> resourceHeader = MIMEHeader::parseHeader(&m_lineReader);
|
| if (!resourceHeader) {
|
| WTF_LOG_ERROR("Failed to parse MHTML, invalid MIME header.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| if (resourceHeader->contentType() == "multipart/alternative") {
|
| // Ignore IE nesting which makes little sense (IE seems to nest only some of the frames).
|
| RefPtr<MHTMLArchive> subframeArchive = parseArchiveWithHeader(resourceHeader.get());
|
| if (!subframeArchive) {
|
| WTF_LOG_ERROR("Failed to parse MHTML subframe.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| bool endOfPartReached = skipLinesUntilBoundaryFound(m_lineReader, header->endOfPartBoundary());
|
| ASSERT_UNUSED(endOfPartReached, endOfPartReached);
|
| @@ -247,7 +247,7 @@ PassRefPtr<MHTMLArchive> MHTMLParser::parseArchiveWithHeader(MIMEHeader* header)
|
| RefPtr<ArchiveResource> resource = parseNextPart(*resourceHeader, header->endOfPartBoundary(), header->endOfDocumentBoundary(), endOfArchive);
|
| if (!resource) {
|
| WTF_LOG_ERROR("Failed to parse MHTML part.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| addResourceToArchive(resource.get(), archive.get());
|
| }
|
| @@ -290,20 +290,20 @@ PassRefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHea
|
| if (contentTransferEncoding == MIMEHeader::Binary) {
|
| if (!checkBoundary) {
|
| WTF_LOG_ERROR("Binary contents requires end of part");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| m_lineReader.setSeparator(endOfPartBoundary.utf8().data());
|
| Vector<char> part;
|
| if (!m_lineReader.nextChunk(part)) {
|
| WTF_LOG_ERROR("Binary contents requires end of part");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| content->append(part);
|
| m_lineReader.setSeparator("\r\n");
|
| Vector<char> nextChars;
|
| if (m_lineReader.peek(nextChars, 2) != 2) {
|
| WTF_LOG_ERROR("Invalid seperator.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| endOfPartReached = true;
|
| ASSERT(nextChars.size() == 2);
|
| @@ -312,7 +312,7 @@ PassRefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHea
|
| String line = m_lineReader.nextChunkAsUTF8StringWithLatin1Fallback();
|
| if (!line.isEmpty()) {
|
| WTF_LOG_ERROR("No CRLF at end of binary section.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| }
|
| } else {
|
| @@ -333,7 +333,7 @@ PassRefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHea
|
| }
|
| if (!endOfPartReached && checkBoundary) {
|
| WTF_LOG_ERROR("No bounday found for MHTML part.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
|
|
| Vector<char> data;
|
| @@ -341,7 +341,7 @@ PassRefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHea
|
| case MIMEHeader::Base64:
|
| if (!base64Decode(content->data(), content->size(), data)) {
|
| WTF_LOG_ERROR("Invalid base64 content for MHTML part.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| break;
|
| case MIMEHeader::QuotedPrintable:
|
| @@ -354,7 +354,7 @@ PassRefPtr<ArchiveResource> MHTMLParser::parseNextPart(const MIMEHeader& mimeHea
|
| break;
|
| default:
|
| WTF_LOG_ERROR("Invalid encoding for MHTML part.");
|
| - return 0;
|
| + return nullptr;
|
| }
|
| RefPtr<SharedBuffer> contentBuffer = SharedBuffer::adoptVector(data);
|
| // FIXME: the URL in the MIME header could be relative, we should resolve it if it is.
|
|
|