From cb0746a88f5a804a79761abc1e5f4ef3704d0439 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 22 Jul 2013 17:04:51 +0000 Subject: [PATCH] Mac: Fix crash on 10.6 when building with the 10.7 SDK (issue #1026). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1547@1326 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- patch/patch.cfg | 6 ++++ patch/patches/renderer_host_1026.patch | 50 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 patch/patches/renderer_host_1026.patch diff --git a/patch/patch.cfg b/patch/patch.cfg index 89204b340..5a5db6d76 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -56,6 +56,12 @@ patches = [ 'name': 'power_monitor_642', 'path': '../base/power_monitor/', }, + { + # Fix crash on 10.6 when building with the 10.7 SDK + # http://code.google.com/p/chromiumembedded/issues/detail?id=1026 + 'name': 'renderer_host_1026', + 'path': '../content/browser/renderer_host/', + }, { # http://code.google.com/p/chromiumembedded/issues/detail?id=364 'name': 'spi_webcore_364', diff --git a/patch/patches/renderer_host_1026.patch b/patch/patches/renderer_host_1026.patch new file mode 100644 index 000000000..b8ec5e0f4 --- /dev/null +++ b/patch/patches/renderer_host_1026.patch @@ -0,0 +1,50 @@ +Index: render_widget_host_view_mac.mm +=================================================================== +--- render_widget_host_view_mac.mm (revision 211613) ++++ render_widget_host_view_mac.mm (working copy) +@@ -2380,13 +2380,20 @@ + + 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) { ++ if (supportsBackingPropertiesNotification) { ++ [notificationCenter ++ removeObserver:self ++ name:NSWindowDidChangeBackingPropertiesNotification ++ object:oldWindow]; ++ } + [notificationCenter + removeObserver:self +- name:NSWindowDidChangeBackingPropertiesNotification +- object:oldWindow]; +- [notificationCenter +- removeObserver:self + name:NSWindowDidMoveNotification + object:oldWindow]; + [notificationCenter +@@ -2395,13 +2402,15 @@ + object:oldWindow]; + } + if (newWindow) { ++ if (supportsBackingPropertiesNotification) { ++ [notificationCenter ++ addObserver:self ++ selector:@selector(windowDidChangeBackingProperties:) ++ name:NSWindowDidChangeBackingPropertiesNotification ++ object:newWindow]; ++ } + [notificationCenter + addObserver:self +- selector:@selector(windowDidChangeBackingProperties:) +- name:NSWindowDidChangeBackingPropertiesNotification +- object:newWindow]; +- [notificationCenter +- addObserver:self + selector:@selector(windowChangedGlobalFrame:) + name:NSWindowDidMoveNotification + object:newWindow];