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

Unified Diff: cc/surfaces/surface_sequence.h

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « cc/surfaces/surface_manager.cc ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_sequence.h
diff --git a/cc/surfaces/surface_sequence.h b/cc/surfaces/surface_sequence.h
index 4c99e458587d65065c68f206a2d0e2d156a71410..72f4bc9926fa5bf468ceab70b6513de466ea2ddd 100644
--- a/cc/surfaces/surface_sequence.h
+++ b/cc/surfaces/surface_sequence.h
@@ -5,6 +5,8 @@
#ifndef CC_SURFACES_SURFACE_SEQUENCE_H_
#define CC_SURFACES_SURFACE_SEQUENCE_H_
+#include "base/containers/hash_tables.h"
+
namespace cc {
// A per-surface-namespace sequence number that's used to coordinate
@@ -14,6 +16,7 @@ struct SurfaceSequence {
SurfaceSequence() : id_namespace(0u), sequence(0u) {}
SurfaceSequence(uint32_t id_namespace, uint32_t sequence)
: id_namespace(id_namespace), sequence(sequence) {}
+ bool is_null() const { return id_namespace == 0u && sequence == 0u; }
uint32_t id_namespace;
uint32_t sequence;
@@ -35,4 +38,13 @@ inline bool operator<(const SurfaceSequence& a, const SurfaceSequence& b) {
} // namespace cc
+namespace BASE_HASH_NAMESPACE {
+template <>
+struct hash<cc::SurfaceSequence> {
+ size_t operator()(cc::SurfaceSequence key) const {
+ return base::HashPair(key.id_namespace, key.sequence);
+ }
+};
+} // namespace BASE_HASH_NAMESPACE
+
#endif // CC_SURFACES_SURFACE_SEQUENCE_H_
« no previous file with comments | « cc/surfaces/surface_manager.cc ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698