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

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

Issue 1436683002: Making PageSerializer operate on single frames only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-removing-unused-code
Patch Set: Addressed 2nd round of CR feedback from Daniel. Created 5 years, 1 month 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
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void MHTMLArchive::generateMHTMLFooter( 222 void MHTMLArchive::generateMHTMLFooter(
223 const String& boundary, 223 const String& boundary,
224 SharedBuffer& outputBuffer) 224 SharedBuffer& outputBuffer)
225 { 225 {
226 CString asciiString = String("--" + boundary + "--\r\n").utf8(); 226 CString asciiString = String("--" + boundary + "--\r\n").utf8();
227 outputBuffer.append(asciiString.data(), asciiString.length()); 227 outputBuffer.append(asciiString.data(), asciiString.length());
228 } 228 }
229 229
230 PassRefPtr<SharedBuffer> MHTMLArchive::generateMHTMLData(
231 const Vector<SerializedResource>& resources,
232 EncodingPolicy encodingPolicy,
233 const String& title, const String& mimeType)
234 {
235 String boundary = MHTMLArchive::generateMHTMLBoundary();
236
237 RefPtr<SharedBuffer> mhtmlData = SharedBuffer::create();
238 MHTMLArchive::generateMHTMLHeader(boundary, title, mimeType, *mhtmlData);
239 for (const auto& resource : resources) {
240 MHTMLArchive::generateMHTMLPart(
241 boundary, encodingPolicy, resource, *mhtmlData);
242 }
243 MHTMLArchive::generateMHTMLFooter(boundary, *mhtmlData);
244 return mhtmlData.release();
245 }
246
247 #if !ENABLE(OILPAN) 230 #if !ENABLE(OILPAN)
248 void MHTMLArchive::clearAllSubframeArchives() 231 void MHTMLArchive::clearAllSubframeArchives()
249 { 232 {
250 SubFrameArchives clearedArchives; 233 SubFrameArchives clearedArchives;
251 clearAllSubframeArchivesImpl(&clearedArchives); 234 clearAllSubframeArchivesImpl(&clearedArchives);
252 } 235 }
253 236
254 void MHTMLArchive::clearAllSubframeArchivesImpl(SubFrameArchives* clearedArchive s) 237 void MHTMLArchive::clearAllSubframeArchivesImpl(SubFrameArchives* clearedArchive s)
255 { 238 {
256 for (SubFrameArchives::iterator it = m_subframeArchives.begin(); it != m_sub frameArchives.end(); ++it) { 239 for (SubFrameArchives::iterator it = m_subframeArchives.begin(); it != m_sub frameArchives.end(); ++it) {
(...skipping 22 matching lines...) Expand all
279 } 262 }
280 263
281 DEFINE_TRACE(MHTMLArchive) 264 DEFINE_TRACE(MHTMLArchive)
282 { 265 {
283 visitor->trace(m_mainResource); 266 visitor->trace(m_mainResource);
284 visitor->trace(m_subresources); 267 visitor->trace(m_subresources);
285 visitor->trace(m_subframeArchives); 268 visitor->trace(m_subframeArchives);
286 } 269 }
287 270
288 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698