| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/app/chrome_main_delegate.h" | 10 #include "chrome/app/chrome_main_delegate.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/features.h" | 12 #include "chrome/common/features.h" |
| 13 #include "chrome/profiling/profiling_main.h" |
| 13 #include "content/public/app/content_main.h" | 14 #include "content/public/app/content_main.h" |
| 14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 15 #include "headless/public/headless_shell.h" | 16 #include "headless/public/headless_shell.h" |
| 16 #include "ui/gfx/switches.h" | 17 #include "ui/gfx/switches.h" |
| 17 | 18 |
| 18 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 19 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 19 #include "services/service_manager/runner/common/client_util.h" | 20 #include "services/service_manager/runner/common/client_util.h" |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 base::debug::DumpWithoutCrashing(); | 86 base::debug::DumpWithoutCrashing(); |
| 86 #else | 87 #else |
| 87 params.argc = argc; | 88 params.argc = argc; |
| 88 params.argv = argv; | 89 params.argv = argv; |
| 89 base::CommandLine::Init(params.argc, params.argv); | 90 base::CommandLine::Init(params.argc, params.argv); |
| 90 #endif // defined(OS_WIN) | 91 #endif // defined(OS_WIN) |
| 91 base::CommandLine::Init(0, nullptr); | 92 base::CommandLine::Init(0, nullptr); |
| 92 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); | 93 const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess()); |
| 93 ALLOW_UNUSED_LOCAL(command_line); | 94 ALLOW_UNUSED_LOCAL(command_line); |
| 94 | 95 |
| 96 // Chrome-specific process modes. |
| 95 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) | 97 #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
| 96 if (command_line->HasSwitch(switches::kHeadless)) { | 98 if (command_line->HasSwitch(switches::kHeadless)) { |
| 97 #if defined(OS_MACOSX) | 99 #if defined(OS_MACOSX) |
| 98 SetUpBundleOverrides(); | 100 SetUpBundleOverrides(); |
| 99 #endif | 101 #endif |
| 100 return headless::HeadlessShellMain(params); | 102 return headless::HeadlessShellMain(params); |
| 101 } | 103 } |
| 102 #endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) | 104 #endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) |
| 103 | 105 |
| 106 #if BUILDFLAG(ENABLE_OOP_HEAP_PROFILING) |
| 107 if (command_line->GetSwitchValueASCII(switches::kProcessType) == |
| 108 "profiling") { |
| 109 return profiling::ProfilingMain(*command_line); |
| 110 } |
| 111 #endif // ENABLE_OOP_HEAP_PROFILING |
| 112 |
| 104 #if defined(OS_CHROMEOS) && BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 113 #if defined(OS_CHROMEOS) && BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 105 if (service_manager::ServiceManagerIsRemote()) | 114 if (service_manager::ServiceManagerIsRemote()) |
| 106 params.env_mode = aura::Env::Mode::MUS; | 115 params.env_mode = aura::Env::Mode::MUS; |
| 107 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 116 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 108 | 117 |
| 109 int rv = content::ContentMain(params); | 118 int rv = content::ContentMain(params); |
| 110 | 119 |
| 111 #if defined(OS_WIN) | 120 #if defined(OS_WIN) |
| 112 base::win::SetShouldCrashOnProcessDetach(false); | 121 base::win::SetShouldCrashOnProcessDetach(false); |
| 113 #endif | 122 #endif |
| 114 | 123 |
| 115 return rv; | 124 return rv; |
| 116 } | 125 } |
| OLD | NEW |