mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-03 12:37:36 +01:00
Add support for specifying custom V8 flags via a new CefSettings.javascript_flags configuration option (issue #413).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@363 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
8e45560a02
commit
8257177763
@ -152,6 +152,12 @@ typedef struct _cef_settings_t
|
||||
///
|
||||
unsigned int session_storage_quota;
|
||||
|
||||
///
|
||||
// Custom flags that will be used when initializing the V8 JavaScript engine.
|
||||
// The consequences of using custom flags may not be well tested.
|
||||
///
|
||||
cef_string_t javascript_flags;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
///
|
||||
// Set to true (1) to use the system proxy resolver on Windows when
|
||||
|
@ -258,6 +258,7 @@ struct CefSettingsTraits {
|
||||
if(s->extra_plugin_paths)
|
||||
cef_string_list_free(s->extra_plugin_paths);
|
||||
cef_string_clear(&s->log_file);
|
||||
cef_string_clear(&s->javascript_flags);
|
||||
}
|
||||
|
||||
static inline void set(const struct_type* src, struct_type* target, bool copy)
|
||||
@ -283,6 +284,8 @@ struct CefSettingsTraits {
|
||||
target->graphics_implementation = src->graphics_implementation;
|
||||
target->local_storage_quota = src->local_storage_quota;
|
||||
target->session_storage_quota = src->session_storage_quota;
|
||||
cef_string_set(src->javascript_flags.str, src->javascript_flags.length,
|
||||
&target->javascript_flags, copy);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
target->auto_detect_proxy_settings_enabled =
|
||||
|
@ -111,7 +111,11 @@ void CefProcessUIThread::Init() {
|
||||
base::StatsTable::set_current(statstable_);
|
||||
|
||||
// CEF always exposes the GC.
|
||||
webkit_glue::SetJavaScriptFlags("--expose-gc");
|
||||
std::string javascript_flags = "--expose-gc";
|
||||
if (settings.javascript_flags.length > 0)
|
||||
javascript_flags += " " + CefString(&settings.javascript_flags).ToString();
|
||||
webkit_glue::SetJavaScriptFlags(javascript_flags);
|
||||
|
||||
// Expose GCController to JavaScript.
|
||||
WebKit::WebScriptController::registerExtension(
|
||||
extensions_v8::GCExtension::Get());
|
||||
|
Loading…
x
Reference in New Issue
Block a user