Skip to content

Commit 727cae8

Browse files
committed
Let --js-flags work when Harmony is enabled in about:flags
[email protected] BUG= Review URL: https://codereview.chromium.org/588543003 Cr-Commit-Position: refs/heads/master@{#295960}
1 parent 09e1192 commit 727cae8

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

chrome/browser/about_flags.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ const Experiment kExperiments[] = {
806806
IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
807807
IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
808808
kOsAll,
809-
SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
809+
SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)
810810
},
811811
{
812812
"disable-software-rasterizer",

chrome/browser/chrome_content_browser_client.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
13591359
switches::kEnableShowModalDialog,
13601360
switches::kEnableStreamlinedHostedApps,
13611361
switches::kEnableWebBasedSignin,
1362+
switches::kJavaScriptHarmony,
13621363
switches::kMessageLoopHistogrammer,
13631364
switches::kOutOfProcessPdf,
13641365
switches::kPlaybackMode,

chrome/common/chrome_switches.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,9 @@ const char kInstantProcess[] = "instant-process";
759759
// enabled.
760760
const char kInvalidationUseGCMChannel[] = "invalidation-use-gcm-channel";
761761

762+
// Enables experimental Harmony (ECMAScript 6) features.
763+
const char kJavaScriptHarmony[] = "javascript-harmony";
764+
762765
// Specifies the testcase used by the IPC fuzzer.
763766
const char kIpcFuzzerTestcase[] = "ipc-fuzzer-testcase";
764767

chrome/common/chrome_switches.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ extern const char kInstallFromWebstore[];
215215
extern const char kInstantProcess[];
216216
extern const char kInvalidationUseGCMChannel[];
217217
extern const char kIpcFuzzerTestcase[];
218+
extern const char kJavaScriptHarmony[];
218219
extern const char kKeepAliveForTest[];
219220
extern const char kKioskMode[];
220221
extern const char kKioskModePrinting[];

chrome/renderer/chrome_render_process_observer.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ ChromeRenderProcessObserver::ChromeRenderProcessObserver(
264264
if (command_line.HasSwitch(switches::kEnableShowModalDialog))
265265
WebRuntimeFeatures::enableShowModalDialog(true);
266266

267+
if (command_line.HasSwitch(switches::kJavaScriptHarmony)) {
268+
std::string flag("--harmony");
269+
v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
270+
}
271+
267272
RenderThread* thread = RenderThread::Get();
268273
resource_delegate_.reset(new RendererResourceDelegate());
269274
thread->SetResourceDispatcherDelegate(resource_delegate_.get());

0 commit comments

Comments
 (0)