OLD | NEW |
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 Loading... |
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 |
OLD | NEW |