Chromium Code Reviews| Index: components/copresence/timed_map.h |
| diff --git a/components/copresence/timed_map.h b/components/copresence/timed_map.h |
| index 98e1517e73e92ac0c5a4bdff440386809637144d..2de553799e8586e5d3b693398ccef7840097da82 100644 |
| --- a/components/copresence/timed_map.h |
| +++ b/components/copresence/timed_map.h |
| @@ -52,6 +52,15 @@ class TimedMap { |
| return elt == map_.end() ? kEmptyValue : elt->second; |
| } |
| + ValueType* GetMutableValue(const KeyType& key) { |
| + ClearExpiredTokens(); |
| + return &map_[key]; |
|
rkc
2015/01/07 23:06:10
If the element doesn't exist, this will actually a
Charlie
2015/01/08 16:47:34
That's more consistent with the rest of the API -
|
| + } |
| + |
| + size_t Erase(const KeyType& key) { |
|
rkc
2015/01/07 23:06:10
Add a TODO to add a unit test to test this.
Charlie
2015/01/08 16:47:34
Done.
|
| + return map_.erase(key); |
| + } |
| + |
| void set_clock_for_testing(scoped_ptr<base::TickClock> clock) { |
| clock_ = clock.Pass(); |
| } |