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

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

Issue 1947263004: Introduces a new MHTML generation parameter specifying different behvaior for cache-control headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto origin/master. Created 4 years, 7 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 18 matching lines...) Expand all
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" 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 40
40 namespace blink { 41 namespace blink {
41 42
42 class WebFrameSerializerClient; 43 class WebFrameSerializerClient;
43 class WebFrame; 44 class WebFrame;
44 class WebLocalFrame; 45 class WebLocalFrame;
45 template <typename T> class WebVector; 46 template <typename T> class WebVector;
46 47
47 // Serialization of frame contents into html or mhtml. 48 // Serialization of frame contents into html or mhtml.
48 class WebFrameSerializer { 49 class WebFrameSerializer {
49 public: 50 public:
50 // Generates and returns an MHTML header. 51 // Generates an MHTML header; returns false if an error occurred. The
52 // header will be returned via the WebData out-param.
51 // 53 //
52 // Contents of the header (i.e. title and mime type) will be based 54 // Contents of the header (i.e. title and mime type) will be based
53 // on the frame passed as an argument (which typically should be 55 // on the frame passed as an argument (which typically should be
54 // the main, top-level frame). 56 // the main, top-level frame).
55 // 57 //
56 // Same |boundary| needs to used for all generateMHTMLHeader and 58 // Same |boundary| needs to used for all generateMHTMLHeader and
57 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 59 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
58 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 60 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
59 BLINK_EXPORT static WebData generateMHTMLHeader( 61 BLINK_EXPORT static bool generateMHTMLHeader(
60 const WebString& boundary, WebLocalFrame*); 62 const WebString& boundary, WebFrameSerializerCacheControlPolicy, WebLoca lFrame*,
63 WebData*);
61 64
62 // Delegate for controling the behavior of generateMHTMLParts method. 65 // Delegate for controling the behavior of generateMHTMLParts method.
63 class MHTMLPartsGenerationDelegate { 66 class MHTMLPartsGenerationDelegate {
64 public: 67 public:
65 // Tells whether to skip serialization of a subresource with a given URI . 68 // Tells whether to skip serialization of a subresource with a given URI .
66 // Used to deduplicate resources across multiple frames. 69 // Used to deduplicate resources across multiple frames.
67 virtual bool shouldSkipResource(const WebURL&) = 0; 70 virtual bool shouldSkipResource(const WebURL&) = 0;
68 71
69 // Returns a Content-ID to be used for the given frame. 72 // Returns a Content-ID to be used for the given frame.
70 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URL s". 73 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URL s".
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset); 141 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset);
139 // Generate the MOTW declaration. 142 // Generate the MOTW declaration.
140 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ; 143 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ;
141 // Generate the default base tag declaration. 144 // Generate the default base tag declaration.
142 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget); 145 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget);
143 }; 146 };
144 147
145 } // namespace blink 148 } // namespace blink
146 149
147 #endif 150 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698