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 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 // static | 17 // static |
17 AboutTcmallocOutputs* AboutTcmallocOutputs::GetInstance() { | 18 AboutTcmallocOutputs* AboutTcmallocOutputs::GetInstance() { |
18 return Singleton<AboutTcmallocOutputs>::get(); | 19 return Singleton<AboutTcmallocOutputs>::get(); |
19 } | 20 } |
20 | 21 |
21 AboutTcmallocOutputs::AboutTcmallocOutputs() {} | 22 AboutTcmallocOutputs::AboutTcmallocOutputs() {} |
22 | 23 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 95 |
95 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { | 96 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { |
96 iter.Send(new ChildProcessMsg_GetTcmallocStats); | 97 iter.Send(new ChildProcessMsg_GetTcmallocStats); |
97 } | 98 } |
98 | 99 |
99 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 100 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
100 &RequestTcmallocStatsFromChildRenderProcesses)); | 101 &RequestTcmallocStatsFromChildRenderProcesses)); |
101 } | 102 } |
102 #endif | 103 #endif |
103 | 104 |
104 bool TcmallocInternalsRequestJob::GetData(std::string* mime_type, | 105 int TcmallocInternalsRequestJob::GetData( |
105 std::string* charset, | 106 std::string* mime_type, |
106 std::string* data) const { | 107 std::string* charset, |
| 108 std::string* data, |
| 109 const net::CompletionCallback& callback) const { |
107 mime_type->assign("text/html"); | 110 mime_type->assign("text/html"); |
108 charset->assign("UTF8"); | 111 charset->assign("UTF8"); |
109 | 112 |
110 data->clear(); | 113 data->clear(); |
111 #if defined(USE_TCMALLOC) | 114 #if defined(USE_TCMALLOC) |
112 AboutTcmalloc(data); | 115 AboutTcmalloc(data); |
113 #endif | 116 #endif |
114 return true; | 117 return net::OK; |
115 } | 118 } |
116 | 119 |
117 } // namespace content | 120 } // namespace content |
OLD | NEW |