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

Unified Diff: chrome/browser/chromeos/system/syslogs_fetcher.h

Issue 10827130: Refactoring the SysInfoProvider. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
Index: chrome/browser/chromeos/system/syslogs_fetcher.h
diff --git a/chrome/browser/chromeos/system/syslogs_fetcher.h b/chrome/browser/chromeos/system/syslogs_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff4813ea81c4d59965cb0d24d93344eda9f96cf2
--- /dev/null
+++ b/chrome/browser/chromeos/system/syslogs_fetcher.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_FETCHER_H_
+#define CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_FETCHER_H_
+
+#include <string>
+#include <map>
+#include <vector>
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/callback.h"
+#include "base/memory/singleton.h"
+#include "base/synchronization/lock.h"
rkc1 2012/08/04 01:15:05 Clean up the includes you don't need. Do this for
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+
+namespace chromeos {
+namespace system {
+
+typedef std::map<std::string, std::string> SysInfoResponse;
rkc1 2012/08/04 01:15:05 Nit: Rename.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+typedef base::Callback<void(SysInfoResponse*)> SysLogsFetcherCallback;
+
+class SysLogsInterface {
+ public:
+ virtual void Fetch(SysLogsFetcherCallback) = 0;
+ virtual ~SysLogsInterface() {}
+};
+
+typedef std::vector <SysLogsInterface*> SysLogsDataSources;
rkc1 2012/08/04 01:15:05 vector<
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+
+class SysLogsFetcher {
rkc1 2012/08/04 01:15:05 Add a header comment explaining, a.) Class usage b
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ public:
+ explicit SysLogsFetcher(SysLogsDataSources);
+ ~SysLogsFetcher() {}
+ void Fetch(SysLogsFetcherCallback);
rkc1 2012/08/04 01:15:05 New line after.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ private:
+ SysLogsFetcherCallback request_;
rkc1 2012/08/04 01:15:05 Add comments, lots of them :)
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ SysLogsDataSources data_sources_;
+ SysInfoResponse* response_;
rkc1 2012/08/04 01:15:05 Group logically then alphabetically, separate with
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+ base::Lock response_lock_;
+ base::WeakPtrFactory<SysLogsFetcher> weak_ptr_factory_;
+ size_t responses_;
+ void AddData(SysInfoResponse*);
rkc1 2012/08/04 01:15:05 DISALLOW_COPY_AND_ASSIGN
rkc1 2012/08/04 01:15:05 Move methods to above the fields, separate with a
tudalex(Chromium) 2012/08/05 01:15:12 Done.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
+};
+
+} // namespace system
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_FETCHER_H_
+

Powered by Google App Engine
This is Rietveld 408576698