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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1914963002: Introduce v8-cache-strategies-for-cache-storage setting flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 887808994d2868d6ccc657be2820289c97d3ccc9..51ee9d2f03f2e558dbc055425bc90c2b6d6eb04c 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -600,6 +600,26 @@ void ApplyBlinkSettings(const base::CommandLine& command_line,
}
}
+WebSettings::V8CacheStrategiesForCacheStorage
+GetV8CacheStrategiesForCacheStorage() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ std::string v8_cache_strategies = command_line.GetSwitchValueASCII(
+ switches::kV8CacheStrategiesForCacheStorage);
+ if (v8_cache_strategies.empty())
+ v8_cache_strategies =
+ base::FieldTrialList::FindFullName("V8CacheStrategiesForCacheStorage");
+ if (v8_cache_strategies == "none") {
+ return WebSettings::V8CacheStrategiesForCacheStorage::None;
+ } else if (v8_cache_strategies == "normal") {
+ return WebSettings::V8CacheStrategiesForCacheStorage::Normal;
+ } else if (v8_cache_strategies == "aggressive") {
+ return WebSettings::V8CacheStrategiesForCacheStorage::Aggressive;
+ } else {
+ return WebSettings::V8CacheStrategiesForCacheStorage::Default;
+ }
+}
+
} // namespace
RenderViewImpl::RenderViewImpl(CompositorDependencies* compositor_deps,
@@ -1038,6 +1058,9 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
settings->setV8CacheOptions(
static_cast<WebSettings::V8CacheOptions>(prefs.v8_cache_options));
+ settings->setV8CacheStrategiesForCacheStorage(
+ GetV8CacheStrategiesForCacheStorage());
+
settings->setImageAnimationPolicy(
static_cast<WebSettings::ImageAnimationPolicy>(prefs.animation_policy));
« no previous file with comments | « content/public/common/content_switches.cc ('k') | testing/variations/fieldtrial_testing_config_android.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698