Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: chrome/app/chrome_dll_main.cc

Issue 3171027: [Mac] Enforce proper usage of main app bundle and helper app bundle.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/in_process_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_dll_main.cc
===================================================================
--- chrome/app/chrome_dll_main.cc (revision 57207)
+++ chrome/app/chrome_dll_main.cc (working copy)
@@ -648,6 +648,26 @@
}
}
+#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
« no previous file with comments | « no previous file | chrome/test/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698