| 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 29 matching lines...) Expand all Loading... |
| 40 #include "wtf/text/StringHash.h" | 40 #include "wtf/text/StringHash.h" |
| 41 | 41 |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 class ArchiveResource; | 44 class ArchiveResource; |
| 45 class KURL; | 45 class KURL; |
| 46 class SharedBuffer; | 46 class SharedBuffer; |
| 47 | 47 |
| 48 struct SerializedResource; | 48 struct SerializedResource; |
| 49 | 49 |
| 50 class PLATFORM_EXPORT MHTMLArchive final : public RefCountedWillBeGarbageCollect
edFinalized<MHTMLArchive> { | 50 class PLATFORM_EXPORT MHTMLArchive final : public GarbageCollectedFinalized<MHTM
LArchive> { |
| 51 public: | 51 public: |
| 52 static PassRefPtrWillBeRawPtr<MHTMLArchive> create(const KURL&, SharedBuffer
*); | 52 static RawPtr<MHTMLArchive> create(const KURL&, SharedBuffer*); |
| 53 ~MHTMLArchive(); | 53 ~MHTMLArchive(); |
| 54 | 54 |
| 55 // Binary encoding results in smaller MHTML files but they might not work in
other browsers. | 55 // Binary encoding results in smaller MHTML files but they might not work in
other browsers. |
| 56 enum EncodingPolicy { | 56 enum EncodingPolicy { |
| 57 UseDefaultEncoding, | 57 UseDefaultEncoding, |
| 58 UseBinaryEncoding | 58 UseBinaryEncoding |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 // Generates an MHTML header and appends it to |outputBuffer|. | 61 // Generates an MHTML header and appends it to |outputBuffer|. |
| 62 // | 62 // |
| (...skipping 20 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 // Generates an MHTML footer and appends it to |outputBuffer|. | 84 // Generates an MHTML footer and appends it to |outputBuffer|. |
| 85 // | 85 // |
| 86 // Same |boundary| needs to used for all generateMHTMLHeader and | 86 // Same |boundary| needs to used for all generateMHTMLHeader and |
| 87 // generateMHTMLPart and generateMHTMLFooter calls that belong to the same | 87 // generateMHTMLPart and generateMHTMLFooter calls that belong to the same |
| 88 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). | 88 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). |
| 89 static void generateMHTMLFooter( | 89 static void generateMHTMLFooter( |
| 90 const String& boundary, | 90 const String& boundary, |
| 91 SharedBuffer& outputBuffer); | 91 SharedBuffer& outputBuffer); |
| 92 | 92 |
| 93 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<ArchiveResource>> SubAr
chiveResources; | 93 typedef HeapHashMap<String, Member<ArchiveResource>> SubArchiveResources; |
| 94 | 94 |
| 95 ArchiveResource* mainResource() { return m_mainResource.get(); } | 95 ArchiveResource* mainResource() { return m_mainResource.get(); } |
| 96 ArchiveResource* subresourceForURL(const KURL&) const; | 96 ArchiveResource* subresourceForURL(const KURL&) const; |
| 97 | 97 |
| 98 DECLARE_TRACE(); | 98 DECLARE_TRACE(); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 MHTMLArchive(); | 101 MHTMLArchive(); |
| 102 | 102 |
| 103 void setMainResource(PassRefPtrWillBeRawPtr<ArchiveResource>); | 103 void setMainResource(RawPtr<ArchiveResource>); |
| 104 void addSubresource(ArchiveResource*); | 104 void addSubresource(ArchiveResource*); |
| 105 | 105 |
| 106 RefPtrWillBeMember<ArchiveResource> m_mainResource; | 106 Member<ArchiveResource> m_mainResource; |
| 107 SubArchiveResources m_subresources; | 107 SubArchiveResources m_subresources; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace blink | 110 } // namespace blink |
| 111 | 111 |
| 112 #endif | 112 #endif |
| OLD | NEW |