summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-24 20:50:06 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-24 20:50:06 +0000
commit32369d763913881d4afbab0ef8c6c769d22cad96 (patch)
treecabbec8429c804d0c79b88eafbe582594287b1e0 /chrome/app
parent152ac9277a9d77a3a2a9c4adc773ef8f211f6921 (diff)
downloadchromium_src-32369d763913881d4afbab0ef8c6c769d22cad96.zip
chromium_src-32369d763913881d4afbab0ef8c6c769d22cad96.tar.gz
chromium_src-32369d763913881d4afbab0ef8c6c769d22cad96.tar.bz2
[Mac] Enforce proper usage of main app bundle and helper app bundle.
- Add a check to make sure the helper isn't used without --type - Add a check to make sure the main app isn't used with --type. - Make inproc browser tests invoke the helper that is within the app bundle on disk to recreate the real world environment. BUG=23645,52858 TEST=green tree, invoking the main app with --type fails, and invoking the helper without it fails. Review URL: http://codereview.chromium.org/3171027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/chrome_dll_main.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 487d781..d65908c 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -648,6 +648,26 @@ int ChromeMain(int argc, char** argv) {
}
}
+#if defined(OS_MACOSX)
+ // Mac Chrome is packaged with a main app bundle and a helper app bundle.
+ // The main app bundle should only be used for the browser process, so it
+ // should never see a --type switch (switches::kProcessType). Likewise,
+ // the helper should always have a --type switch.
+ //
+ // This check is done this late so there is already a call to
+ // mac_util::IsBackgroundOnlyProcess(), so there is no change in
+ // startup/initialization order.
+
+ // The helper's Info.plist marks it as a background only app.
+ if (mac_util::IsBackgroundOnlyProcess()) {
+ CHECK(parsed_command_line.HasSwitch(switches::kProcessType))
+ << "Helper application requires --type.";
+ } else {
+ CHECK(!parsed_command_line.HasSwitch(switches::kProcessType))
+ << "Main application forbids --type, saw \"" << process_type << "\".";
+ }
+#endif // defined(OS_MACOSX)
+
if (IsCrashReporterEnabled())
InitCrashProcessInfo();
#endif // OS_MACOSX