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

Side by Side Diff: Source/modules/accessibility/AXObjectCacheImpl.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
« no previous file with comments | « Source/modules/accessibility/AXObject.cpp ('k') | Source/modules/accessibility/AXTable.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014, Google Inc. All rights reserved. 2 * Copyright (C) 2014, Google 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return 0; 120 return 0;
121 121
122 HTMLImageElement* imageElement = areaElement->imageElement(); 122 HTMLImageElement* imageElement = areaElement->imageElement();
123 if (!imageElement) 123 if (!imageElement)
124 return 0; 124 return 0;
125 125
126 AXObject* axLayoutImage = getOrCreate(imageElement); 126 AXObject* axLayoutImage = getOrCreate(imageElement);
127 if (!axLayoutImage) 127 if (!axLayoutImage)
128 return 0; 128 return 0;
129 129
130 AXObject::AccessibilityChildrenVector imageChildren = axLayoutImage->childre n(); 130 const AXObject::AccessibilityChildrenVector& imageChildren = axLayoutImage-> children();
131 unsigned count = imageChildren.size(); 131 unsigned count = imageChildren.size();
132 for (unsigned k = 0; k < count; ++k) { 132 for (unsigned k = 0; k < count; ++k) {
133 AXObject* child = imageChildren[k].get(); 133 AXObject* child = imageChildren[k].get();
134 if (!child->isImageMapLink()) 134 if (!child->isImageMapLink())
135 continue; 135 continue;
136 136
137 if (toAXImageMapLink(child)->areaElement() == areaElement) 137 if (toAXImageMapLink(child)->areaElement() == areaElement)
138 return child; 138 return child;
139 } 139 }
140 140
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) 1121 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect)
1122 { 1122 {
1123 AXObject* obj = getOrCreate(element); 1123 AXObject* obj = getOrCreate(element);
1124 if (!obj) 1124 if (!obj)
1125 return; 1125 return;
1126 1126
1127 obj->setElementRect(rect); 1127 obj->setElementRect(rect);
1128 } 1128 }
1129 1129
1130 } // namespace blink 1130 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObject.cpp ('k') | Source/modules/accessibility/AXTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698