| 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/browser/android/content_startup_flags.h" | 5 #include "content/browser/android/content_startup_flags.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 11 #include "cc/base/switches.h" | 11 #include "cc/base/switches.h" |
| 12 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
| 13 #include "content/public/common/content_constants.h" | 13 #include "content/public/common/content_constants.h" |
| 14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 15 #include "gpu/command_buffer/service/gpu_switches.h" | 15 #include "gpu/command_buffer/service/gpu_switches.h" |
| 16 #include "ui/base/ui_base_switches.h" | 16 #include "ui/base/ui_base_switches.h" |
| 17 #include "ui/native_theme/native_theme_switches.h" | 17 #include "ui/native_theme/native_theme_switches.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 void SetContentCommandLineFlags(bool single_process, | 21 void SetContentCommandLineFlags(bool single_process, |
| 22 const std::string& plugin_descriptor) { | 22 const std::string& plugin_descriptor) { |
| 23 // May be called multiple times, to cover all possible program entry points. | 23 // May be called multiple times, to cover all possible program entry points. |
| 24 static bool already_initialized = false; | 24 static bool already_initialized = false; |
| 25 if (already_initialized) | 25 if (already_initialized) |
| 26 return; | 26 return; |
| 27 already_initialized = true; | 27 already_initialized = true; |
| 28 | 28 |
| 29 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); | 29 base::CommandLine* parsed_command_line = |
| 30 base::CommandLine::ForCurrentProcess(); |
| 30 | 31 |
| 31 int command_line_renderer_limit = -1; | 32 int command_line_renderer_limit = -1; |
| 32 if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) { | 33 if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) { |
| 33 std::string limit = parsed_command_line->GetSwitchValueASCII( | 34 std::string limit = parsed_command_line->GetSwitchValueASCII( |
| 34 switches::kRendererProcessLimit); | 35 switches::kRendererProcessLimit); |
| 35 int value; | 36 int value; |
| 36 if (base::StringToInt(limit, &value)) { | 37 if (base::StringToInt(limit, &value)) { |
| 37 command_line_renderer_limit = std::max(0, value); | 38 command_line_renderer_limit = std::max(0, value); |
| 38 } | 39 } |
| 39 } | 40 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 86 } |
| 86 | 87 |
| 87 // Disable profiler timing by default. | 88 // Disable profiler timing by default. |
| 88 if (!parsed_command_line->HasSwitch(switches::kProfilerTiming)) { | 89 if (!parsed_command_line->HasSwitch(switches::kProfilerTiming)) { |
| 89 parsed_command_line->AppendSwitchASCII( | 90 parsed_command_line->AppendSwitchASCII( |
| 90 switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); | 91 switches::kProfilerTiming, switches::kProfilerTimingDisabledValue); |
| 91 } | 92 } |
| 92 } | 93 } |
| 93 | 94 |
| 94 } // namespace content | 95 } // namespace content |
| OLD | NEW |