Chromium Code Reviews| Index: headless/lib/browser/headless_content_browser_client.cc |
| diff --git a/headless/lib/browser/headless_content_browser_client.cc b/headless/lib/browser/headless_content_browser_client.cc |
| index 5876199424bb691c0a56ce85a1004afc8f75f896..e6e365d1536a935643af47c70bcc072f9af7fcc6 100644 |
| --- a/headless/lib/browser/headless_content_browser_client.cc |
| +++ b/headless/lib/browser/headless_content_browser_client.cc |
| @@ -20,6 +20,7 @@ |
| #include "content/public/browser/storage_partition.h" |
| #include "content/public/common/content_switches.h" |
| #include "content/public/common/service_names.mojom.h" |
| +#include "headless/app/headless_shell_switches.h" |
| #include "headless/grit/headless_lib_resources.h" |
| #include "headless/lib/browser/headless_browser_context_impl.h" |
| #include "headless/lib/browser/headless_browser_impl.h" |
| @@ -77,21 +78,21 @@ int GetCrashSignalFD(const base::CommandLine& command_line, |
| return -1; |
| std::string process_type = |
| - command_line.GetSwitchValueASCII(switches::kProcessType); |
| + command_line.GetSwitchValueASCII(::switches::kProcessType); |
| - if (process_type == switches::kRendererProcess) { |
| + if (process_type == ::switches::kRendererProcess) { |
| static breakpad::CrashHandlerHostLinux* crash_handler = |
| CreateCrashHandlerHost(process_type, options); |
| return crash_handler->GetDeathSignalSocket(); |
| } |
| - if (process_type == switches::kPpapiPluginProcess) { |
| + if (process_type == ::switches::kPpapiPluginProcess) { |
| static breakpad::CrashHandlerHostLinux* crash_handler = |
| CreateCrashHandlerHost(process_type, options); |
| return crash_handler->GetDeathSignalSocket(); |
| } |
| - if (process_type == switches::kGpuProcess) { |
| + if (process_type == ::switches::kGpuProcess) { |
| static breakpad::CrashHandlerHostLinux* crash_handler = |
| CreateCrashHandlerHost(process_type, options); |
| return crash_handler->GetDeathSignalSocket(); |
| @@ -187,11 +188,13 @@ void HeadlessContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| void HeadlessContentBrowserClient::AppendExtraCommandLineSwitches( |
| base::CommandLine* command_line, |
| int child_process_id) { |
| - command_line->AppendSwitch(switches::kHeadless); |
| + command_line->AppendSwitch(::switches::kHeadless); |
| + command_line->AppendSwitchNative(switches::kUserAgent, |
|
Sami
2017/03/27 15:52:08
I'm wondering how things worked before when we did
irisu
2017/03/29 05:51:33
It looks as though the user agent header is set us
Sami
2017/03/29 10:46:07
That's right, that's the default user agent for th
irisu
2017/03/30 07:06:07
Removed user agent from BrowserContextOptions.
I'
|
| + browser_->options()->user_agent); |
| #if defined(HEADLESS_USE_BREAKPAD) |
| // This flag tells child processes to also turn on crash reporting. |
| if (breakpad::IsCrashReporterEnabled()) |
| - command_line->AppendSwitch(switches::kEnableCrashReporter); |
| + command_line->AppendSwitch(::switches::kEnableCrashReporter); |
| #endif // defined(HEADLESS_USE_BREAKPAD) |
| } |