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

Unified Diff: chromeos/dbus/fake_update_engine_client.cc

Issue 2081873002: Incorporate comments in Dbus code and add Eol icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wrap the include with #if defined(OS_CHROMEOS). Created 4 years, 6 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 | « chromeos/dbus/fake_update_engine_client.h ('k') | chromeos/dbus/update_engine_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_update_engine_client.cc
diff --git a/chromeos/dbus/fake_update_engine_client.cc b/chromeos/dbus/fake_update_engine_client.cc
index 7add9236554455643f3fd87e2280b4b804c633fd..eb6b69a43f48bd1ab3f5af4fb477028b1a00becd 100644
--- a/chromeos/dbus/fake_update_engine_client.cc
+++ b/chromeos/dbus/fake_update_engine_client.cc
@@ -4,6 +4,9 @@
#include "chromeos/dbus/fake_update_engine_client.h"
+#include "base/bind.h"
+#include "base/threading/thread_task_runner_handle.h"
+
namespace chromeos {
FakeUpdateEngineClient::FakeUpdateEngineClient()
@@ -12,8 +15,8 @@ FakeUpdateEngineClient::FakeUpdateEngineClient()
reboot_after_update_call_count_(0),
request_update_check_call_count_(0),
rollback_call_count_(0),
- can_rollback_call_count_(0) {
-}
+ can_rollback_call_count_(0),
+ weak_ptr_factory_(this) {}
FakeUpdateEngineClient::~FakeUpdateEngineClient() {
}
@@ -73,10 +76,17 @@ void FakeUpdateEngineClient::SetChannel(const std::string& target_channel,
void FakeUpdateEngineClient::GetChannel(bool get_current_channel,
const GetChannelCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FakeUpdateEngineClient::OnGetChannel,
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void FakeUpdateEngineClient::GetEolStatus(
- const GetEolStatusCallback& callback) {}
+ const GetEolStatusCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&FakeUpdateEngineClient::OnGetEolStatus,
+ weak_ptr_factory_.GetWeakPtr(), callback));
+}
void FakeUpdateEngineClient::set_default_status(
const UpdateEngineClient::Status& status) {
@@ -88,4 +98,13 @@ void FakeUpdateEngineClient::set_update_check_result(
update_check_result_ = result;
}
+void FakeUpdateEngineClient::OnGetChannel(const GetChannelCallback& callback) {
hashimoto 2016/06/23 05:12:48 You don't need these methods and weak_ptr_factory_
+ callback.Run("");
+}
+
+void FakeUpdateEngineClient::OnGetEolStatus(
+ const GetEolStatusCallback& callback) {
+ callback.Run(update_engine::EndOfLifeStatus::kSupported);
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/fake_update_engine_client.h ('k') | chromeos/dbus/update_engine_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698