| 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 "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/common/features.h" | 8 #include "chrome/common/features.h" |
| 9 #include "content/public/app/content_main.h" | 9 #include "content/public/app/content_main.h" |
| 10 | 10 |
| 11 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 11 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "chrome/app/mash/mash_runner.h" | 13 #include "chrome/app/mash/mash_runner.h" |
| 14 #include "chrome/common/channel_info.h" |
| 15 #include "components/version_info/version_info.h" |
| 14 #endif | 16 #endif |
| 15 | 17 |
| 16 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
| 17 #include "base/debug/dump_without_crashing.h" | 19 #include "base/debug/dump_without_crashing.h" |
| 18 #include "base/win/win_util.h" | 20 #include "base/win/win_util.h" |
| 19 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
| 20 | 22 |
| 21 #define DLLEXPORT __declspec(dllexport) | 23 #define DLLEXPORT __declspec(dllexport) |
| 22 | 24 |
| 23 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. | 25 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); | 70 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); |
| 69 #else | 71 #else |
| 70 params.argc = argc; | 72 params.argc = argc; |
| 71 params.argv = argv; | 73 params.argv = argv; |
| 72 #endif | 74 #endif |
| 73 | 75 |
| 74 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | 76 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 75 #if !defined(OS_WIN) | 77 #if !defined(OS_WIN) |
| 76 base::CommandLine::Init(params.argc, params.argv); | 78 base::CommandLine::Init(params.argc, params.argv); |
| 77 #endif | 79 #endif |
| 78 const base::CommandLine& command_line = | 80 |
| 79 *base::CommandLine::ForCurrentProcess(); | 81 version_info::Channel channel = chrome::GetChannel(); |
| 80 // TODO(sky): only do this for dev builds and if on canary channel. | 82 if (channel == version_info::Channel::CANARY || |
| 81 if (command_line.HasSwitch("mash")) | 83 channel == version_info::Channel::UNKNOWN) { |
| 82 return MashMain(); | 84 const base::CommandLine& command_line = |
| 83 #endif | 85 *base::CommandLine::ForCurrentProcess(); |
| 86 if (command_line.HasSwitch("mash")) |
| 87 return MashMain(); |
| 88 } |
| 89 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 84 | 90 |
| 85 int rv = content::ContentMain(params); | 91 int rv = content::ContentMain(params); |
| 86 | 92 |
| 87 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
| 88 base::win::SetShouldCrashOnProcessDetach(false); | 94 base::win::SetShouldCrashOnProcessDetach(false); |
| 89 #endif | 95 #endif |
| 90 | 96 |
| 91 return rv; | 97 return rv; |
| 92 } | 98 } |
| OLD | NEW |