| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 if (base::SysInfo::IsLowEndDevice()) { | 46 if (base::SysInfo::IsLowEndDevice()) { |
| 47 std::string optimize_flag("--optimize-for-size"); | 47 std::string optimize_flag("--optimize-for-size"); |
| 48 v8::V8::SetFlagsFromString(optimize_flag.c_str(), | 48 v8::V8::SetFlagsFromString(optimize_flag.c_str(), |
| 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 base::CommandLine& command_line = |
| 53 *base::CommandLine::ForCurrentProcess(); |
| 53 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { | 54 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { |
| 54 std::string flags( | 55 std::string flags( |
| 55 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); | 56 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); |
| 56 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 57 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
| 57 } | 58 } |
| 58 | 59 |
| 59 // Turn on cross-site document blocking for renderer processes. | 60 // Turn on cross-site document blocking for renderer processes. |
| 60 SiteIsolationPolicy::SetPolicyEnabled( | 61 SiteIsolationPolicy::SetPolicyEnabled( |
| 61 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); | 62 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); |
| 62 } | 63 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 73 | 74 |
| 74 void RenderProcessImpl::AddBindings(int bindings) { | 75 void RenderProcessImpl::AddBindings(int bindings) { |
| 75 enabled_bindings_ |= bindings; | 76 enabled_bindings_ |= bindings; |
| 76 } | 77 } |
| 77 | 78 |
| 78 int RenderProcessImpl::GetEnabledBindings() const { | 79 int RenderProcessImpl::GetEnabledBindings() const { |
| 79 return enabled_bindings_; | 80 return enabled_bindings_; |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace content | 83 } // namespace content |
| OLD | NEW |