| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 static bool skipLinesUntilBoundaryFound(SharedBufferChunkReader& lineReader, con
st String& boundary) | 192 static bool skipLinesUntilBoundaryFound(SharedBufferChunkReader& lineReader, con
st String& boundary) |
| 193 { | 193 { |
| 194 String line; | 194 String line; |
| 195 while (!(line = lineReader.nextChunkAsUTF8StringWithLatin1Fallback()).isNull
()) { | 195 while (!(line = lineReader.nextChunkAsUTF8StringWithLatin1Fallback()).isNull
()) { |
| 196 if (line == boundary) | 196 if (line == boundary) |
| 197 return true; | 197 return true; |
| 198 } | 198 } |
| 199 return false; | 199 return false; |
| 200 } | 200 } |
| 201 | 201 |
| 202 MHTMLParser::MHTMLParser(PassRefPtr<SharedBuffer> data) | 202 MHTMLParser::MHTMLParser(PassRefPtr<const SharedBuffer> data) |
| 203 : m_lineReader(std::move(data), "\r\n") | 203 : m_lineReader(std::move(data), "\r\n") |
| 204 { | 204 { |
| 205 } | 205 } |
| 206 | 206 |
| 207 HeapVector<Member<ArchiveResource>> MHTMLParser::parseArchive() | 207 HeapVector<Member<ArchiveResource>> MHTMLParser::parseArchive() |
| 208 { | 208 { |
| 209 MIMEHeader* header = MIMEHeader::parseHeader(&m_lineReader); | 209 MIMEHeader* header = MIMEHeader::parseHeader(&m_lineReader); |
| 210 HeapVector<Member<ArchiveResource>> resources; | 210 HeapVector<Member<ArchiveResource>> resources; |
| 211 if (!parseArchiveWithHeader(header, resources)) | 211 if (!parseArchiveWithHeader(header, resources)) |
| 212 resources.clear(); | 212 resources.clear(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 if (!contentID.startsWith('<') || !contentID.endsWith('>')) | 367 if (!contentID.startsWith('<') || !contentID.endsWith('>')) |
| 368 return KURL(); | 368 return KURL(); |
| 369 | 369 |
| 370 StringBuilder uriBuilder; | 370 StringBuilder uriBuilder; |
| 371 uriBuilder.append("cid:"); | 371 uriBuilder.append("cid:"); |
| 372 uriBuilder.append(contentID, 1, contentID.length() - 2); | 372 uriBuilder.append(contentID, 1, contentID.length() - 2); |
| 373 return KURL(KURL(), uriBuilder.toString()); | 373 return KURL(KURL(), uriBuilder.toString()); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace blink | 376 } // namespace blink |
| OLD | NEW |