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

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: A few move semantics fixes (I think). 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
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 19 matching lines...) Expand all
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" 35 #include "../platform/WebData.h"
36 #include "../platform/WebString.h" 36 #include "../platform/WebString.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 #include <vector>
40 41
41 namespace blink { 42 namespace blink {
42 43
43 class WebFrameSerializerClient; 44 class WebFrameSerializerClient;
44 class WebFrame; 45 class WebFrame;
45 class WebLocalFrame; 46 class WebLocalFrame;
46 template <typename T> class WebVector; 47 template <typename T> class WebVector;
47 48
48 // Serialization of frame contents into html or mhtml. 49 // Serialization of frame contents into html or mhtml.
49 class WebFrameSerializer { 50 class WebFrameSerializer {
(...skipping 19 matching lines...) Expand all
69 70
70 // Generates and returns an MHTML header. 71 // Generates and returns an MHTML header.
71 // 72 //
72 // 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
73 // on the frame passed as an argument (which typically should be 74 // on the frame passed as an argument (which typically should be
74 // the main, top-level frame). 75 // the main, top-level frame).
75 // 76 //
76 // Same |boundary| needs to used for all generateMHTMLHeader and 77 // Same |boundary| needs to used for all generateMHTMLHeader and
77 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 78 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
78 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 79 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
79 BLINK_EXPORT static WebData generateMHTMLHeader( 80 BLINK_EXPORT static std::vector<char> generateMHTMLHeader(
80 const WebString& boundary, WebLocalFrame*, MHTMLPartsGenerationDelegate* ); 81 const WebString& boundary, WebLocalFrame*, MHTMLPartsGenerationDelegate* );
81 82
82 // Generates and returns MHTML parts for the given frame and the 83 // Generates and returns MHTML parts for the given frame and the
83 // savable resources underneath. 84 // savable resources underneath.
84 // 85 //
85 // Same |boundary| needs to used for all generateMHTMLHeader and 86 // Same |boundary| needs to used for all generateMHTMLHeader and
86 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 87 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
87 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 88 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
88 BLINK_EXPORT static WebData generateMHTMLParts( 89 BLINK_EXPORT static std::vector<char> generateMHTMLParts(
89 const WebString& boundary, WebLocalFrame*, MHTMLPartsGenerationDelegate* ); 90 const WebString& boundary, WebLocalFrame*, MHTMLPartsGenerationDelegate* );
90 91
91 // Generates and returns an MHTML footer. 92 // Generates and returns an MHTML footer.
92 // 93 //
93 // Same |boundary| needs to used for all generateMHTMLHeader and 94 // Same |boundary| needs to used for all generateMHTMLHeader and
94 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 95 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
95 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 96 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
96 BLINK_EXPORT static WebData generateMHTMLFooter(const WebString& boundary); 97 BLINK_EXPORT static std::vector<char> generateMHTMLFooter(const WebString& b oundary);
97 98
98 // IMPORTANT: 99 // IMPORTANT:
99 // The API below is an older implementation of frame serialization that 100 // The API below is an older implementation of frame serialization that
100 // will be removed soon. 101 // will be removed soon.
101 102
102 class LinkRewritingDelegate { 103 class LinkRewritingDelegate {
103 public: 104 public:
104 // Method allowing the delegate control which URLs are written into the 105 // Method allowing the delegate control which URLs are written into the
105 // generated html document. 106 // generated html document.
106 // 107 //
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset); 143 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset);
143 // Generate the MOTW declaration. 144 // Generate the MOTW declaration.
144 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ; 145 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ;
145 // Generate the default base tag declaration. 146 // Generate the default base tag declaration.
146 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget); 147 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget);
147 }; 148 };
148 149
149 } // namespace blink 150 } // namespace blink
150 151
151 #endif 152 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698