summaryrefslogtreecommitdiffstats
path: root/chrome/browser/mac
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 21:35:06 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 21:35:06 +0000
commitd37caed4cbb16c94dee3eb5544caee410613c9e0 (patch)
treeac15b07a1969eb8e71c13ca4fffba9df8bcd1d24 /chrome/browser/mac
parentf2fa94a7a75a95a41f5af7b6bf9ac28ac8a5a6d9 (diff)
downloadchromium_src-d37caed4cbb16c94dee3eb5544caee410613c9e0.zip
chromium_src-d37caed4cbb16c94dee3eb5544caee410613c9e0.tar.gz
chromium_src-d37caed4cbb16c94dee3eb5544caee410613c9e0.tar.bz2
[Mac] Allow NSTask exceptions w/in Keystone.
If /usr/bin/python is missing, an NSException is thrown on first run (when Keystone attempts to register). Keystone should be fixed to avoid the exception as much as possible, but meanwhile don't crash the browser on first run. BUG=86221 TEST=Remove/rename /usr/bin/python link and do a fresh install of Chrome. Should not crash, even though Keystone bundle is not installed. Review URL: http://codereview.chromium.org/7359003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mac')
-rw-r--r--chrome/browser/mac/keystone_glue.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm
index 5f7b641..2472312 100644
--- a/chrome/browser/mac/keystone_glue.mm
+++ b/chrome/browser/mac/keystone_glue.mm
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
+#include "base/mac/scoped_nsexception_enabler.h"
#include "base/memory/ref_counted.h"
#include "base/sys_string_conversions.h"
#include "base/task.h"
@@ -457,7 +458,15 @@ NSString* const kVersionKey = @"KSVersion";
[self updateStatus:kAutoupdateRegistering version:nil];
NSDictionary* parameters = [self keystoneParameters];
- if (![registration_ registerWithParameters:parameters]) {
+ BOOL result;
+ {
+ // TODO(shess): Allows Keystone to throw an exception when
+ // /usr/bin/python does not exist (really!).
+ // http://crbug.com/86221 and http://crbug.com/87931
+ base::mac::ScopedNSExceptionEnabler enabler;
+ result = [registration_ registerWithParameters:parameters];
+ }
+ if (!result) {
[self updateStatus:kAutoupdateRegisterFailed version:nil];
return;
}