| OLD | NEW |
| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 switch (mimeHeader.contentTransferEncoding()) { | 195 switch (mimeHeader.contentTransferEncoding()) { |
| 196 case MIMEHeader::Base64: | 196 case MIMEHeader::Base64: |
| 197 if (!base64Decode(content->data(), content->size(), data)) { | 197 if (!base64Decode(content->data(), content->size(), data)) { |
| 198 LOG_ERROR("Invalid base64 content for MHTML part."); | 198 LOG_ERROR("Invalid base64 content for MHTML part."); |
| 199 return 0; | 199 return 0; |
| 200 } | 200 } |
| 201 break; | 201 break; |
| 202 case MIMEHeader::QuotedPrintable: | 202 case MIMEHeader::QuotedPrintable: |
| 203 quotedPrintableDecode(content->data(), content->size(), data); | 203 quotedPrintableDecode(content->data(), content->size(), data); |
| 204 break; | 204 break; |
| 205 case MIMEHeader::EightBit: |
| 205 case MIMEHeader::SevenBit: | 206 case MIMEHeader::SevenBit: |
| 206 case MIMEHeader::Binary: | 207 case MIMEHeader::Binary: |
| 207 data.append(content->data(), content->size()); | 208 data.append(content->data(), content->size()); |
| 208 break; | 209 break; |
| 209 default: | 210 default: |
| 210 LOG_ERROR("Invalid encoding for MHTML part."); | 211 LOG_ERROR("Invalid encoding for MHTML part."); |
| 211 return 0; | 212 return 0; |
| 212 } | 213 } |
| 213 RefPtr<SharedBuffer> contentBuffer = SharedBuffer::adoptVector(data); | 214 RefPtr<SharedBuffer> contentBuffer = SharedBuffer::adoptVector(data); |
| 214 // FIXME: the URL in the MIME header could be relative, we should resolve it
if it is. | 215 // FIXME: the URL in the MIME header could be relative, we should resolve it
if it is. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 232 { | 233 { |
| 233 return m_resources.size(); | 234 return m_resources.size(); |
| 234 } | 235 } |
| 235 | 236 |
| 236 ArchiveResource* MHTMLParser::subResourceAt(size_t index) const | 237 ArchiveResource* MHTMLParser::subResourceAt(size_t index) const |
| 237 { | 238 { |
| 238 return m_resources[index].get(); | 239 return m_resources[index].get(); |
| 239 } | 240 } |
| 240 | 241 |
| 241 } | 242 } |
| OLD | NEW |