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

Unified Diff: printing/printing_context_mac.mm

Issue 7038010: [Mac] Allow NSExceptions in certain cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: printing/printing_context_mac.mm
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index a8e4fa048d4a1bfdde5908762788d363e08258b7..6b09a94c28520e8cfe0dcb3746dc3b7ffea6608b 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/mac/scoped_nsexception_enabler.h"
#include "base/sys_string_conversions.h"
#include "base/values.h"
#include "printing/print_settings_initializer_mac.h"
@@ -36,6 +37,15 @@ void PrintingContextMac::AskUserForSettings(gfx::NativeView parent_view,
int max_pages,
bool has_selection,
PrintSettingsCallback* callback) {
+ // Third-party print drivers seem to be an area prone to raising exceptions.
+ // This will allow exceptions to be raised, but does not handle them.
stuartmorgan 2011/05/17 18:52:14 I don't understand. Why would we *deliberately* al
Scott Hess - ex-Googler 2011/05/17 19:34:40 The primary benefit of making NSExceptions fatal i
+ // TODO(shess): Some experimentation indicates that uncaught exceptions can
+ // leave the print panel up, and any use after the exception will almost
+ // certainly crash on access to zombie objects, but simply _catching_ the
+ // exception doesn't resolve the problem, because you cannot easily dismiss
+ // the print panel from code. This situation doesn't seem right, to me.
+ base::mac::ScopedNSExceptionEnabler enabler(true);
+
DCHECK([NSThread isMainThread]);
// We deliberately don't feed max_pages into the dialog, because setting

Powered by Google App Engine
This is Rietveld 408576698