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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 18674005: Fix a crash when built with 10.7 SDK running on OS X 10.6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
« 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: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 0a1aeaf2aa980020c38d4793ccf9183aac977091..758dab5234d4ef19014f69bac2da77d7b8c5e584 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -2378,11 +2378,18 @@ void RenderWidgetHostViewMac::FrameSwapped() {
NSNotificationCenter* notificationCenter =
[NSNotificationCenter defaultCenter];
+
+ // Backing property notifications crash on 10.6 when building with the 10.7
+ // SDK, see http://crbug.com/260595.
+ BOOL supportsBackingPropertiesNotification = base::mac::IsOSLionOrLater();
+
if (oldWindow) {
- [notificationCenter
- removeObserver:self
- name:NSWindowDidChangeBackingPropertiesNotification
- object:oldWindow];
+ if (supportsBackingPropertiesNotification) {
+ [notificationCenter
+ removeObserver:self
+ name:NSWindowDidChangeBackingPropertiesNotification
+ object:oldWindow];
+ }
[notificationCenter
removeObserver:self
name:NSWindowDidMoveNotification
@@ -2393,11 +2400,13 @@ void RenderWidgetHostViewMac::FrameSwapped() {
object:oldWindow];
}
if (newWindow) {
- [notificationCenter
- addObserver:self
- selector:@selector(windowDidChangeBackingProperties:)
- name:NSWindowDidChangeBackingPropertiesNotification
- object:newWindow];
+ if (supportsBackingPropertiesNotification) {
+ [notificationCenter
+ addObserver:self
+ selector:@selector(windowDidChangeBackingProperties:)
+ name:NSWindowDidChangeBackingPropertiesNotification
+ object:newWindow];
+ }
[notificationCenter
addObserver:self
selector:@selector(windowChangedGlobalFrame:)
« 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