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

Unified Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 2435863002: Wrap -[BrowserCrApplication nextEventMatchingMask:…] with base::mac::CallWithEHFrame. (Closed)
Patch Set: NSEventMask problem Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_application_mac.mm
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index a332cb17c4053ccfd86da5a91d7b6229b7f0ee67..0143022ba75d7190b264d5c862f6e052df9f519e 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -266,6 +266,31 @@ void CancelTerminate() {
[appController stopTryingToTerminateApplication:self];
}
+// The event |mask| has historically been declared as an NSUInteger
+// (unsigned long). Starting in the 10.12 SDK, the mask type changed to
+// NSEventMask (unsigned long long) if __LP64__ and NSUInteger otherwise.
+// These types are incompatible, which creates an issue for suppporting
+// both 10.10/10.11 and 10.12 SDKs. Work around it using the #if below.
+- (NSEvent*)nextEventMatchingMask:
+#if !defined(MAC_OS_X_VERSION_10_12) || \
Mark Mentovai 2016/10/19 23:01:39 #include <AvailabilityMacros.h>
Robert Sesek 2016/10/19 23:22:12 Done.
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
Mark Mentovai 2016/10/19 23:01:39 Match what the SDK does by working __LP64__ into t
Robert Sesek 2016/10/19 23:22:12 That would be exciting. Done.
+ (NSUInteger)mask
+#else
+ (NSEventMask)mask
+#endif
+ untilDate:(NSDate*)expiration
+ inMode:(NSString*)mode
+ dequeue:(BOOL)dequeue {
+ __block NSEvent* event = nil;
+ base::mac::CallWithEHFrame(^{
+ event = [super nextEventMatchingMask:mask
+ untilDate:expiration
+ inMode:mode
+ dequeue:dequeue];
+ });
+ return event;
+}
+
- (BOOL)sendAction:(SEL)anAction to:(id)aTarget from:(id)sender {
// The Dock menu contains an automagic section where you can select
// amongst open windows. If a window is closed via JavaScript while
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698