Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: chrome/browser/ui/webui/profiler_ui.cc

Issue 985773002: Introducing phased profiling framework (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@write_to_file
Patch Set: Fixing Android compile errors. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/profiler_ui.h ('k') | components/components_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 ProfilerUI::~ProfilerUI() { 157 ProfilerUI::~ProfilerUI() {
158 } 158 }
159 159
160 void ProfilerUI::GetData() { 160 void ProfilerUI::GetData() {
161 TrackingSynchronizer::FetchProfilerDataAsynchronously( 161 TrackingSynchronizer::FetchProfilerDataAsynchronously(
162 weak_ptr_factory_.GetWeakPtr()); 162 weak_ptr_factory_.GetWeakPtr());
163 } 163 }
164 164
165 void ProfilerUI::ReceivedProfilerData( 165 void ProfilerUI::ReceivedProfilerData(
166 const tracked_objects::ProcessDataSnapshot& profiler_data, 166 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase,
167 int process_type) { 167 base::ProcessId process_id,
168 content::ProcessType process_type,
169 int profiling_phase,
170 base::TimeDelta phase_start,
171 base::TimeDelta phase_finish,
172 const metrics::ProfilerEvents& past_events) {
168 // Serialize the data to JSON. 173 // Serialize the data to JSON.
169 base::DictionaryValue json_data; 174 base::DictionaryValue json_data;
170 task_profiler::TaskProfilerDataSerializer::ToValue(profiler_data, 175 task_profiler::TaskProfilerDataSerializer::ToValue(
171 process_type, 176 process_data_phase, process_id, process_type, &json_data);
172 &json_data);
173 177
174 // Send the data to the renderer. 178 // Send the data to the renderer.
175 web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data); 179 web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data);
176 } 180 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/profiler_ui.h ('k') | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698