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 "chrome/browser/ui/webui/profiler_ui.h" | 5 #include "chrome/browser/ui/webui/profiler_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 // When testing the javacript code, it is cumbersome to have to keep | 9 // When testing the javacript code, it is cumbersome to have to keep |
10 // re-building the resouces package and reloading the browser. To solve | 10 // re-building the resouces package and reloading the browser. To solve |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 ProfilerUI::~ProfilerUI() { | 166 ProfilerUI::~ProfilerUI() { |
167 } | 167 } |
168 | 168 |
169 void ProfilerUI::GetData() { | 169 void ProfilerUI::GetData() { |
170 TrackingSynchronizer::FetchProfilerDataAsynchronously( | 170 TrackingSynchronizer::FetchProfilerDataAsynchronously( |
171 weak_ptr_factory_.GetWeakPtr()); | 171 weak_ptr_factory_.GetWeakPtr()); |
172 } | 172 } |
173 | 173 |
174 void ProfilerUI::ReceivedProfilerData( | 174 void ProfilerUI::ReceivedProfilerData( |
175 const tracked_objects::ProcessDataSnapshot& profiler_data, | 175 const tracked_objects::ProcessDataSnapshot& profiler_data, |
176 content::ProcessType process_type) { | 176 int process_type) { |
177 // Serialize the data to JSON. | 177 // Serialize the data to JSON. |
178 DictionaryValue json_data; | 178 DictionaryValue json_data; |
179 task_profiler::TaskProfilerDataSerializer::ToValue(profiler_data, | 179 task_profiler::TaskProfilerDataSerializer::ToValue(profiler_data, |
180 process_type, | 180 process_type, |
181 &json_data); | 181 &json_data); |
182 | 182 |
183 // Send the data to the renderer. | 183 // Send the data to the renderer. |
184 web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data); | 184 web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data); |
185 } | 185 } |
OLD | NEW |