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

Unified Diff: Source/core/css/CSSValueList.h

Issue 333163004: Remove explicit bounds check from CSSValueList::item (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comment Created 6 years, 6 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 | « Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl ('k') | Source/core/css/CSSValueList.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValueList.h
diff --git a/Source/core/css/CSSValueList.h b/Source/core/css/CSSValueList.h
index 2d34b4f940694490a4d2566a0ec8e0bd7c9d520b..62d1db4fe4aecabcd532b75867b5722317c5cf8e 100644
--- a/Source/core/css/CSSValueList.h
+++ b/Source/core/css/CSSValueList.h
@@ -49,9 +49,9 @@ public:
}
size_t length() const { return m_values.size(); }
- CSSValue* item(size_t index) { return index < m_values.size() ? m_values[index].get() : 0; }
- const CSSValue* item(size_t index) const { return index < m_values.size() ? m_values[index].get() : 0; }
- CSSValue* itemWithoutBoundsCheck(size_t index) { return m_values[index].get(); }
+ CSSValue* item(size_t index) { return m_values[index].get(); }
+ const CSSValue* item(size_t index) const { return m_values[index].get(); }
+ CSSValue* itemWithBoundsCheck(size_t index) { return index < m_values.size() ? m_values[index].get() : 0; }
void append(PassRefPtrWillBeRawPtr<CSSValue> value) { m_values.append(value); }
void prepend(PassRefPtrWillBeRawPtr<CSSValue> value) { m_values.prepend(value); }
@@ -88,7 +88,7 @@ class CSSValueListInspector {
STACK_ALLOCATED();
public:
CSSValueListInspector(CSSValue* value) : m_list((value && value->isValueList()) ? toCSSValueList(value) : 0) { }
- CSSValue* item(size_t index) const { ASSERT_WITH_SECURITY_IMPLICATION(index < length()); return m_list->itemWithoutBoundsCheck(index); }
+ CSSValue* item(size_t index) const { ASSERT_WITH_SECURITY_IMPLICATION(index < length()); return m_list->item(index); }
CSSValue* first() const { return item(0); }
CSSValue* second() const { return item(1); }
size_t length() const { return m_list ? m_list->length() : 0; }
« no previous file with comments | « Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl ('k') | Source/core/css/CSSValueList.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698