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

Side by Side Diff: third_party/WebKit/Source/web/tests/MHTMLTest.cpp

Issue 1441553002: Generating CIDs in Blink during MHTML serialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-per-frame-page-serializer-only
Patch Set: Simplified SerializerMarkupAccumulator::appendAttribute. Created 5 years 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const Vector<SerializedResource>& resources, 144 const Vector<SerializedResource>& resources,
145 MHTMLArchive::EncodingPolicy encodingPolicy, 145 MHTMLArchive::EncodingPolicy encodingPolicy,
146 const String& title, const String& mimeType) 146 const String& title, const String& mimeType)
147 { 147 {
148 String boundary = MHTMLArchive::generateMHTMLBoundary(); 148 String boundary = MHTMLArchive::generateMHTMLBoundary();
149 149
150 RefPtr<SharedBuffer> mhtmlData = SharedBuffer::create(); 150 RefPtr<SharedBuffer> mhtmlData = SharedBuffer::create();
151 MHTMLArchive::generateMHTMLHeader(boundary, title, mimeType, *mhtmlData) ; 151 MHTMLArchive::generateMHTMLHeader(boundary, title, mimeType, *mhtmlData) ;
152 for (const auto& resource : resources) { 152 for (const auto& resource : resources) {
153 MHTMLArchive::generateMHTMLPart( 153 MHTMLArchive::generateMHTMLPart(
154 boundary, encodingPolicy, resource, *mhtmlData); 154 boundary, String(), encodingPolicy, resource, *mhtmlData);
155 } 155 }
156 MHTMLArchive::generateMHTMLFooter(boundary, *mhtmlData); 156 MHTMLArchive::generateMHTMLFooter(boundary, *mhtmlData);
157 return mhtmlData.release(); 157 return mhtmlData.release();
158 } 158 }
159 159
160 PassRefPtr<SharedBuffer> serialize(const char *title, const char *mime, MHT MLArchive::EncodingPolicy encodingPolicy) 160 PassRefPtr<SharedBuffer> serialize(const char *title, const char *mime, MHT MLArchive::EncodingPolicy encodingPolicy)
161 { 161 {
162 return generateMHTMLData(m_resources, encodingPolicy, title, mime); 162 return generateMHTMLData(m_resources, encodingPolicy, title, mime);
163 } 163 }
164 164
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 ASSERT_TRUE(expectedEncoding); 225 ASSERT_TRUE(expectedEncoding);
226 EXPECT_NE(line.find(expectedEncoding), std::string::npos); 226 EXPECT_NE(line.find(expectedEncoding), std::string::npos);
227 expectedEncoding = 0; 227 expectedEncoding = 0;
228 sectionCheckedCount++; 228 sectionCheckedCount++;
229 } 229 }
230 } 230 }
231 EXPECT_EQ(12, sectionCheckedCount); 231 EXPECT_EQ(12, sectionCheckedCount);
232 } 232 }
233 233
234 } // namespace blink 234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698