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

Side by Side Diff: content/public/common/mhtml_generation_params.h

Issue 1977303003: Adds a feature to MHTML serialization that omits subframes and subresources marked no-store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-store
Patch Set: Adds a test that compares actual visible content. 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_
6 #define CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_ 6 #define CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 // Options for changing serialization behavior based on the CacheControl header 13 // Options for changing serialization behavior based on the CacheControl header
14 // of each subresource. 14 // of each subresource.
15 enum class MHTMLCacheControlPolicy { 15 enum class MHTMLCacheControlPolicy {
16 NONE = 0, 16 NONE = 0,
17 FAIL_FOR_NO_STORE_MAIN_FRAME, 17 FAIL_FOR_NO_STORE_MAIN_FRAME,
18 18 SKIP_ANY_FRAME_OR_RESOURCE_MARKED_NO_STORE,
19 // |LAST| is used in content/public/common/common_param_traits_macros.h with 19 // |LAST| is used in content/public/common/common_param_traits_macros.h with
20 // IPC_ENUM_TRAITS_MAX_VALUE macro. Keep the value up to date. Otherwise 20 // IPC_ENUM_TRAITS_MAX_VALUE macro. Keep the value up to date. Otherwise
21 // a new value can not be passed to the renderer. 21 // a new value can not be passed to the renderer.
22 LAST = FAIL_FOR_NO_STORE_MAIN_FRAME 22 LAST = SKIP_ANY_FRAME_OR_RESOURCE_MARKED_NO_STORE
23 }; 23 };
24 24
25 struct CONTENT_EXPORT MHTMLGenerationParams { 25 struct CONTENT_EXPORT MHTMLGenerationParams {
26 MHTMLGenerationParams(const base::FilePath& file_path); 26 MHTMLGenerationParams(const base::FilePath& file_path);
27 ~MHTMLGenerationParams() = default; 27 ~MHTMLGenerationParams() = default;
28 28
29 // The file that will contain the generated MHTML. 29 // The file that will contain the generated MHTML.
30 base::FilePath file_path; 30 base::FilePath file_path;
31 31
32 // Uses Content-Transfer-Encoding: binary when encoding. See 32 // Uses Content-Transfer-Encoding: binary when encoding. See
33 // https://tools.ietf.org/html/rfc2045 for details about 33 // https://tools.ietf.org/html/rfc2045 for details about
34 // Content-Transfer-Encoding. 34 // Content-Transfer-Encoding.
35 bool use_binary_encoding = false; 35 bool use_binary_encoding = false;
36 36
37 // By default, MHTML includes all subresources. This flag can be used to 37 // By default, MHTML includes all subresources. This flag can be used to
38 // cause the generator to fail or silently ignore resources if the 38 // cause the generator to fail or silently ignore resources if the
39 // Cache-Control header is used. 39 // Cache-Control header is used.
40 MHTMLCacheControlPolicy cache_control_policy = MHTMLCacheControlPolicy::NONE; 40 MHTMLCacheControlPolicy cache_control_policy = MHTMLCacheControlPolicy::NONE;
41 }; 41 };
42 42
43 } // namespace content 43 } // namespace content
44 44
45 #endif // CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_ 45 #endif // CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698