Rename CommandQueue::DelayedRemove into RemoveLater()
Changed the method name to be more consistent with similar primitives
of base/ (e.g. MessageLoop::DeleteSoon).
Change-Id: I4038e3a77c014e0adf83a44baf770c834246b5a1
Reviewed-on: https://weave-review.googlesource.com/2429
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/commands/command_instance.cc b/src/commands/command_instance.cc
index fc9b0e7..590bbb1 100644
--- a/src/commands/command_instance.cc
+++ b/src/commands/command_instance.cc
@@ -284,7 +284,7 @@
void CommandInstance::RemoveFromQueue() {
if (queue_)
- queue_->DelayedRemove(GetID());
+ queue_->RemoveLater(GetID());
}
} // namespace weave
diff --git a/src/commands/command_queue.cc b/src/commands/command_queue.cc
index 134dc1c..cdb251f 100644
--- a/src/commands/command_queue.cc
+++ b/src/commands/command_queue.cc
@@ -88,7 +88,7 @@
Cleanup();
}
-void CommandQueue::DelayedRemove(const std::string& id) {
+void CommandQueue::RemoveLater(const std::string& id) {
auto p = map_.find(id);
if (p == map_.end())
return;
diff --git a/src/commands/command_queue.h b/src/commands/command_queue.h
index 0f0a18b..01839d8 100644
--- a/src/commands/command_queue.h
+++ b/src/commands/command_queue.h
@@ -51,7 +51,7 @@
// Selects command identified by |id| ready for removal. Command will actually
// be removed after some time.
- void DelayedRemove(const std::string& id);
+ void RemoveLater(const std::string& id);
// Finds a command instance in the queue by the instance |id|. Returns
// nullptr if the command with the given |id| is not found. The returned
diff --git a/src/commands/command_queue_unittest.cc b/src/commands/command_queue_unittest.cc
index b4c5938..fdb9e81 100644
--- a/src/commands/command_queue_unittest.cc
+++ b/src/commands/command_queue_unittest.cc
@@ -105,12 +105,12 @@
EXPECT_TRUE(queue_.IsEmpty());
}
-TEST_F(CommandQueueTest, DelayedRemove) {
+TEST_F(CommandQueueTest, RemoveLater) {
const std::string id1 = "id1";
queue_.Add(CreateDummyCommandInstance("base.reboot", id1));
EXPECT_EQ(1u, queue_.GetCount());
- queue_.DelayedRemove(id1);
+ queue_.RemoveLater(id1);
EXPECT_EQ(1u, queue_.GetCount());
Cleanup(base::TimeDelta::FromMinutes(1));