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

Side by Side Diff: Source/modules/accessibility/AXObject.cpp

Issue 991863003: Avoid unnecessary copies of AccessibilityChildrenVector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 { 528 {
529 return isProgressIndicator() 529 return isProgressIndicator()
530 || isMeter() 530 || isMeter()
531 || isSlider() 531 || isSlider()
532 || isScrollbar() 532 || isScrollbar()
533 || isSpinButton(); 533 || isSpinButton();
534 } 534 }
535 535
536 void AXObject::ariaTreeRows(AccessibilityChildrenVector& result) 536 void AXObject::ariaTreeRows(AccessibilityChildrenVector& result)
537 { 537 {
538 AccessibilityChildrenVector axChildren = children(); 538 const AccessibilityChildrenVector& axChildren = children();
539 unsigned count = axChildren.size(); 539 unsigned count = axChildren.size();
540 for (unsigned k = 0; k < count; ++k) { 540 for (unsigned k = 0; k < count; ++k) {
541 AXObject* obj = axChildren[k].get(); 541 AXObject* obj = axChildren[k].get();
542 542
543 // Add tree items as the rows. 543 // Add tree items as the rows.
544 if (obj->roleValue() == TreeItemRole) 544 if (obj->roleValue() == TreeItemRole)
545 result.append(obj); 545 result.append(obj);
546 546
547 // Now see if this item also has rows hiding inside of it. 547 // Now see if this item also has rows hiding inside of it.
548 obj->ariaTreeRows(result); 548 obj->ariaTreeRows(result);
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 } 1117 }
1118 1118
1119 const AtomicString& AXObject::roleName(AccessibilityRole role) 1119 const AtomicString& AXObject::roleName(AccessibilityRole role)
1120 { 1120 {
1121 static const Vector<AtomicString>* roleNameVector = createRoleNameVector(); 1121 static const Vector<AtomicString>* roleNameVector = createRoleNameVector();
1122 1122
1123 return roleNameVector->at(role); 1123 return roleNameVector->at(role);
1124 } 1124 }
1125 1125
1126 } // namespace blink 1126 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.cpp ('k') | Source/modules/accessibility/AXObjectCacheImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698