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

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

Issue 1468993003: [Eraser] Remove chrome://tcmalloc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address primiano comment, remove declaration from gpu_child_thread Created 5 years 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 CONTENT_BROWSER_TCMALLOC_INTERNALS_REQUEST_JOB_H_
6 #define CONTENT_BROWSER_TCMALLOC_INTERNALS_REQUEST_JOB_H_
7
8 #include <map>
9 #include "base/basictypes.h"
10 #include "base/memory/singleton.h"
11 #include "base/process/process.h"
12 #include "build/build_config.h" // USE_TCMALLOC
13 #include "net/url_request/url_request_simple_job.h"
14
15 namespace content {
16
17 class AboutTcmallocOutputs {
18 public:
19 // Returns the singleton instance.
20 static AboutTcmallocOutputs* GetInstance();
21
22 // Records the output for a specified header string.
23 void SetOutput(const std::string& header, const std::string& output);
24
25 void DumpToHTMLTable(std::string* data);
26
27 // Callback for output returned from a child process. Adds
28 // the output for a canonical process-specific header string that
29 // incorporates the pid.
30 void OnStatsForChildProcess(base::ProcessId pid,
31 int process_type,
32 const std::string& output);
33
34 private:
35 AboutTcmallocOutputs();
36 ~AboutTcmallocOutputs();
37
38 // A map of header strings (e.g. "Browser", "Renderer PID 123")
39 // to the tcmalloc output collected for each process.
40 typedef std::map<std::string, std::string> AboutTcmallocOutputsType;
41 AboutTcmallocOutputsType outputs_;
42
43 friend struct base::DefaultSingletonTraits<AboutTcmallocOutputs>;
44
45 DISALLOW_COPY_AND_ASSIGN(AboutTcmallocOutputs);
46 };
47
48 class TcmallocInternalsRequestJob : public net::URLRequestSimpleJob {
49 public:
50 TcmallocInternalsRequestJob(net::URLRequest* request,
51 net::NetworkDelegate* network_delegate);
52
53 int GetData(std::string* mime_type,
54 std::string* charset,
55 std::string* data,
56 const net::CompletionCallback& callback) const override;
57
58 protected:
59 ~TcmallocInternalsRequestJob() override {}
60
61 private:
62 DISALLOW_IMPLICIT_CONSTRUCTORS(TcmallocInternalsRequestJob);
63 };
64
65 } // namespace content
66
67 #endif // CONTENT_BROWSER_TCMALLOC_INTERNALS_REQUEST_JOB_H_
OLDNEW
« no previous file with comments | « content/browser/profiler_message_filter.cc ('k') | content/browser/tcmalloc_internals_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698