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

Unified Diff: chrome/browser/gpu_process_host.cc

Issue 3012021: CommandLine: add a CopySwitchesFrom() for copying from another CommandLine (Closed)
Patch Set: minor cleanups Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gpu_process_host.cc
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc
index cdf1102c2f2c1311fb6f82f5547341fccf3fab1e..03222fd7365d014c759043939a9db99b51516b02 100644
--- a/chrome/browser/gpu_process_host.cc
+++ b/chrome/browser/gpu_process_host.cc
@@ -90,19 +90,15 @@ bool GpuProcessHost::Init() {
ASCIIToWide(channel_id()));
// Propagate relevant command line switches.
- static const char* const switch_names[] = {
+ static const char* const kSwitchNames[] = {
switches::kUseGL,
+ switches::kDisableLogging,
+ switches::kEnableLogging,
+ switches::kGpuStartupDialog,
+ switches::kLoggingLevel,
};
-
- for (size_t i = 0; i < arraysize(switch_names); ++i) {
- if (browser_command_line.HasSwitch(switch_names[i])) {
- cmd_line->AppendSwitchWithValue(switch_names[i],
- browser_command_line.GetSwitchValueASCII(switch_names[i]));
- }
- }
-
- const CommandLine& browser_cmd_line = *CommandLine::ForCurrentProcess();
- PropagateBrowserCommandLineToGpu(browser_cmd_line, cmd_line);
+ cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
+ arraysize(kSwitchNames));
// If specified, prepend a launcher program to the command line.
if (!gpu_launcher.empty())
@@ -215,26 +211,6 @@ void GpuProcessHost::ReplyToRenderer(
filter->Send(message);
}
-void GpuProcessHost::PropagateBrowserCommandLineToGpu(
- const CommandLine& browser_cmd,
- CommandLine* gpu_cmd) const {
- // Propagate the following switches to the GPU process command line (along
- // with any associated values) if present in the browser command line.
- static const char* const switch_names[] = {
- switches::kDisableLogging,
- switches::kEnableLogging,
- switches::kGpuStartupDialog,
- switches::kLoggingLevel,
- };
-
- for (size_t i = 0; i < arraysize(switch_names); ++i) {
- if (browser_cmd.HasSwitch(switch_names[i])) {
- gpu_cmd->AppendSwitchWithValue(switch_names[i],
- browser_cmd.GetSwitchValueASCII(switch_names[i]));
- }
- }
-}
-
URLRequestContext* GpuProcessHost::GetRequestContext(
uint32 request_id,
const ViewHostMsg_Resource_Request& request_data) {
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/jumplist_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698