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

Unified Diff: chrome/browser/chrome_browser_main_mac.mm

Issue 10377173: Do Keychain reauthorization at update time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « chrome/app/breakpad_mac.mm ('k') | chrome/browser/mac/keychain_reauthorize.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_mac.mm
===================================================================
--- chrome/browser/chrome_browser_main_mac.mm (revision 137420)
+++ chrome/browser/chrome_browser_main_mac.mm (working copy)
@@ -55,6 +55,30 @@
}
void ChromeBrowserMainPartsMac::PreEarlyInitialization() {
+ if (parsed_command_line().HasSwitch(switches::kKeychainReauthorize)) {
+ if (base::mac::AmIBundled()) {
+ LOG(FATAL) << "Inappropriate process type for Keychain reauthorization";
+ }
+
+ // Do Keychain reauthorization at the time of update installation. This
+ // gets three chances to run. If the first or second try doesn't complete
+ // successfully (crashes or is interrupted for any reason), there will be
+ // another chance. Once this step completes successfully, it should never
+ // have to run again.
+ //
+ // This is kicked off by a special stub executable during an automatic
+ // update. See chrome/installer/mac/keychain_reauthorize_main.cc. This is
+ // done during update installation in additon to browser app launch to
+ // help reauthorize Keychain items for users who never restart Chrome.
+ NSString* const keychain_reauthorize_pref =
+ @"KeychainReauthorizeAtUpdateMay2012";
TVL 2012/05/16 20:05:10 comment on when this key should be updated/changed
+ const int kKeychainReauthorizeMaxTries = 3;
+ chrome::browser::mac::KeychainReauthorizeIfNeeded(
+ keychain_reauthorize_pref, kKeychainReauthorizeMaxTries);
+
+ exit(0);
+ }
+
ChromeBrowserMainPartsPosix::PreEarlyInitialization();
if (base::mac::WasLaunchedAsHiddenLoginItem()) {
@@ -137,10 +161,10 @@
[[NSUserDefaults standardUserDefaults]
setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"];
- // Do Keychain reauthorization. This gets two chances to run. If the first
- // try doesn't complete successfully (crashes or is interrupted for any
- // reason), there will be a second chance. Once this step completes
- // successfully, it should never have to run again.
+ // Do Keychain reauthorization at browser app launch. This gets two chances
+ // to run. If the first try doesn't complete successfully (crashes or is
+ // interrupted for any reason), there will be a second chance. Once this
+ // step completes successfully, it should never have to run again.
NSString* const keychain_reauthorize_pref =
@"KeychainReauthorizeInAppMay2012";
TVL 2012/05/16 20:05:10 same comment. Might even make sense to move the c
const int kKeychainReauthorizeMaxTries = 2;
« no previous file with comments | « chrome/app/breakpad_mac.mm ('k') | chrome/browser/mac/keychain_reauthorize.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698