From c64e4007ee4561ec2ed3ce986191caf9b024ef55 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 25 Jan 2016 15:39:02 -0800 Subject: Remove CFX_SegmentedArray use from master. Replace with std::deque. Make member naming more consistent. R=ochang@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1618273004 . --- third_party/base/stl_util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'third_party') diff --git a/third_party/base/stl_util.h b/third_party/base/stl_util.h index 32656038c1..7f1d38bf40 100644 --- a/third_party/base/stl_util.h +++ b/third_party/base/stl_util.h @@ -5,6 +5,8 @@ #ifndef PDFIUM_THIRD_PARTY_BASE_STL_UTIL_H_ #define PDFIUM_THIRD_PARTY_BASE_STL_UTIL_H_ +#include "third_party/base/numerics/safe_conversions.h" + namespace pdfium { // Test to see if a set, map, hash_set or hash_map contains a particular key. @@ -22,6 +24,13 @@ bool ContainsValue(const Collection& collection, const Value& value) { collection.end(); } +// Convenience routine for "int-fected" code, so that the stl collection +// size_t size() method return values will be checked. +template +ResultType CollectionSize(const Collection& collection) { + return pdfium::base::checked_cast(collection.size()); +} + } // namespace pdfium #endif // PDFIUM_THIRD_PARTY_BASE_STL_UTIL_H_ -- cgit v1.2.3