From 575a95d355333194e2f2e4981c6a18b0adc8226c Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Fri, 5 Aug 2011 04:10:54 +0000 Subject: cros: Remove unneeded includes from update_library.h plus some random cleanups. BUG=None TEST=None R=stevenjb@chromium.org Review URL: http://codereview.chromium.org/7575001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95574 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chromeos/cros/update_library.cc | 21 ++++++++++----------- chrome/browser/chromeos/cros/update_library.h | 19 ++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/chrome/browser/chromeos/cros/update_library.cc b/chrome/browser/chromeos/cros/update_library.cc index c59bc49..f897638 100644 --- a/chrome/browser/chromeos/cros/update_library.cc +++ b/chrome/browser/chromeos/cros/update_library.cc @@ -4,8 +4,9 @@ #include "chrome/browser/chromeos/cros/update_library.h" +#include "base/basictypes.h" #include "base/message_loop.h" -#include "base/string_util.h" +#include "base/observer_list.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "content/browser/browser_thread.h" @@ -13,16 +14,15 @@ namespace chromeos { class UpdateLibraryImpl : public UpdateLibrary { public: - UpdateLibraryImpl() - : status_connection_(NULL) { - if (CrosLibrary::Get()->EnsureLoaded()) { + UpdateLibraryImpl() : status_connection_(NULL) { + if (CrosLibrary::Get()->EnsureLoaded()) Init(); - } } virtual ~UpdateLibraryImpl() { if (status_connection_) { - DisconnectUpdateProgress(status_connection_); + chromeos::DisconnectUpdateProgress(status_connection_); + status_connection_ = NULL; } } @@ -66,14 +66,13 @@ class UpdateLibraryImpl : public UpdateLibrary { } private: - static void ChangedHandler(void* object, - const UpdateProgress& status) { - UpdateLibraryImpl* updater = static_cast(object); - updater->UpdateStatus(Status(status)); + static void ChangedHandler(void* object, const UpdateProgress& status) { + UpdateLibraryImpl* impl = static_cast(object); + impl->UpdateStatus(Status(status)); } void Init() { - status_connection_ = MonitorUpdateStatus(&ChangedHandler, this); + status_connection_ = chromeos::MonitorUpdateStatus(&ChangedHandler, this); // Asynchronously load the initial state. RequestUpdateStatus(&ChangedHandler, this); } diff --git a/chrome/browser/chromeos/cros/update_library.h b/chrome/browser/chromeos/cros/update_library.h index f0fb65d..e17934b 100644 --- a/chrome/browser/chromeos/cros/update_library.h +++ b/chrome/browser/chromeos/cros/update_library.h @@ -8,9 +8,6 @@ #include -#include "base/memory/singleton.h" -#include "base/observer_list.h" -#include "base/time.h" #include "third_party/cros/chromeos_update_engine.h" namespace chromeos { @@ -33,19 +30,19 @@ class UpdateLibrary { new_size(0) { } - explicit Status(const UpdateProgress& x) : - status(x.status_), - download_progress(x.download_progress_), - last_checked_time(x.last_checked_time_), - new_version(x.new_version_), - new_size(x.new_size_) { + explicit Status(const UpdateProgress& o) + : status(o.status_), + download_progress(o.download_progress_), + last_checked_time(o.last_checked_time_), + new_version(o.new_version_), + new_size(o.new_size_) { } UpdateStatusOperation status; - double download_progress; // 0.0 - 1.0 + double download_progress; // 0.0 - 1.0 int64_t last_checked_time; // As reported by std::time(). std::string new_version; - int64_t new_size; // Valid during DOWNLOADING, in bytes. + int64_t new_size; // Valid during DOWNLOADING, in bytes. }; class Observer { -- cgit v1.1