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

Unified Diff: ui/base/clipboard/clipboard_mac.mm

Issue 1233983004: Remove base/mac/scoped_nsexception_enabler.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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: ui/base/clipboard/clipboard_mac.mm
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
index e42a49f772df65a209df6debc9b854fb0e6bfe74..62331947ddf0d4f1118cb3c19b960faad8d3fecb 100644
--- a/ui/base/clipboard/clipboard_mac.mm
+++ b/ui/base/clipboard/clipboard_mac.mm
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
-#import "base/mac/scoped_nsexception_enabler.h"
#include "base/mac/scoped_nsobject.h"
#include "base/stl_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -307,9 +306,12 @@ SkBitmap ClipboardMac::ReadImage(ClipboardType type) const {
// If the pasteboard's image data is not to its liking, the guts of NSImage
// may throw, and that exception will leak. Prevent a crash in that case;
// a blank image is better.
- base::scoped_nsobject<NSImage> image(base::mac::RunBlockIgnoringExceptions(^{
- return [[NSImage alloc] initWithPasteboard:GetPasteboard()];
- }));
+ base::scoped_nsobject<NSImage> image;
+ @try {
+ image.reset([[NSImage alloc] initWithPasteboard:GetPasteboard()]);
+ } @catch (id exception) {
+ }
+
SkBitmap bitmap;
if (image.get()) {
bitmap = gfx::NSImageToSkBitmapWithColorSpace(

Powered by Google App Engine
This is Rietveld 408576698