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

Side by Side Diff: third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp

Issue 2054643003: Remove duplication of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/mhtml/MHTMLParser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/mhtml/MHTMLParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698