OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/tcmalloc_internals_request_job.h" | 5 #include "content/browser/tcmalloc_internals_request_job.h" |
6 | 6 |
7 #include "base/allocator/allocator_extension.h" | 7 #include "base/allocator/allocator_extension.h" |
8 #include "content/common/child_process_messages.h" | 8 #include "content/common/child_process_messages.h" |
9 #include "content/public/browser/browser_child_process_host_iterator.h" | 9 #include "content/public/browser/browser_child_process_host_iterator.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 #include "content/public/browser/render_process_host.h" | 11 #include "content/public/browser/render_process_host.h" |
12 #include "content/public/common/process_type.h" | 12 #include "content/public/common/process_type.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
| 14 #include "net/url_request/url_request.h" |
| 15 #include "net/url_request/url_request_context.h" |
14 | 16 |
15 namespace content { | 17 namespace content { |
16 | 18 |
17 // static | 19 // static |
18 AboutTcmallocOutputs* AboutTcmallocOutputs::GetInstance() { | 20 AboutTcmallocOutputs* AboutTcmallocOutputs::GetInstance() { |
19 return Singleton<AboutTcmallocOutputs>::get(); | 21 return Singleton<AboutTcmallocOutputs>::get(); |
20 } | 22 } |
21 | 23 |
22 AboutTcmallocOutputs::AboutTcmallocOutputs() {} | 24 AboutTcmallocOutputs::AboutTcmallocOutputs() {} |
23 | 25 |
(...skipping 26 matching lines...) Expand all Loading... |
50 data->append("</td></tr>\n"); | 52 data->append("</td></tr>\n"); |
51 data->append("<tr><td><pre>\n"); | 53 data->append("<tr><td><pre>\n"); |
52 data->append(oit->second); | 54 data->append(oit->second); |
53 data->append("</pre></td></tr>\n"); | 55 data->append("</pre></td></tr>\n"); |
54 } | 56 } |
55 data->append("</table>\n"); | 57 data->append("</table>\n"); |
56 outputs_.clear(); | 58 outputs_.clear(); |
57 } | 59 } |
58 | 60 |
59 TcmallocInternalsRequestJob::TcmallocInternalsRequestJob( | 61 TcmallocInternalsRequestJob::TcmallocInternalsRequestJob( |
60 net::URLRequest* request) : net::URLRequestSimpleJob(request) { | 62 net::URLRequest* request) |
| 63 : net::URLRequestSimpleJob(request, |
| 64 request->context()->network_delegate()) { |
61 } | 65 } |
62 | 66 |
63 #if defined(USE_TCMALLOC) | 67 #if defined(USE_TCMALLOC) |
64 void RequestTcmallocStatsFromChildRenderProcesses() { | 68 void RequestTcmallocStatsFromChildRenderProcesses() { |
65 RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator()); | 69 RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator()); |
66 while (!it.IsAtEnd()) { | 70 while (!it.IsAtEnd()) { |
67 it.GetCurrentValue()->Send(new ChildProcessMsg_GetTcmallocStats); | 71 it.GetCurrentValue()->Send(new ChildProcessMsg_GetTcmallocStats); |
68 it.Advance(); | 72 it.Advance(); |
69 } | 73 } |
70 } | 74 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 charset->assign("UTF8"); | 115 charset->assign("UTF8"); |
112 | 116 |
113 data->clear(); | 117 data->clear(); |
114 #if defined(USE_TCMALLOC) | 118 #if defined(USE_TCMALLOC) |
115 AboutTcmalloc(data); | 119 AboutTcmalloc(data); |
116 #endif | 120 #endif |
117 return net::OK; | 121 return net::OK; |
118 } | 122 } |
119 | 123 |
120 } // namespace content | 124 } // namespace content |
OLD | NEW |