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

Unified Diff: content/public/common/mhtml_generation_params.cc

Issue 2013633003: Adding a command-line flag to set MHTML generation options. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback + fixed test 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
« no previous file with comments | « content/public/common/content_switches.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/mhtml_generation_params.cc
diff --git a/content/public/common/mhtml_generation_params.cc b/content/public/common/mhtml_generation_params.cc
index f5011aadae80acf883ede6c520b53e5d31a7e1e5..8d48664fdae6832e5cc1641a5873c1ab872a741a 100644
--- a/content/public/common/mhtml_generation_params.cc
+++ b/content/public/common/mhtml_generation_params.cc
@@ -4,11 +4,27 @@
#include "content/public/common/mhtml_generation_params.h"
+#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "content/public/common/content_switches.h"
namespace content {
MHTMLGenerationParams::MHTMLGenerationParams(const base::FilePath& file_path)
- : file_path(file_path) {}
+ : file_path(file_path) {
+ // Check which variant of MHTML generation is required.
+ std::string mhtmlGeneratorOptionFlag =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kMHTMLGeneratorOption);
+ if (mhtmlGeneratorOptionFlag == switches::kMHTMLSkipNostoreMain) {
+ cache_control_policy =
+ blink::WebFrameSerializerCacheControlPolicy::
+ FailForNoStoreMainFrame;
+ } else if (mhtmlGeneratorOptionFlag == switches::kMHTMLSkipNostoreAll) {
+ cache_control_policy =
+ blink::WebFrameSerializerCacheControlPolicy::
+ SkipAnyFrameOrResourceMarkedNoStore;
+ }
+}
} // namespace content
« no previous file with comments | « content/public/common/content_switches.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698