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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 static bool skipLinesUntilBoundaryFound(SharedBufferChunkReader& lineReader, con
st String& boundary) | 193 static bool skipLinesUntilBoundaryFound(SharedBufferChunkReader& lineReader, con
st String& boundary) |
194 { | 194 { |
195 String line; | 195 String line; |
196 while (!(line = lineReader.nextChunkAsUTF8StringWithLatin1Fallback()).isNull
()) { | 196 while (!(line = lineReader.nextChunkAsUTF8StringWithLatin1Fallback()).isNull
()) { |
197 if (line == boundary) | 197 if (line == boundary) |
198 return true; | 198 return true; |
199 } | 199 } |
200 return false; | 200 return false; |
201 } | 201 } |
202 | 202 |
203 MHTMLParser::MHTMLParser(SharedBuffer* data) | 203 MHTMLParser::MHTMLParser(PassRefPtr<SharedBuffer> data) |
204 : m_lineReader(data, "\r\n") | 204 : m_lineReader(data, "\r\n") |
205 { | 205 { |
206 } | 206 } |
207 | 207 |
208 HeapVector<Member<ArchiveResource>> MHTMLParser::parseArchive() | 208 HeapVector<Member<ArchiveResource>> MHTMLParser::parseArchive() |
209 { | 209 { |
210 MIMEHeader* header = MIMEHeader::parseHeader(&m_lineReader); | 210 MIMEHeader* header = MIMEHeader::parseHeader(&m_lineReader); |
211 HeapVector<Member<ArchiveResource>> resources; | 211 HeapVector<Member<ArchiveResource>> resources; |
212 if (!parseArchiveWithHeader(header, resources)) | 212 if (!parseArchiveWithHeader(header, resources)) |
213 resources.clear(); | 213 resources.clear(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if (!contentID.startsWith('<') || !contentID.endsWith('>')) | 369 if (!contentID.startsWith('<') || !contentID.endsWith('>')) |
370 return KURL(); | 370 return KURL(); |
371 | 371 |
372 StringBuilder uriBuilder; | 372 StringBuilder uriBuilder; |
373 uriBuilder.append("cid:"); | 373 uriBuilder.append("cid:"); |
374 uriBuilder.append(contentID, 1, contentID.length() - 2); | 374 uriBuilder.append(contentID, 1, contentID.length() - 2); |
375 return KURL(KURL(), uriBuilder.toString()); | 375 return KURL(KURL(), uriBuilder.toString()); |
376 } | 376 } |
377 | 377 |
378 } // namespace blink | 378 } // namespace blink |
OLD | NEW |