| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |