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

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

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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/mhtml_generation.cc
diff --git a/content/public/common/mhtml_generation.cc b/content/public/common/mhtml_generation.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e52b297c010aa0fbe1aa24bfab92600f1cce6407
--- /dev/null
+++ b/content/public/common/mhtml_generation.cc
@@ -0,0 +1,32 @@
+// 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.
+
+#include "content/public/common/mhtml_generation.h"
+
+#include "base/files/file_path.h"
+
+namespace content {
+
+MHTMLGenerationParams::MHTMLGenerationParams(const base::FilePath& file_path)
+ : file_path(file_path) {}
+
+namespace mhtml {
+
+blink::WebFrameSerializer::CacheControlPolicy toCacheControlPolicy(
+ MHTMLCacheControlPolicy mhtml_policy) {
+ switch (mhtml_policy) {
+ case MHTMLCacheControlPolicy::IGNORE:
+ return blink::WebFrameSerializer::CacheControlPolicyIgnore;
+ case MHTMLCacheControlPolicy::FAIL_FOR_NO_STORE_MAIN_FRAME:
+ return blink::WebFrameSerializer::
+ CacheControlPolicyFailForNoStoreMainFrame;
+ default:
+ NOTREACHED();
+ return blink::WebFrameSerializer::CacheControlPolicyIgnore;
+ }
+}
+
+} // namespace mhtml
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698