| Index: cc/trees/element_id.cc
|
| diff --git a/cc/trees/element_id.cc b/cc/trees/element_id.cc
|
| index 45913303c1019dfa9c36113d6a11fffae12c1bfb..6e32b660aa53b4b69acc5371aa27441193b809a0 100644
|
| --- a/cc/trees/element_id.cc
|
| +++ b/cc/trees/element_id.cc
|
| @@ -13,7 +13,7 @@
|
| namespace cc {
|
|
|
| bool ElementId::operator==(const ElementId& o) const {
|
| - return primaryId == o.primaryId && secondaryId == o.secondaryId;
|
| + return id_ == o.id_;
|
| }
|
|
|
| bool ElementId::operator!=(const ElementId& o) const {
|
| @@ -21,36 +21,33 @@ bool ElementId::operator!=(const ElementId& o) const {
|
| }
|
|
|
| bool ElementId::operator<(const ElementId& o) const {
|
| - return std::tie(primaryId, secondaryId) <
|
| - std::tie(o.primaryId, o.secondaryId);
|
| + return id_ < o.id_;
|
| }
|
|
|
| ElementId::operator bool() const {
|
| - return !!primaryId;
|
| + return !!id_;
|
| }
|
|
|
| ElementId LayerIdToElementIdForTesting(int layer_id) {
|
| - return ElementId(std::numeric_limits<int>::max() - layer_id, 0);
|
| + return ElementId(std::numeric_limits<int>::max() - layer_id);
|
| }
|
|
|
| void ElementId::AddToTracedValue(base::trace_event::TracedValue* res) const {
|
| - res->SetInteger("primaryId", primaryId);
|
| - res->SetInteger("secondaryId", secondaryId);
|
| + res->SetInteger("id_", id_);
|
| }
|
|
|
| std::unique_ptr<base::Value> ElementId::AsValue() const {
|
| std::unique_ptr<base::DictionaryValue> res(new base::DictionaryValue());
|
| - res->SetInteger("primaryId", primaryId);
|
| - res->SetInteger("secondaryId", secondaryId);
|
| + res->SetInteger("id_", id_);
|
| return std::move(res);
|
| }
|
|
|
| size_t ElementIdHash::operator()(ElementId key) const {
|
| - return base::HashInts(key.primaryId, key.secondaryId);
|
| + return std::hash<int>()(key.id_);
|
| }
|
|
|
| std::ostream& operator<<(std::ostream& out, const ElementId& id) {
|
| - return out << "(" << id.primaryId << ", " << id.secondaryId << ")";
|
| + return out << "(" << id.id_ << ")";
|
| }
|
|
|
| } // namespace cc
|
|
|