| 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 "base/profiler/scoped_profile.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "content/common/child_process_messages.h" | 9 #include "content/common/child_process_messages.h" |
| 10 #include "content/public/browser/browser_child_process_host_iterator.h" | 10 #include "content/public/browser/browser_child_process_host_iterator.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
| 13 #include "content/public/common/process_type.h" | 13 #include "content/public/common/process_type.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // static | 18 // static |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 102 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
| 103 &RequestTcmallocStatsFromChildRenderProcesses)); | 103 &RequestTcmallocStatsFromChildRenderProcesses)); |
| 104 } | 104 } |
| 105 #endif | 105 #endif |
| 106 | 106 |
| 107 int TcmallocInternalsRequestJob::GetData( | 107 int TcmallocInternalsRequestJob::GetData( |
| 108 std::string* mime_type, | 108 std::string* mime_type, |
| 109 std::string* charset, | 109 std::string* charset, |
| 110 std::string* data, | 110 std::string* data, |
| 111 const net::CompletionCallback& callback) const { | 111 const net::CompletionCallback& callback) const { |
| 112 // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed. | 112 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422489 is fixed. |
| 113 tracked_objects::ScopedProfile tracking_profile( | 113 tracked_objects::ScopedTracker tracking_profile( |
| 114 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 114 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 115 "422489 TcmallocInternalsRequestJob::GetData")); | 115 "422489 TcmallocInternalsRequestJob::GetData")); |
| 116 | 116 |
| 117 mime_type->assign("text/html"); | 117 mime_type->assign("text/html"); |
| 118 charset->assign("UTF8"); | 118 charset->assign("UTF8"); |
| 119 | 119 |
| 120 data->clear(); | 120 data->clear(); |
| 121 #if defined(USE_TCMALLOC) | 121 #if defined(USE_TCMALLOC) |
| 122 AboutTcmalloc(data); | 122 AboutTcmalloc(data); |
| 123 #endif | 123 #endif |
| 124 return net::OK; | 124 return net::OK; |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace content | 127 } // namespace content |
| OLD | NEW |