OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/content_switches_internal.h" | 5 #include "content/common/content_switches_internal.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 #endif | 64 #endif |
65 | 65 |
66 V8CacheOptions GetV8CacheOptions() { | 66 V8CacheOptions GetV8CacheOptions() { |
67 const base::CommandLine& command_line = | 67 const base::CommandLine& command_line = |
68 *base::CommandLine::ForCurrentProcess(); | 68 *base::CommandLine::ForCurrentProcess(); |
69 std::string v8_cache_options = | 69 std::string v8_cache_options = |
70 command_line.GetSwitchValueASCII(switches::kV8CacheOptions); | 70 command_line.GetSwitchValueASCII(switches::kV8CacheOptions); |
71 if (v8_cache_options.empty()) | 71 if (v8_cache_options.empty()) |
72 v8_cache_options = base::FieldTrialList::FindFullName("V8CacheOptions"); | 72 v8_cache_options = base::FieldTrialList::FindFullName("V8CacheOptions"); |
73 if (v8_cache_options == "parse") { | 73 if (v8_cache_options == "none") { |
| 74 return V8_CACHE_OPTIONS_NONE; |
| 75 } else if (v8_cache_options == "parse") { |
74 return V8_CACHE_OPTIONS_PARSE; | 76 return V8_CACHE_OPTIONS_PARSE; |
75 } else if (v8_cache_options == "code") { | 77 } else if (v8_cache_options == "code") { |
76 return V8_CACHE_OPTIONS_CODE; | 78 return V8_CACHE_OPTIONS_CODE; |
77 } else if (v8_cache_options == "code-compressed") { | |
78 return V8_CACHE_OPTIONS_CODE_COMPRESSED; | |
79 } else if (v8_cache_options == "none") { | |
80 return V8_CACHE_OPTIONS_NONE; | |
81 } else if (v8_cache_options == "parse-memory") { | |
82 return V8_CACHE_OPTIONS_PARSE_MEMORY; | |
83 } else if (v8_cache_options == "heuristics") { | |
84 return V8_CACHE_OPTIONS_HEURISTICS; | |
85 } else if (v8_cache_options == "heuristics-mobile") { | |
86 return V8_CACHE_OPTIONS_HEURISTICS_MOBILE; | |
87 } else if (v8_cache_options == "heuristics-default") { | |
88 return V8_CACHE_OPTIONS_HEURISTICS_DEFAULT; | |
89 } else if (v8_cache_options == "heuristics-default-mobile") { | |
90 return V8_CACHE_OPTIONS_HEURISTICS_DEFAULT_MOBILE; | |
91 } else if (v8_cache_options == "recent") { | |
92 return V8_CACHE_OPTIONS_RECENT; | |
93 } else if (v8_cache_options == "recent-small") { | |
94 return V8_CACHE_OPTIONS_RECENT_SMALL; | |
95 } else { | 79 } else { |
96 return V8_CACHE_OPTIONS_DEFAULT; | 80 return V8_CACHE_OPTIONS_DEFAULT; |
97 } | 81 } |
98 } | 82 } |
99 | 83 |
100 } // namespace content | 84 } // namespace content |
OLD | NEW |