| 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 26 matching lines...) Expand all Loading... |
| 37 #include "platform/network/ParsedContentType.h" | 37 #include "platform/network/ParsedContentType.h" |
| 38 #include "platform/text/QuotedPrintable.h" | 38 #include "platform/text/QuotedPrintable.h" |
| 39 #include "wtf/HashMap.h" | 39 #include "wtf/HashMap.h" |
| 40 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
| 41 #include "wtf/text/Base64.h" | 41 #include "wtf/text/Base64.h" |
| 42 #include "wtf/text/StringBuilder.h" | 42 #include "wtf/text/StringBuilder.h" |
| 43 #include "wtf/text/StringConcatenate.h" | 43 #include "wtf/text/StringConcatenate.h" |
| 44 #include "wtf/text/StringHash.h" | 44 #include "wtf/text/StringHash.h" |
| 45 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
| 46 | 46 |
| 47 namespace WebCore { | 47 namespace blink { |
| 48 | 48 |
| 49 // This class is a limited MIME parser used to parse the MIME headers of MHTML f
iles. | 49 // This class is a limited MIME parser used to parse the MIME headers of MHTML f
iles. |
| 50 class MIMEHeader : public RefCountedWillBeGarbageCollectedFinalized<MIMEHeader>
{ | 50 class MIMEHeader : public RefCountedWillBeGarbageCollectedFinalized<MIMEHeader>
{ |
| 51 public: | 51 public: |
| 52 static PassRefPtrWillBeRawPtr<MIMEHeader> create() | 52 static PassRefPtrWillBeRawPtr<MIMEHeader> create() |
| 53 { | 53 { |
| 54 return adoptRefWillBeNoop(new MIMEHeader()); | 54 return adoptRefWillBeNoop(new MIMEHeader()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 enum Encoding { | 57 enum Encoding { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 88 String m_charset; | 88 String m_charset; |
| 89 Encoding m_contentTransferEncoding; | 89 Encoding m_contentTransferEncoding; |
| 90 String m_contentLocation; | 90 String m_contentLocation; |
| 91 String m_multipartType; | 91 String m_multipartType; |
| 92 String m_endOfPartBoundary; | 92 String m_endOfPartBoundary; |
| 93 String m_endOfDocumentBoundary; | 93 String m_endOfDocumentBoundary; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 typedef HashMap<String, String> KeyValueMap; | 96 typedef HashMap<String, String> KeyValueMap; |
| 97 | 97 |
| 98 static KeyValueMap retrieveKeyValuePairs(WebCore::SharedBufferChunkReader* buffe
r) | 98 static KeyValueMap retrieveKeyValuePairs(blink::SharedBufferChunkReader* buffer) |
| 99 { | 99 { |
| 100 KeyValueMap keyValuePairs; | 100 KeyValueMap keyValuePairs; |
| 101 String line; | 101 String line; |
| 102 String key; | 102 String key; |
| 103 StringBuilder value; | 103 StringBuilder value; |
| 104 while (!(line = buffer->nextChunkAsUTF8StringWithLatin1Fallback()).isNull())
{ | 104 while (!(line = buffer->nextChunkAsUTF8StringWithLatin1Fallback()).isNull())
{ |
| 105 if (line.isEmpty()) | 105 if (line.isEmpty()) |
| 106 break; // Empty line means end of key/value section. | 106 break; // Empty line means end of key/value section. |
| 107 if (line[0] == '\t') { | 107 if (line[0] == '\t') { |
| 108 ASSERT(!key.isEmpty()); | 108 ASSERT(!key.isEmpty()); |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 { | 386 { |
| 387 return m_resources.size(); | 387 return m_resources.size(); |
| 388 } | 388 } |
| 389 | 389 |
| 390 ArchiveResource* MHTMLParser::subResourceAt(size_t index) const | 390 ArchiveResource* MHTMLParser::subResourceAt(size_t index) const |
| 391 { | 391 { |
| 392 return m_resources[index].get(); | 392 return m_resources[index].get(); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } | 395 } |
| OLD | NEW |