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

Issue 7038010: [Mac] Allow NSExceptions in certain cases. (Closed)

Created:
9 years, 7 months ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
CC:
chromium-reviews, pam+watch_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

[Mac] Allow NSExceptions in certain cases. Thirdy-party print drivers seem to be a source of NSExceptions which Chromium will never be able to fix. ScopedNSExceptionEnabler causes the code which makes throwing an NSException fatal to allow throws. The flag will be reset in -reportException: in most cases. For now, allow exceptions to be thrown for -selectPDE: (bug 80686) and PrintingContextMac::AskUserForSettings() (bug 82589). BUG=80686, 82589 TEST=Monitor crash server. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86503

Patch Set 1 #

Total comments: 11

Patch Set 2 : Oops, sense of test was inverted. #

Patch Set 3 : Shift scoped allow closer to super call. #

Patch Set 4 : Local autorelease pool to force exceptions into the right handling context. #

Total comments: 4

Patch Set 5 : Comment and order cleanup for Mark. #

Patch Set 6 : Move crash-key scoper back by crash-key setup code. #

Total comments: 13

Patch Set 7 : Mark is a harsh (but fair) taskmaster. #

Total comments: 2

Patch Set 8 : Use scoped_ptr for optional exception enabling. #

Patch Set 9 : Oh, clang, you crazy fox. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -2 lines) Patch
M base/base.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A base/mac/scoped_nsexception_enabler.h View 1 2 3 4 5 6 7 8 1 chunk +46 lines, -0 lines 0 comments Download
A base/mac/scoped_nsexception_enabler.mm View 1 2 3 4 5 6 7 1 chunk +44 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_application_mac.mm View 1 2 3 4 5 6 7 5 chunks +24 lines, -2 lines 0 comments Download
M printing/printing_context_mac.mm View 1 2 3 4 5 6 7 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Scott Hess - ex-Googler
I'm not super enthusiastic about this, but it seems likely that we'll just have to ...
9 years, 7 months ago (2011-05-17 18:38:17 UTC) #1
stuartmorgan
http://codereview.chromium.org/7038010/diff/1/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): http://codereview.chromium.org/7038010/diff/1/chrome/browser/chrome_browser_application_mac.mm#newcode374 chrome/browser/chrome_browser_application_mac.mm:374: base::mac::SetNSExceptionsAllowed(false); Given that you've designed these to nest arbitrarily, ...
9 years, 7 months ago (2011-05-17 18:52:14 UTC) #2
Mark Mentovai
I have a couple extra things to say, but Stuart seems to be asking the ...
9 years, 7 months ago (2011-05-17 19:07:34 UTC) #3
Scott Hess - ex-Googler
http://codereview.chromium.org/7038010/diff/1/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): http://codereview.chromium.org/7038010/diff/1/chrome/browser/chrome_browser_application_mac.mm#newcode98 chrome/browser/chrome_browser_application_mac.mm:98: if (fatal && allow) { On 2011/05/17 19:07:34, Mark ...
9 years, 7 months ago (2011-05-17 19:34:40 UTC) #4
Scott Hess - ex-Googler
http://codereview.chromium.org/7038010/diff/1/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): http://codereview.chromium.org/7038010/diff/1/chrome/browser/chrome_browser_application_mac.mm#newcode98 chrome/browser/chrome_browser_application_mac.mm:98: if (fatal && allow) { On 2011/05/17 19:34:40, shess ...
9 years, 7 months ago (2011-05-17 20:00:44 UTC) #5
Scott Hess - ex-Googler
Per my updates on http://crbug.com/82589 , I figured out a way to replicate the problem ...
9 years, 7 months ago (2011-05-17 22:19:19 UTC) #6
Mark Mentovai
http://codereview.chromium.org/7038010/diff/1012/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): http://codereview.chromium.org/7038010/diff/1012/chrome/browser/chrome_browser_application_mac.mm#newcode345 chrome/browser/chrome_browser_application_mac.mm:345: ScopedCrashKey key(kActionKey, value); Can’t this precede ScopedNSExceptionEnabler? You can ...
9 years, 7 months ago (2011-05-17 22:23:27 UTC) #7
Scott Hess - ex-Googler
http://codereview.chromium.org/7038010/diff/1012/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): http://codereview.chromium.org/7038010/diff/1012/chrome/browser/chrome_browser_application_mac.mm#newcode345 chrome/browser/chrome_browser_application_mac.mm:345: ScopedCrashKey key(kActionKey, value); On 2011/05/17 22:23:27, Mark Mentovai wrote: ...
9 years, 7 months ago (2011-05-17 22:48:30 UTC) #8
Mark Mentovai
I'm saying to order it this way: 1. Logic to decide what to do with ...
9 years, 7 months ago (2011-05-18 00:07:26 UTC) #9
Scott Hess - ex-Googler
Sorry, got distracted by SQLite 3.7.6.2. Super fun. No compelling reason not to put the ...
9 years, 7 months ago (2011-05-23 23:45:13 UTC) #10
Mark Mentovai
LGTM http://codereview.chromium.org/7038010/diff/7001/base/mac/scoped_nsexception_enabler.h File base/mac/scoped_nsexception_enabler.h (right): http://codereview.chromium.org/7038010/diff/7001/base/mac/scoped_nsexception_enabler.h#newcode14 base/mac/scoped_nsexception_enabler.h:14: // ChromeBrowserApplication attempts to restrict throwing of Did ...
9 years, 7 months ago (2011-05-24 00:05:16 UTC) #11
Mark Mentovai
Since you initially chose Stuart as a reviewer, make sure he’s satisfied as well. Stuart?
9 years, 7 months ago (2011-05-24 00:06:56 UTC) #12
Scott Hess - ex-Googler
http://codereview.chromium.org/7038010/diff/7001/base/mac/scoped_nsexception_enabler.h File base/mac/scoped_nsexception_enabler.h (right): http://codereview.chromium.org/7038010/diff/7001/base/mac/scoped_nsexception_enabler.h#newcode14 base/mac/scoped_nsexception_enabler.h:14: // ChromeBrowserApplication attempts to restrict throwing of On 2011/05/24 ...
9 years, 7 months ago (2011-05-24 00:31:25 UTC) #13
Mark Mentovai
http://codereview.chromium.org/7038010/diff/7001/chrome/browser/chrome_browser_application_mac.mm File chrome/browser/chrome_browser_application_mac.mm (right): http://codereview.chromium.org/7038010/diff/7001/chrome/browser/chrome_browser_application_mac.mm#newcode341 chrome/browser/chrome_browser_application_mac.mm:341: if (anAction == @selector(selectPDE:)) { shess wrote: > On ...
9 years, 7 months ago (2011-05-24 00:39:05 UTC) #14
stuartmorgan
http://codereview.chromium.org/7038010/diff/13001/base/mac/scoped_nsexception_enabler.h File base/mac/scoped_nsexception_enabler.h (right): http://codereview.chromium.org/7038010/diff/13001/base/mac/scoped_nsexception_enabler.h#newcode31 base/mac/scoped_nsexception_enabler.h:31: // |scoped_ptr<ScopedNSExceptionEnabler>|). I'm not at all convinced that scoped_ptr ...
9 years, 7 months ago (2011-05-24 00:54:42 UTC) #15
stuartmorgan
(If you feel strongly about keeping this structure, then the bool needs to at least ...
9 years, 7 months ago (2011-05-24 00:59:14 UTC) #16
Scott Hess - ex-Googler
http://codereview.chromium.org/7038010/diff/13001/base/mac/scoped_nsexception_enabler.h File base/mac/scoped_nsexception_enabler.h (right): http://codereview.chromium.org/7038010/diff/13001/base/mac/scoped_nsexception_enabler.h#newcode31 base/mac/scoped_nsexception_enabler.h:31: // |scoped_ptr<ScopedNSExceptionEnabler>|). On 2011/05/24 00:54:42, stuartmorgan wrote: > I ...
9 years, 7 months ago (2011-05-24 19:38:09 UTC) #17
stuartmorgan
LGTM
9 years, 7 months ago (2011-05-24 20:18:31 UTC) #18
commit-bot: I haz the power
9 years, 7 months ago (2011-05-24 22:07:06 UTC) #19
Change committed as 86503

Powered by Google App Engine
This is Rietveld 408576698