|
@@ -26,6 +26,7 @@
|
|
|
#include "shell/browser/web_view_manager.h"
|
|
|
#include "shell/common/native_mate_converters/value_converter.h"
|
|
|
#include "shell/common/options_switches.h"
|
|
|
+#include "third_party/blink/public/mojom/v8_cache_options.mojom.h"
|
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
#include "ui/gfx/switches.h"
|
|
@@ -489,6 +490,23 @@ void WebContentsPreferences::OverrideWebkitPrefs(
|
|
|
std::string encoding;
|
|
|
if (GetAsString(&preference_, "defaultEncoding", &encoding))
|
|
|
prefs->default_encoding = encoding;
|
|
|
+
|
|
|
+ std::string v8_cache_options;
|
|
|
+ if (GetAsString(&preference_, "v8CacheOptions", &v8_cache_options)) {
|
|
|
+ if (v8_cache_options == "none") {
|
|
|
+ prefs->v8_cache_options = blink::mojom::V8CacheOptions::kNone;
|
|
|
+ } else if (v8_cache_options == "code") {
|
|
|
+ prefs->v8_cache_options = blink::mojom::V8CacheOptions::kCode;
|
|
|
+ } else if (v8_cache_options == "bypassHeatCheck") {
|
|
|
+ prefs->v8_cache_options =
|
|
|
+ blink::mojom::V8CacheOptions::kCodeWithoutHeatCheck;
|
|
|
+ } else if (v8_cache_options == "bypassHeatCheckAndEagerCompile") {
|
|
|
+ prefs->v8_cache_options =
|
|
|
+ blink::mojom::V8CacheOptions::kFullCodeWithoutHeatCheck;
|
|
|
+ } else {
|
|
|
+ prefs->v8_cache_options = blink::mojom::V8CacheOptions::kDefault;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsPreferences)
|