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

Unified Diff: chrome/browser/task_profiler/task_profiler_data_serializer.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, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_profiler/task_profiler_data_serializer.cc
diff --git a/chrome/browser/task_profiler/task_profiler_data_serializer.cc b/chrome/browser/task_profiler/task_profiler_data_serializer.cc
index dc6efa41fc0533c83b7c93d4b72eedb0cf4d3bef..d072d657f555af94881074374d4cda680e48d492 100644
--- a/chrome/browser/task_profiler/task_profiler_data_serializer.cc
+++ b/chrome/browser/task_profiler/task_profiler_data_serializer.cc
@@ -21,7 +21,7 @@ using tracked_objects::DeathDataSnapshot;
using tracked_objects::LocationSnapshot;
using tracked_objects::ParentChildPairSnapshot;
using tracked_objects::TaskSnapshot;
-using tracked_objects::ProcessDataSnapshot;
+using tracked_objects::ProcessDataPhaseSnapshot;
namespace {
@@ -80,30 +80,27 @@ namespace task_profiler {
// static
void TaskProfilerDataSerializer::ToValue(
- const ProcessDataSnapshot& process_data,
+ const ProcessDataPhaseSnapshot& process_data_phase,
+ base::ProcessId process_id,
int process_type,
base::DictionaryValue* dictionary) {
scoped_ptr<base::ListValue> tasks_list(new base::ListValue);
- for (std::vector<TaskSnapshot>::const_iterator it =
- process_data.tasks.begin();
- it != process_data.tasks.end(); ++it) {
+ for (const auto& task : process_data_phase.tasks) {
scoped_ptr<base::DictionaryValue> snapshot(new base::DictionaryValue);
- TaskSnapshotToValue(*it, snapshot.get());
+ TaskSnapshotToValue(task, snapshot.get());
tasks_list->Append(snapshot.release());
}
dictionary->Set("list", tasks_list.release());
- dictionary->SetInteger("process_id", process_data.process_id);
+ dictionary->SetInteger("process_id", process_id);
dictionary->SetString("process_type",
content::GetProcessTypeNameInEnglish(process_type));
scoped_ptr<base::ListValue> descendants_list(new base::ListValue);
- for (std::vector<ParentChildPairSnapshot>::const_iterator it =
- process_data.descendants.begin();
- it != process_data.descendants.end(); ++it) {
+ for (const auto& entry : process_data_phase.descendants) {
scoped_ptr<base::DictionaryValue> parent_child(new base::DictionaryValue);
- BirthOnThreadSnapshotToValue(it->parent, "parent", parent_child.get());
- BirthOnThreadSnapshotToValue(it->child, "child", parent_child.get());
+ BirthOnThreadSnapshotToValue(entry.parent, "parent", parent_child.get());
+ BirthOnThreadSnapshotToValue(entry.child, "child", parent_child.get());
descendants_list->Append(parent_child.release());
}
dictionary->Set("descendants", descendants_list.release());

Powered by Google App Engine
This is Rietveld 408576698