Don't add the "--expose-gc" V8 flag by default for all CEF users (issue #483).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@470 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-01-19 19:12:15 +00:00
parent 0352efec64
commit 5a112a21dd
2 changed files with 11 additions and 11 deletions

View File

@ -22,7 +22,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#include "ui/gfx/gl/gl_implementation.h" #include "ui/gfx/gl/gl_implementation.h"
#include "webkit/extensions/v8/gc_extension.h"
#include "webkit/glue/user_agent.h" #include "webkit/glue/user_agent.h"
#include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/npapi/plugin_list.h"
@ -107,15 +106,10 @@ void CefProcessUIThread::Init() {
kStatsFileCounters); kStatsFileCounters);
base::StatsTable::set_current(statstable_); base::StatsTable::set_current(statstable_);
// CEF always exposes the GC. if (settings.javascript_flags.length > 0) {
std::string javascript_flags = "--expose-gc"; // Pass the JavaScript flags to V8.
if (settings.javascript_flags.length > 0) webkit_glue::SetJavaScriptFlags(CefString(&settings.javascript_flags));
javascript_flags += " " + CefString(&settings.javascript_flags).ToString(); }
webkit_glue::SetJavaScriptFlags(javascript_flags);
// Expose GCController to JavaScript.
WebKit::WebScriptController::registerExtension(
extensions_v8::GCExtension::Get());
#if defined(OS_WIN) #if defined(OS_WIN)
if (settings.graphics_implementation == ANGLE_IN_PROCESS || if (settings.graphics_implementation == ANGLE_IN_PROCESS ||

View File

@ -108,8 +108,14 @@ void CefTestSuite::GetSettings(CefSettings& settings) {
settings.session_storage_quota = atoi(commandline_->GetSwitchValueASCII( settings.session_storage_quota = atoi(commandline_->GetSwitchValueASCII(
cefclient::kSessionStorageQuota).c_str()); cefclient::kSessionStorageQuota).c_str());
CefString(&settings.javascript_flags) = // Always expose the V8 gc() function to give tests finer-grained control over
// memory management.
std::string javascript_flags = "--expose-gc";
std::string other_javascript_flags =
commandline_->GetSwitchValueASCII(cefclient::kJavascriptFlags); commandline_->GetSwitchValueASCII(cefclient::kJavascriptFlags);
if (!other_javascript_flags.empty())
javascript_flags += " " + other_javascript_flags;
CefString(&settings.javascript_flags) = javascript_flags;
} }
// static // static