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

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: Removed unneeded std::move calls that clang was complaining about. 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 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> 47 template <typename T>
47 class WebVector; 48 class WebVector;
48 49
49 // Serialization of frame contents into html or mhtml. 50 // Serialization of frame contents into html or mhtml.
(...skipping 20 matching lines...) Expand all
70 71
71 // Generates and returns an MHTML header. 72 // Generates and returns an MHTML header.
72 // 73 //
73 // Contents of the header (i.e. title and mime type) will be based 74 // 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 75 // on the frame passed as an argument (which typically should be
75 // the main, top-level frame). 76 // the main, top-level frame).
76 // 77 //
77 // Same |boundary| needs to used for all generateMHTMLHeader and 78 // Same |boundary| needs to used for all generateMHTMLHeader and
78 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 79 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
79 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 80 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
80 BLINK_EXPORT static WebData generateMHTMLHeader( 81 BLINK_EXPORT static std::vector<char> generateMHTMLHeader(
dcheng 2016/10/04 04:34:48 We don't allow STL containers (string, vector, map
81 const WebString& boundary, 82 const WebString& boundary,
82 WebLocalFrame*, 83 WebLocalFrame*,
83 MHTMLPartsGenerationDelegate*); 84 MHTMLPartsGenerationDelegate*);
84 85
85 // Generates and returns MHTML parts for the given frame and the 86 // Generates and returns MHTML parts for the given frame and the
86 // savable resources underneath. 87 // savable resources underneath.
87 // 88 //
88 // Same |boundary| needs to used for all generateMHTMLHeader and 89 // Same |boundary| needs to used for all generateMHTMLHeader and
89 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 90 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
90 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 91 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
91 BLINK_EXPORT static WebData generateMHTMLParts(const WebString& boundary, 92 BLINK_EXPORT static std::vector<char> generateMHTMLParts(
92 WebLocalFrame*, 93 const WebString& boundary,
93 MHTMLPartsGenerationDelegate*); 94 WebLocalFrame*,
95 MHTMLPartsGenerationDelegate*);
94 96
95 // Generates and returns an MHTML footer. 97 // Generates and returns an MHTML footer.
96 // 98 //
97 // Same |boundary| needs to used for all generateMHTMLHeader and 99 // Same |boundary| needs to used for all generateMHTMLHeader and
98 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 100 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
99 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 101 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
100 BLINK_EXPORT static WebData generateMHTMLFooter(const WebString& boundary); 102 BLINK_EXPORT static std::vector<char> generateMHTMLFooter(
103 const WebString& boundary);
101 104
102 // IMPORTANT: 105 // IMPORTANT:
103 // The API below is an older implementation of frame serialization that 106 // The API below is an older implementation of frame serialization that
104 // will be removed soon. 107 // will be removed soon.
105 108
106 class LinkRewritingDelegate { 109 class LinkRewritingDelegate {
107 public: 110 public:
108 // Method allowing the delegate control which URLs are written into the 111 // Method allowing the delegate control which URLs are written into the
109 // generated html document. 112 // generated html document.
110 // 113 //
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // Generate the MOTW declaration. 150 // Generate the MOTW declaration.
148 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&); 151 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&);
149 // Generate the default base tag declaration. 152 // Generate the default base tag declaration.
150 BLINK_EXPORT static WebString generateBaseTagDeclaration( 153 BLINK_EXPORT static WebString generateBaseTagDeclaration(
151 const WebString& baseTarget); 154 const WebString& baseTarget);
152 }; 155 };
153 156
154 } // namespace blink 157 } // namespace blink
155 158
156 #endif 159 #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