summaryrefslogtreecommitdiffstats
path: root/cc/surfaces
diff options
context:
space:
mode:
authordavidben <davidben@chromium.org>2016-01-20 17:08:38 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-21 01:10:07 +0000
commit3f37f7f1459e7b5a452c0e433493e0a6e9649ca7 (patch)
treed37f361db93e0f91fe3dedee38851941f5586020 /cc/surfaces
parent26a2b4883c04424a86abcda3d7333505eb1d032d (diff)
downloadchromium_src-3f37f7f1459e7b5a452c0e433493e0a6e9649ca7.zip
chromium_src-3f37f7f1459e7b5a452c0e433493e0a6e9649ca7.tar.gz
chromium_src-3f37f7f1459e7b5a452c0e433493e0a6e9649ca7.tar.bz2
Allow std::unordered_*.
base::hash_* is, as a transition step, implemented in terms of std::unordered_*. Later commits will convert existing uses. Also fix a host of IWYU problems that arose from this CL. (NOPRESUBMIT because the wstring presubmit check is overzealous and complains about the reference to wstring in the comment.) NOPRESUBMIT=true BUG=576864 TBR=derat@chromium.org,blundell@chromium.org,jbauman@chromium.org,dalecurtis@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1502373009 Cr-Commit-Position: refs/heads/master@{#370553}
Diffstat (limited to 'cc/surfaces')
-rw-r--r--cc/surfaces/surface_aggregator.cc9
-rw-r--r--cc/surfaces/surface_sequence.h3
2 files changed, 2 insertions, 10 deletions
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 9901d00..d60a217 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -526,16 +526,7 @@ gfx::Rect SurfaceAggregator::PrewalkTree(SurfaceId surface_id,
ResourceProvider::ResourceIdSet referenced_resources;
size_t reserve_size = frame_data->resource_list.size();
-#if defined(COMPILER_MSVC)
referenced_resources.reserve(reserve_size);
-#elif defined(COMPILER_GCC)
- // Pre-standard hash-tables only implement resize, which behaves similarly
- // to reserve for these keys. Resizing to 0 may also be broken (particularly
- // on stlport).
- // TODO(jbauman): Replace with reserve when C++11 is supported everywhere.
- if (reserve_size)
- referenced_resources.resize(reserve_size);
-#endif
bool invalid_frame = false;
ResourceProvider::ResourceIdMap empty_map;
diff --git a/cc/surfaces/surface_sequence.h b/cc/surfaces/surface_sequence.h
index 21decf6..b4ab8ef 100644
--- a/cc/surfaces/surface_sequence.h
+++ b/cc/surfaces/surface_sequence.h
@@ -11,6 +11,7 @@
#include <tuple>
#include "base/containers/hash_tables.h"
+#include "base/hash.h"
namespace cc {
@@ -46,7 +47,7 @@ namespace BASE_HASH_NAMESPACE {
template <>
struct hash<cc::SurfaceSequence> {
size_t operator()(cc::SurfaceSequence key) const {
- return base::HashPair(key.id_namespace, key.sequence);
+ return base::HashInts(key.id_namespace, key.sequence);
}
};
} // namespace BASE_HASH_NAMESPACE