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

Unified Diff: components/copresence/timed_map.h

Issue 813553002: Adding support for pre-sent messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@state
Patch Set: Switching to TimedMap Created 5 years, 11 months 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 | « components/copresence/rpc/rpc_handler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « components/copresence/rpc/rpc_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698