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

Unified Diff: content/common/content_switches_internal.cc

Issue 918093002: Pipe v8CacheOptions for ServiceWorker from the browser process to blink [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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/common/content_switches_internal.cc
diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc
index 68b24c477078bce0bc060276cbf74758908a651d..acd85ca35d312cfc70c7e7798a5ee3bff3f26bb8 100644
--- a/content/common/content_switches_internal.cc
+++ b/content/common/content_switches_internal.cc
@@ -4,6 +4,8 @@
#include "content/common/content_switches_internal.h"
+#include <string>
+
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "content/public/common/content_switches.h"
@@ -52,4 +54,38 @@ bool IsWin32kRendererLockdownEnabled() {
}
#endif
+V8CacheOptions GetV8CacheOptions() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ std::string v8_cache_options =
+ command_line.GetSwitchValueASCII(switches::kV8CacheOptions);
+ if (v8_cache_options.empty())
+ v8_cache_options = base::FieldTrialList::FindFullName("V8CacheOptions");
+ if (v8_cache_options == "parse") {
+ return V8_CACHE_OPTIONS_PARSE;
+ } else if (v8_cache_options == "code") {
+ return V8_CACHE_OPTIONS_CODE;
+ } else if (v8_cache_options == "code-compressed") {
+ return V8_CACHE_OPTIONS_CODE_COMPRESSED;
+ } else if (v8_cache_options == "none") {
+ return V8_CACHE_OPTIONS_NONE;
+ } else if (v8_cache_options == "parse-memory") {
+ return V8_CACHE_OPTIONS_PARSE_MEMORY;
+ } else if (v8_cache_options == "heuristics") {
+ return V8_CACHE_OPTIONS_HEURISTICS;
+ } else if (v8_cache_options == "heuristics-mobile") {
+ return V8_CACHE_OPTIONS_HEURISTICS_MOBILE;
+ } else if (v8_cache_options == "heuristics-default") {
+ return V8_CACHE_OPTIONS_HEURISTICS_DEFAULT;
+ } else if (v8_cache_options == "heuristics-default-mobile") {
+ return V8_CACHE_OPTIONS_HEURISTICS_DEFAULT_MOBILE;
+ } else if (v8_cache_options == "recent") {
+ return V8_CACHE_OPTIONS_RECENT;
+ } else if (v8_cache_options == "recent-small") {
+ return V8_CACHE_OPTIONS_RECENT_SMALL;
+ } else {
+ return V8_CACHE_OPTIONS_DEFAULT;
+ }
+}
+
} // namespace content
« no previous file with comments | « content/common/content_switches_internal.h ('k') | content/common/service_worker/embedded_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698