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

Side by Side Diff: chrome/browser/chromeos/syslogs/memorydetails_fetcher.cc

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 #include "chrome/browser/chromeos/syslogs/memorydetails_fetcher.h"
6
7 #include "chrome/browser/chromeos/syslogs/syslogs_fetcher.h"
8 #include "chrome/browser/memory_details.h"
9 #include "content/public/browser/browser_thread.h"
10
11 namespace chromeos {
12
13 class SysLogsFetcherMemoryHandler : public MemoryDetails {
14 public:
15
16 SysLogsFetcherMemoryHandler(
17 SysLogsFetcherCallback request)
18 : request_(request) {}
19
20 virtual void OnDetailsAvailable() OVERRIDE {
21 SysLogsResponse* response = new SysLogsResponse;
22 (*response)["mem_usage"] = ToLogString();
23 // This will call the callback on the calling thread.
rkc 2012/08/06 18:30:18 How?
tudalex(Chromium) 2012/08/06 19:14:22 Left comment from the SysLogsProvider code when I
24 request_.Run(response);
25 }
26
27 private:
28 virtual ~SysLogsFetcherMemoryHandler() {}
29 SysLogsFetcherCallback request_;
30
31 DISALLOW_COPY_AND_ASSIGN(SysLogsFetcherMemoryHandler);
32 };
33
34 void MemoryDetailsFetcher::Fetch(SysLogsFetcherCallback request){
35 scoped_refptr<SysLogsFetcherMemoryHandler>
36 handler(new SysLogsFetcherMemoryHandler(request));
37 // TODO(jamescook): Maybe we don't need to update histograms here?
38 handler->StartFetch(MemoryDetails::UPDATE_USER_METRICS);
39 }
40
41 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698