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" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void RequestTcmallocStatsFromChildRenderProcesses() { | 63 void RequestTcmallocStatsFromChildRenderProcesses() { |
64 RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator()); | 64 RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator()); |
65 while (!it.IsAtEnd()) { | 65 while (!it.IsAtEnd()) { |
66 it.GetCurrentValue()->Send(new ChildProcessMsg_GetTcmallocStats); | 66 it.GetCurrentValue()->Send(new ChildProcessMsg_GetTcmallocStats); |
67 it.Advance(); | 67 it.Advance(); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 void AboutTcmalloc(std::string* data) { | 71 void AboutTcmalloc(std::string* data) { |
72 data->append("<!DOCTYPE html>\n<html>\n<head>\n"); | 72 data->append("<!DOCTYPE html>\n<html>\n<head>\n"); |
| 73 data->append( |
| 74 "<meta http-equiv=\"X-WebKit-CSP\" content=\"object-src 'none'; " |
| 75 "script-src 'none' 'unsafe-eval'\">"); |
73 data->append("<title>tcmalloc stats</title>"); | 76 data->append("<title>tcmalloc stats</title>"); |
74 data->append("</head><body>"); | 77 data->append("</head><body>"); |
75 | 78 |
76 // Display any stats for which we sent off requests the last time. | 79 // Display any stats for which we sent off requests the last time. |
77 data->append("<p>Stats as of last page load;"); | 80 data->append("<p>Stats as of last page load;"); |
78 data->append("reload to get stats as of this page load.</p>\n"); | 81 data->append("reload to get stats as of this page load.</p>\n"); |
79 data->append("<table width=\"100%\">\n"); | 82 data->append("<table width=\"100%\">\n"); |
80 | 83 |
81 AboutTcmallocOutputs::GetInstance()->DumpToHTMLTable(data); | 84 AboutTcmallocOutputs::GetInstance()->DumpToHTMLTable(data); |
82 | 85 |
(...skipping 22 matching lines...) Expand all Loading... |
105 charset->assign("UTF8"); | 108 charset->assign("UTF8"); |
106 | 109 |
107 data->clear(); | 110 data->clear(); |
108 #if defined(USE_TCMALLOC) | 111 #if defined(USE_TCMALLOC) |
109 AboutTcmalloc(data); | 112 AboutTcmalloc(data); |
110 #endif | 113 #endif |
111 return true; | 114 return true; |
112 } | 115 } |
113 | 116 |
114 } // namespace content | 117 } // namespace content |
OLD | NEW |