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

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: Work on compile. 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 29 matching lines...) Expand all
40 namespace blink { 40 namespace blink {
41 41
42 class WebFrameSerializerClient; 42 class WebFrameSerializerClient;
43 class WebFrame; 43 class WebFrame;
44 class WebLocalFrame; 44 class WebLocalFrame;
45 template <typename T> class WebVector; 45 template <typename T> class WebVector;
46 46
47 // Serialization of frame contents into html or mhtml. 47 // Serialization of frame contents into html or mhtml.
48 class WebFrameSerializer { 48 class WebFrameSerializer {
49 public: 49 public:
50 // By default, frame serialization encompasses all resources in a page. If it
51 // is desirable to serialize only those resources that could be stored by a http
52 // cache, the other options may be used.
53 // FIXME: Add more policies for subframes and subresources.
Łukasz Anforowicz 2016/05/12 18:56:49 nit: I've been told by other reviewers to prefer T
dewittj 2016/05/12 22:58:01 Done.
54 enum CacheControlPolicy {
55 CacheControlPolicyIgnore,
56 CacheControlPolicyFailForNoStoreMainFrame
57 };
58
50 // Generates and returns an MHTML header. 59 // Generates and returns an MHTML header.
Łukasz Anforowicz 2016/05/12 18:56:49 nit: This should describe the new return value / t
dewittj 2016/05/12 22:58:02 Done.
51 // 60 //
52 // Contents of the header (i.e. title and mime type) will be based 61 // 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 62 // on the frame passed as an argument (which typically should be
54 // the main, top-level frame). 63 // the main, top-level frame).
55 // 64 //
56 // Same |boundary| needs to used for all generateMHTMLHeader and 65 // Same |boundary| needs to used for all generateMHTMLHeader and
57 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same 66 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same
58 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description). 67 // MHTML document (see also rfc1341, section 7.2.1, "boundary" description).
59 BLINK_EXPORT static WebData generateMHTMLHeader( 68 BLINK_EXPORT static bool generateMHTMLHeader(
60 const WebString& boundary, WebLocalFrame*); 69 const WebString& boundary, CacheControlPolicy, WebLocalFrame*,
70 WebData*);
61 71
62 // Delegate for controling the behavior of generateMHTMLParts method. 72 // Delegate for controling the behavior of generateMHTMLParts method.
63 class MHTMLPartsGenerationDelegate { 73 class MHTMLPartsGenerationDelegate {
64 public: 74 public:
65 // Tells whether to skip serialization of a subresource with a given URI . 75 // Tells whether to skip serialization of a subresource with a given URI .
66 // Used to deduplicate resources across multiple frames. 76 // Used to deduplicate resources across multiple frames.
67 virtual bool shouldSkipResource(const WebURL&) = 0; 77 virtual bool shouldSkipResource(const WebURL&) = 0;
68 78
69 // Returns a Content-ID to be used for the given frame. 79 // 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". 80 // 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); 148 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset);
139 // Generate the MOTW declaration. 149 // Generate the MOTW declaration.
140 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ; 150 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ;
141 // Generate the default base tag declaration. 151 // Generate the default base tag declaration.
142 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget); 152 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget);
143 }; 153 };
144 154
145 } // namespace blink 155 } // namespace blink
146 156
147 #endif 157 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698