Chromium Code Reviews

Side by Side Diff: Source/core/inspector/ScriptProfile.cpp

Issue 22684004: Use CpuProfileNode::GetHitCount instead of depreceted GetSelfSamplesCount (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...)
78 for (int i = 0; i < childrenCount; i++) { 78 for (int i = 0; i < childrenCount; i++) {
79 const v8::CpuProfileNode* child = node->GetChild(i); 79 const v8::CpuProfileNode* child = node->GetChild(i);
80 children->addItem(buildInspectorObjectFor(child)); 80 children->addItem(buildInspectorObjectFor(child));
81 } 81 }
82 82
83 RefPtr<TypeBuilder::Profiler::CPUProfileNode> result = TypeBuilder::Profiler ::CPUProfileNode::create() 83 RefPtr<TypeBuilder::Profiler::CPUProfileNode> result = TypeBuilder::Profiler ::CPUProfileNode::create()
84 .setFunctionName(toWebCoreString(node->GetFunctionName())) 84 .setFunctionName(toWebCoreString(node->GetFunctionName()))
85 .setScriptId(String::number(node->GetScriptId())) 85 .setScriptId(String::number(node->GetScriptId()))
86 .setUrl(toWebCoreString(node->GetScriptResourceName())) 86 .setUrl(toWebCoreString(node->GetScriptResourceName()))
87 .setLineNumber(node->GetLineNumber()) 87 .setLineNumber(node->GetLineNumber())
88 .setHitCount(node->GetSelfSamplesCount()) 88 .setHitCount(node->GetHitCount())
89 .setCallUID(node->GetCallUid()) 89 .setCallUID(node->GetCallUid())
90 .setChildren(children.release()); 90 .setChildren(children.release());
91 result->setId(node->GetNodeId()); 91 result->setId(node->GetNodeId());
92 return result.release(); 92 return result.release();
93 } 93 }
94 94
95 PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> ScriptProfile::buildInspectorO bjectForHead() const 95 PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> ScriptProfile::buildInspectorO bjectForHead() const
96 { 96 {
97 return buildInspectorObjectFor(m_profile->GetTopDownRoot()); 97 return buildInspectorObjectFor(m_profile->GetTopDownRoot());
98 } 98 }
99 99
100 PassRefPtr<TypeBuilder::Array<int> > ScriptProfile::buildInspectorObjectForSampl es() const 100 PassRefPtr<TypeBuilder::Array<int> > ScriptProfile::buildInspectorObjectForSampl es() const
101 { 101 {
102 RefPtr<TypeBuilder::Array<int> > array = TypeBuilder::Array<int>::create(); 102 RefPtr<TypeBuilder::Array<int> > array = TypeBuilder::Array<int>::create();
103 int count = m_profile->GetSamplesCount(); 103 int count = m_profile->GetSamplesCount();
104 for (int i = 0; i < count; i++) 104 for (int i = 0; i < count; i++)
105 array->addItem(m_profile->GetSample(i)->GetNodeId()); 105 array->addItem(m_profile->GetSample(i)->GetNodeId());
106 return array.release(); 106 return array.release();
107 } 107 }
108 108
109 109
110 } // namespace WebCore 110 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine