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/string_number_conversions.h" | 7 #include "base/string_number_conversions.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 "cc/switches.h" | 10 #include "cc/switches.h" |
11 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
12 #include "content/public/common/content_constants.h" | 12 #include "content/public/common/content_constants.h" |
13 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
14 #include "ui/base/ui_base_switches.h" | 14 #include "ui/base/ui_base_switches.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 void SetContentCommandLineFlags(int max_render_process_count) { | 18 void SetContentCommandLineFlags(int max_render_process_count) { |
19 // May be called multiple times, to cover all possible program entry points. | 19 // May be called multiple times, to cover all possible program entry points. |
20 static bool already_initialized = false; | 20 static bool already_initialized = false; |
21 if (already_initialized) | 21 if (already_initialized) |
22 return; | 22 return; |
23 already_initialized = true; | 23 already_initialized = true; |
24 | 24 |
25 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); | 25 CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); |
26 | 26 |
27 parsed_command_line->AppendSwitch(cc::switches::kEnableImplSidePainting); | |
28 | |
29 if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) { | 27 if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) { |
30 std::string limit = parsed_command_line->GetSwitchValueASCII( | 28 std::string limit = parsed_command_line->GetSwitchValueASCII( |
31 switches::kRendererProcessLimit); | 29 switches::kRendererProcessLimit); |
32 int value; | 30 int value; |
33 if (base::StringToInt(limit, &value)) | 31 if (base::StringToInt(limit, &value)) |
34 max_render_process_count = value; | 32 max_render_process_count = value; |
35 } | 33 } |
36 | 34 |
37 if (max_render_process_count <= 0) { | 35 if (max_render_process_count <= 0) { |
38 // Need to ensure the command line flag is consistent as a lot of chrome | 36 // Need to ensure the command line flag is consistent as a lot of chrome |
(...skipping 28 matching lines...) Expand all Loading... |
67 | 65 |
68 // Always use fixed layout and viewport tag. | 66 // Always use fixed layout and viewport tag. |
69 parsed_command_line->AppendSwitch(switches::kEnableFixedLayout); | 67 parsed_command_line->AppendSwitch(switches::kEnableFixedLayout); |
70 parsed_command_line->AppendSwitch(switches::kEnableViewport); | 68 parsed_command_line->AppendSwitch(switches::kEnableViewport); |
71 | 69 |
72 parsed_command_line->AppendSwitch( | 70 parsed_command_line->AppendSwitch( |
73 cc::switches::kEnableCompositorFrameMessage); | 71 cc::switches::kEnableCompositorFrameMessage); |
74 } | 72 } |
75 | 73 |
76 } // namespace content | 74 } // namespace content |
OLD | NEW |