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

Side by Side Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 58993002: Fix crash when system retains an accessibility object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: real fix Created 7 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <execinfo.h> 5 #include <execinfo.h>
6 6
7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 7 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 // Returns the deepest accessibility child that should not be ignored. 1414 // Returns the deepest accessibility child that should not be ignored.
1415 // It is assumed that the hit test has been narrowed down to this object 1415 // It is assumed that the hit test has been narrowed down to this object
1416 // or one of its children, so this will never return nil unless this 1416 // or one of its children, so this will never return nil unless this
1417 // object is invalid. 1417 // object is invalid.
1418 - (id)accessibilityHitTest:(NSPoint)point { 1418 - (id)accessibilityHitTest:(NSPoint)point {
1419 if (!browserAccessibility_) 1419 if (!browserAccessibility_)
1420 return nil; 1420 return nil;
1421 1421
1422 BrowserAccessibilityCocoa* hit = self; 1422 BrowserAccessibilityCocoa* hit = self;
1423 for (BrowserAccessibilityCocoa* child in [self children]) { 1423 for (BrowserAccessibilityCocoa* child in [self children]) {
1424 if (!child->browserAccessibility_)
1425 continue;
1424 NSPoint origin = [child origin]; 1426 NSPoint origin = [child origin];
1425 NSSize size = [[child size] sizeValue]; 1427 NSSize size = [[child size] sizeValue];
1426 NSRect rect; 1428 NSRect rect;
1427 rect.origin = origin; 1429 rect.origin = origin;
1428 rect.size = size; 1430 rect.size = size;
1429 if (NSPointInRect(point, rect)) { 1431 if (NSPointInRect(point, rect)) {
1430 hit = child; 1432 hit = child;
1431 id childResult = [child accessibilityHitTest:point]; 1433 id childResult = [child accessibilityHitTest:point];
1432 if (![childResult accessibilityIsIgnored]) { 1434 if (![childResult accessibilityIsIgnored]) {
1433 hit = childResult; 1435 hit = childResult;
(...skipping 16 matching lines...) Expand all
1450 return [super hash]; 1452 return [super hash];
1451 return browserAccessibility_->renderer_id(); 1453 return browserAccessibility_->renderer_id();
1452 } 1454 }
1453 1455
1454 - (BOOL)accessibilityShouldUseUniqueId { 1456 - (BOOL)accessibilityShouldUseUniqueId {
1455 return YES; 1457 return YES;
1456 } 1458 }
1457 1459
1458 @end 1460 @end
1459 1461
OLDNEW
« 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