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 2220543002: Make Resource::resourceBuffer() to return PassRefPtr<const SharedBuffer> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WTF_UseIsConvertibleInEnsure
Patch Set: Rebase Created 4 years, 3 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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