Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: content/renderer/render_process_impl.cc

Issue 588543003: Let --js-flags work when Harmony is enabled in about:flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_process_impl.h" 5 #include "content/renderer/render_process_impl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 static_cast<int>(optimize_flag.size())); 49 static_cast<int>(optimize_flag.size()));
50 } 50 }
51 51
52 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 52 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
53 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { 53 if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
54 std::string flags( 54 std::string flags(
55 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); 55 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
56 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); 56 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
57 } 57 }
58 58
59 if (command_line.HasSwitch(switches::kJavaScriptHarmony)) {
60 std::string flags("--harmony");
61 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
62 }
63
59 // Turn on cross-site document blocking for renderer processes. 64 // Turn on cross-site document blocking for renderer processes.
60 SiteIsolationPolicy::SetPolicyEnabled( 65 SiteIsolationPolicy::SetPolicyEnabled(
61 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); 66 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy());
62 } 67 }
63 68
64 RenderProcessImpl::~RenderProcessImpl() { 69 RenderProcessImpl::~RenderProcessImpl() {
65 #ifndef NDEBUG 70 #ifndef NDEBUG
66 int count = blink::WebFrame::instanceCount(); 71 int count = blink::WebFrame::instanceCount();
67 if (count) 72 if (count)
68 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; 73 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES";
69 #endif 74 #endif
70 75
71 GetShutDownEvent()->Signal(); 76 GetShutDownEvent()->Signal();
72 } 77 }
73 78
74 void RenderProcessImpl::AddBindings(int bindings) { 79 void RenderProcessImpl::AddBindings(int bindings) {
75 enabled_bindings_ |= bindings; 80 enabled_bindings_ |= bindings;
76 } 81 }
77 82
78 int RenderProcessImpl::GetEnabledBindings() const { 83 int RenderProcessImpl::GetEnabledBindings() const {
79 return enabled_bindings_; 84 return enabled_bindings_;
80 } 85 }
81 86
82 } // namespace content 87 } // namespace content
OLDNEW
« chrome/browser/about_flags.cc ('K') | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698