Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: third_party/WebKit/Source/platform/mhtml/MHTMLArchive.h

Issue 2842653002: [Offline Pages] Generate MHTML header in the browser process. (Closed)
Patch Set: Update format string for gcc error. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 class PLATFORM_EXPORT MHTMLArchive final 47 class PLATFORM_EXPORT MHTMLArchive final
48 : public GarbageCollected<MHTMLArchive> { 48 : public GarbageCollected<MHTMLArchive> {
49 public: 49 public:
50 static MHTMLArchive* Create(const KURL&, PassRefPtr<const SharedBuffer>); 50 static MHTMLArchive* Create(const KURL&, PassRefPtr<const SharedBuffer>);
51 51
52 // Binary encoding results in smaller MHTML files but they might not work in 52 // Binary encoding results in smaller MHTML files but they might not work in
53 // other browsers. 53 // other browsers.
54 enum EncodingPolicy { kUseDefaultEncoding, kUseBinaryEncoding }; 54 enum EncodingPolicy { kUseDefaultEncoding, kUseBinaryEncoding };
55 55
56 // Generates an MHTML header and appends it to |outputBuffer|. 56 // Generates an MHTML header and appends it to |outputBuffer|.
carlosk 2017/04/25 01:28:08 Append "for testing purposes".
57 // 57 //
58 // Same |boundary| needs to be used for all generateMHTMLHeader and 58 // Same |boundary| needs to be used for all generateMHTMLHeader and
59 // generateMHTMLPart and generateMHTMLFooter calls that belong to the same 59 // generateMHTMLPart and generateMHTMLFooter calls that belong to the same
60 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 60 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
61 static void GenerateMHTMLHeader(const String& boundary, 61 static void GenerateMHTMLHeaderForTesting(const String& boundary,
62 const String& title, 62 const String& title,
63 const String& mime_type, 63 const String& mime_type,
64 Vector<char>& output_buffer); 64 Vector<char>& output_buffer);
65 65
66 // Serializes SerializedResource as an MHTML part and appends it in 66 // Serializes SerializedResource as an MHTML part and appends it in
67 // |outputBuffer|. 67 // |outputBuffer|.
68 // 68 //
69 // Same |boundary| needs to be used for all generateMHTMLHeader and 69 // Same |boundary| needs to be used for all generateMHTMLHeader and
70 // generateMHTMLPart and generateMHTMLFooter calls that belong to the same 70 // generateMHTMLPart and generateMHTMLFooter calls that belong to the same
71 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 71 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
72 // 72 //
73 // If |contentID| is non-empty, then it will be used as a Content-ID header. 73 // If |contentID| is non-empty, then it will be used as a Content-ID header.
74 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs". 74 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs".
(...skipping 26 matching lines...) Expand all
101 void AddSubresource(ArchiveResource*); 101 void AddSubresource(ArchiveResource*);
102 static bool CanLoadArchive(const KURL&); 102 static bool CanLoadArchive(const KURL&);
103 103
104 Member<ArchiveResource> main_resource_; 104 Member<ArchiveResource> main_resource_;
105 SubArchiveResources subresources_; 105 SubArchiveResources subresources_;
106 }; 106 };
107 107
108 } // namespace blink 108 } // namespace blink
109 109
110 #endif 110 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698