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

Side by Side Diff: content/browser/tcmalloc_internals_request_job.h

Issue 10041017: Show gpu process stats in about:tcmalloc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address nits, call OnStatsForChildProcess directly from IO thread instead of posting to UI Created 8 years, 8 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 | Annotate | Revision Log
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 CONTENT_BROWSER_TCMALLOC_INTERNALS_REQUEST_JOB_H_
6 #define CONTENT_BROWSER_TCMALLOC_INTERNALS_REQUEST_JOB_H_
7 #pragma once
8
9 #include <map>
10 #include "base/basictypes.h"
11 #include "base/memory/singleton.h"
12 #include "base/process.h"
13 #include "build/build_config.h" // USE_TCMALLOC
14 #include "content/public/common/process_type.h"
15 #include "net/url_request/url_request_simple_job.h"
16
17 namespace content {
18
19 class AboutTcmallocOutputs {
20 public:
21 // Returns the singleton instance.
22 static AboutTcmallocOutputs* GetInstance();
23
24 // Records the output for a specified header string.
25 void SetOutput(const std::string& header, const std::string& output);
26
27 void DumpToHTMLTable(std::string* data);
28
29 // Callback for output returned from a child process. Adds
30 // the output for a canonical process-specific header string that
31 // incorporates the pid.
32 void OnStatsForChildProcess(base::ProcessId pid,
33 ProcessType process_type,
34 const std::string& output);
35
36 private:
37 AboutTcmallocOutputs();
38 ~AboutTcmallocOutputs();
39
40 // A map of header strings (e.g. "Browser", "Renderer PID 123")
41 // to the tcmalloc output collected for each process.
42 typedef std::map<std::string, std::string> AboutTcmallocOutputsType;
43 AboutTcmallocOutputsType outputs_;
44
45 friend struct DefaultSingletonTraits<AboutTcmallocOutputs>;
46
47 DISALLOW_COPY_AND_ASSIGN(AboutTcmallocOutputs);
48 };
49
50 class TcmallocInternalsRequestJob : public net::URLRequestSimpleJob {
51 public:
52 explicit TcmallocInternalsRequestJob(net::URLRequest* request);
53
54 virtual bool GetData(std::string* mime_type,
55 std::string* charset,
56 std::string* data) const OVERRIDE;
57
58 private:
59 DISALLOW_IMPLICIT_CONSTRUCTORS(TcmallocInternalsRequestJob);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_BROWSER_TCMALLOC_INTERNALS_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « content/browser/resource_context_impl.cc ('k') | content/browser/tcmalloc_internals_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698