Chromium Code Reviews| Index: content/app/content_main_runner.cc |
| diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc |
| index 8d360c37ed1a76610e6a72a1f03cae845b914760..bf73e489ed02f6a301d5117dbe5e5782e216cb19 100644 |
| --- a/content/app/content_main_runner.cc |
| +++ b/content/app/content_main_runner.cc |
| @@ -223,9 +223,10 @@ int RunZygote(const content::MainFunctionParams& main_function_params, |
| // If a custom user agent was passed on the command line, we need |
| // to (re)set it now, rather than using the default one the zygote |
| // initialized. |
| - bool custom = false; |
| - std::string ua = content::GetContentClient()->GetUserAgent(&custom); |
| - if (custom) webkit_glue::SetUserAgent(ua, custom); |
| + if (command_line.HasSwitch(switches::kUserAgent)) { |
| + webkit_glue::SetUserAgent( |
|
scherkus (not reviewing)
2012/03/08 01:03:49
note: previously the only implementation of GetUse
|
| + command_line.GetSwitchValueASCII(switches::kUserAgent), true); |
| + } |
| // The StatsTable must be initialized in each process; we already |
| // initialized for the browser process, now we need to initialize |
| @@ -467,6 +468,21 @@ class ContentMainRunnerImpl : public content::ContentMainRunner { |
| if (delegate) |
| delegate->PreSandboxStartup(); |
| + // XXXXXX we rely on delegates calling SetContentClient() at this point in |
| + // time -- is this a fair assumption? |
|
scherkus (not reviewing)
2012/03/08 01:03:49
this part concerns me -- any ideas?
jam
2012/03/08 01:07:58
sure tha'ts fine
|
| + |
| + // If a custom user agent was passed on the command line we need |
| + // to set it now before webkit_glue::GetUserAgent() is called so that the |
| + // UA doesn't change. |
| + if (command_line.HasSwitch(switches::kUserAgent)) { |
| + std::string ua = command_line.GetSwitchValueASCII(switches::kUserAgent); |
| + webkit_glue::SetUserAgent( |
| + command_line.GetSwitchValueASCII(switches::kUserAgent), true); |
| + } else { |
| + webkit_glue::SetUserAgent( |
| + content::GetContentClient()->GetUserAgent(), false); |
| + } |
| + |
| if (!process_type.empty()) |
| CommonSubprocessInit(process_type); |