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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_FETCHER_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_FETCHER_H_
7
8 #include <string>
9 #include <map>
10 #include <vector>
11
12 #include "base/bind.h"
13 #include "base/bind_helpers.h"
14 #include "base/callback.h"
15 #include "base/memory/singleton.h"
16 #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.
17
18 namespace chromeos {
19 namespace system {
20
21 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.
22 typedef base::Callback<void(SysInfoResponse*)> SysLogsFetcherCallback;
23
24 class SysLogsInterface {
25 public:
26 virtual void Fetch(SysLogsFetcherCallback) = 0;
27 virtual ~SysLogsInterface() {}
28 };
29
30 typedef std::vector <SysLogsInterface*> SysLogsDataSources;
rkc1 2012/08/04 01:15:05 vector<
tudalex(Chromium) 2012/08/05 01:15:12 Done.
31
32 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.
33 public:
34 explicit SysLogsFetcher(SysLogsDataSources);
35 ~SysLogsFetcher() {}
36 void Fetch(SysLogsFetcherCallback);
rkc1 2012/08/04 01:15:05 New line after.
tudalex(Chromium) 2012/08/05 01:15:12 Done.
37 private:
38 SysLogsFetcherCallback request_;
rkc1 2012/08/04 01:15:05 Add comments, lots of them :)
tudalex(Chromium) 2012/08/05 01:15:12 Done.
39 SysLogsDataSources data_sources_;
40 SysInfoResponse* response_;
rkc1 2012/08/04 01:15:05 Group logically then alphabetically, separate with
tudalex(Chromium) 2012/08/05 01:15:12 Done.
41 base::Lock response_lock_;
42 base::WeakPtrFactory<SysLogsFetcher> weak_ptr_factory_;
43 size_t responses_;
44 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.
45 };
46
47 } // namespace system
48 } // namespace chromeos
49
50 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_SYSLOGS_FETCHER_H_
51
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698