update_engine: Convert update_manager to chromeos::MessageLoop.
The update_manager/event_loop.* files were basically an abstraction of
the glib main loop in order to make it easier to replace it later.
This patch removes those files and replaces their functions with the
chromeos::MessageLoop interface, backing it up with a FakeMessageLoop
during test, and a real GlibMessageLoop during normal execution. This
patch reduces the running time of the unittest considerably since there
is no need to wait for the timeouts.
BUG=chromium:419827,chromium:402066
TEST=Unittest still pass. Tested on a link device that the UM still runs.
Change-Id: Id572248ff4c9c8be7226ef8c653a5c94ab9c1677
Reviewed-on: https://chromium-review.googlesource.com/276892
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/update_manager/evaluation_context.h b/update_manager/evaluation_context.h
index ecb37e0..3d259f3 100644
--- a/update_manager/evaluation_context.h
+++ b/update_manager/evaluation_context.h
@@ -14,10 +14,10 @@
#include <base/memory/ref_counted.h>
#include <base/memory/weak_ptr.h>
#include <base/time/time.h>
+#include <chromeos/message_loops/message_loop.h>
#include "update_engine/clock_interface.h"
#include "update_engine/update_manager/boxed_value.h"
-#include "update_engine/update_manager/event_loop.h"
#include "update_engine/update_manager/variable.h"
namespace chromeos_update_manager {
@@ -149,9 +149,10 @@
// is_expired().
std::unique_ptr<base::Closure> callback_;
- // The EventId returned by the event loop identifying the timeout callback.
+ // The TaskId returned by the message loop identifying the timeout callback.
// Used for canceling the timeout callback.
- EventId timeout_event_ = kEventIdNull;
+ chromeos::MessageLoop::TaskId timeout_event_ =
+ chromeos::MessageLoop::kTaskIdNull;
// Whether a timeout event firing marks the expiration of the evaluation
// context.