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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class ArchiveResource; | 46 class ArchiveResource; |
47 class MIMEHeader; | 47 class MIMEHeader; |
48 class SharedBuffer; | 48 class SharedBuffer; |
49 | 49 |
50 class PLATFORM_EXPORT MHTMLParser final { | 50 class PLATFORM_EXPORT MHTMLParser final { |
51 STACK_ALLOCATED(); | 51 STACK_ALLOCATED(); |
52 public: | 52 public: |
53 explicit MHTMLParser(SharedBuffer*); | 53 explicit MHTMLParser(PassRefPtr<SharedBuffer>); |
54 | 54 |
55 HeapVector<Member<ArchiveResource>> parseArchive(); | 55 HeapVector<Member<ArchiveResource>> parseArchive(); |
56 | 56 |
57 // Translates |contentIDFromMimeHeader| (of the form "<foo@bar.com>") | 57 // Translates |contentIDFromMimeHeader| (of the form "<foo@bar.com>") |
58 // into a cid-scheme URI (of the form "cid:foo@bar.com"). | 58 // into a cid-scheme URI (of the form "cid:foo@bar.com"). |
59 // | 59 // |
60 // Returns KURL() - an invalid URL - if contentID is invalid. | 60 // Returns KURL() - an invalid URL - if contentID is invalid. |
61 // | 61 // |
62 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs". | 62 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs". |
63 static KURL convertContentIDToURI(const String& contentID); | 63 static KURL convertContentIDToURI(const String& contentID); |
64 | 64 |
65 private: | 65 private: |
66 bool parseArchiveWithHeader(MIMEHeader*, HeapVector<Member<ArchiveResource>>
&); | 66 bool parseArchiveWithHeader(MIMEHeader*, HeapVector<Member<ArchiveResource>>
&); |
67 ArchiveResource* parseNextPart(const MIMEHeader&, const String& endOfPartBou
ndary, const String& endOfDocumentBoundary, bool& endOfArchiveReached); | 67 ArchiveResource* parseNextPart(const MIMEHeader&, const String& endOfPartBou
ndary, const String& endOfDocumentBoundary, bool& endOfArchiveReached); |
68 | 68 |
69 SharedBufferChunkReader m_lineReader; | 69 SharedBufferChunkReader m_lineReader; |
70 }; | 70 }; |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
73 | 73 |
74 #endif | 74 #endif |
OLD | NEW |