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

Unified Diff: content/public/common/mhtml_generation_params.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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/mhtml_generation_params.h
diff --git a/content/public/common/mhtml_generation_params.h b/content/public/common/mhtml_generation_params.h
new file mode 100644
index 0000000000000000000000000000000000000000..c61879f0f183849399f9193300187d99392c8693
--- /dev/null
+++ b/content/public/common/mhtml_generation_params.h
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_
+#define CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_
+
+#include "base/files/file_path.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+// Options for changing serialization behavior based on the CacheControl header
+// of each subresource.
+enum class MHTMLCacheControlPolicy {
+ NONE = 0,
+ FAIL_FOR_NO_STORE_MAIN_FRAME,
+
+ // |LAST| is used in content/public/common/common_param_traits_macros.h with
+ // IPC_ENUM_TRAITS_MAX_VALUE macro. Keep the value up to date. Otherwise
+ // a new value can not be passed to the renderer.
+ LAST = FAIL_FOR_NO_STORE_MAIN_FRAME
+};
+
+struct CONTENT_EXPORT MHTMLGenerationParams {
+ MHTMLGenerationParams(const base::FilePath& file_path);
+ ~MHTMLGenerationParams() = default;
+
+ // The file that will contain the generated MHTML.
+ base::FilePath file_path;
+
+ // Uses Content-Transfer-Encoding: binary when encoding. See
+ // https://tools.ietf.org/html/rfc2045 for details about
+ // Content-Transfer-Encoding.
+ bool use_binary_encoding = false;
+
+ // By default, MHTML includes all subresources. This flag can be used to
+ // cause the generator to fail or silently ignore resources if the
+ // Cache-Control header is used.
+ MHTMLCacheControlPolicy cache_control_policy = MHTMLCacheControlPolicy::NONE;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_MHTML_GENERATION_PARAMS_H_
« no previous file with comments | « content/public/common/common_param_traits_macros.h ('k') | content/public/common/mhtml_generation_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698