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

Side by Side Diff: third_party/WebKit/public/web/WebFrameSerializer.h

Issue 2379823003: Move MHTML file writing out of the renderer main thread. (Closed)
Patch Set: Address reviewer comments. Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/web/tests/MHTMLTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebFrameSerializer_h 31 #ifndef WebFrameSerializer_h
32 #define WebFrameSerializer_h 32 #define WebFrameSerializer_h
33 33
34 #include "../platform/WebCommon.h" 34 #include "../platform/WebCommon.h"
35 #include "../platform/WebData.h"
36 #include "../platform/WebString.h" 35 #include "../platform/WebString.h"
36 #include "../platform/WebThreadSafeData.h"
37 #include "../platform/WebURL.h" 37 #include "../platform/WebURL.h"
38 #include "../platform/WebVector.h" 38 #include "../platform/WebVector.h"
39 #include "WebFrameSerializerCacheControlPolicy.h" 39 #include "WebFrameSerializerCacheControlPolicy.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class WebFrameSerializerClient; 43 class WebFrameSerializerClient;
44 class WebFrame; 44 class WebFrame;
45 class WebLocalFrame; 45 class WebLocalFrame;
46 template <typename T> 46 template <typename T>
(...skipping 23 matching lines...) Expand all
70 70
71 // Generates and returns an MHTML header. 71 // Generates and returns an MHTML header.
72 // 72 //
73 // Contents of the header (i.e. title and mime type) will be based 73 // Contents of the header (i.e. title and mime type) will be based
74 // on the frame passed as an argument (which typically should be 74 // on the frame passed as an argument (which typically should be
75 // the main, top-level frame). 75 // the main, top-level frame).
76 // 76 //
77 // Same |boundary| needs to used for all generateMHTMLHeader and 77 // Same |boundary| needs to used for all generateMHTMLHeader and
78 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 78 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
79 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 79 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
80 BLINK_EXPORT static WebData generateMHTMLHeader( 80 BLINK_EXPORT static WebThreadSafeData generateMHTMLHeader(
81 const WebString& boundary, 81 const WebString& boundary,
82 WebLocalFrame*, 82 WebLocalFrame*,
83 MHTMLPartsGenerationDelegate*); 83 MHTMLPartsGenerationDelegate*);
84 84
85 // Generates and returns MHTML parts for the given frame and the 85 // Generates and returns MHTML parts for the given frame and the
86 // savable resources underneath. 86 // savable resources underneath.
87 // 87 //
88 // Same |boundary| needs to used for all generateMHTMLHeader and 88 // Same |boundary| needs to used for all generateMHTMLHeader and
89 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 89 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
90 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 90 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
91 BLINK_EXPORT static WebData generateMHTMLParts(const WebString& boundary, 91 BLINK_EXPORT static WebThreadSafeData generateMHTMLParts(
92 WebLocalFrame*, 92 const WebString& boundary,
93 MHTMLPartsGenerationDelegate*); 93 WebLocalFrame*,
94 MHTMLPartsGenerationDelegate*);
94 95
95 // Generates and returns an MHTML footer. 96 // Generates and returns an MHTML footer.
96 // 97 //
97 // Same |boundary| needs to used for all generateMHTMLHeader and 98 // Same |boundary| needs to used for all generateMHTMLHeader and
98 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 99 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
99 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 100 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
100 BLINK_EXPORT static WebData generateMHTMLFooter(const WebString& boundary); 101 BLINK_EXPORT static WebThreadSafeData generateMHTMLFooter(
102 const WebString& boundary);
101 103
102 // IMPORTANT: 104 // IMPORTANT:
103 // The API below is an older implementation of frame serialization that 105 // The API below is an older implementation of frame serialization that
104 // will be removed soon. 106 // will be removed soon.
105 107
106 class LinkRewritingDelegate { 108 class LinkRewritingDelegate {
107 public: 109 public:
108 // Method allowing the delegate control which URLs are written into the 110 // Method allowing the delegate control which URLs are written into the
109 // generated html document. 111 // generated html document.
110 // 112 //
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // Generate the MOTW declaration. 149 // Generate the MOTW declaration.
148 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&); 150 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&);
149 // Generate the default base tag declaration. 151 // Generate the default base tag declaration.
150 BLINK_EXPORT static WebString generateBaseTagDeclaration( 152 BLINK_EXPORT static WebString generateBaseTagDeclaration(
151 const WebString& baseTarget); 153 const WebString& baseTarget);
152 }; 154 };
153 155
154 } // namespace blink 156 } // namespace blink
155 157
156 #endif 158 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/MHTMLTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698