| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 PassRefPtr<ScriptProfileNode> ScriptProfile::head() const | 58 PassRefPtr<ScriptProfileNode> ScriptProfile::head() const |
| 59 { | 59 { |
| 60 return ScriptProfileNode::create(m_profile->GetTopDownRoot()); | 60 return ScriptProfileNode::create(m_profile->GetTopDownRoot()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 double ScriptProfile::idleTime() const | 63 double ScriptProfile::idleTime() const |
| 64 { | 64 { |
| 65 return m_idleTime; | 65 return m_idleTime; |
| 66 } | 66 } |
| 67 | 67 |
| 68 #if ENABLE(INSPECTOR) | |
| 69 static PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectFor
(const v8::CpuProfileNode* node) | 68 static PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectFor
(const v8::CpuProfileNode* node) |
| 70 { | 69 { |
| 71 v8::HandleScope handleScope; | 70 v8::HandleScope handleScope; |
| 72 | 71 |
| 73 RefPtr<TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode> > children
= TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode>::create(); | 72 RefPtr<TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode> > children
= TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode>::create(); |
| 74 const int childrenCount = node->GetChildrenCount(); | 73 const int childrenCount = node->GetChildrenCount(); |
| 75 for (int i = 0; i < childrenCount; i++) { | 74 for (int i = 0; i < childrenCount; i++) { |
| 76 const v8::CpuProfileNode* child = node->GetChild(i); | 75 const v8::CpuProfileNode* child = node->GetChild(i); |
| 77 children->addItem(buildInspectorObjectFor(child)); | 76 children->addItem(buildInspectorObjectFor(child)); |
| 78 } | 77 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 98 | 97 |
| 99 PassRefPtr<TypeBuilder::Array<int> > ScriptProfile::buildInspectorObjectForSampl
es() const | 98 PassRefPtr<TypeBuilder::Array<int> > ScriptProfile::buildInspectorObjectForSampl
es() const |
| 100 { | 99 { |
| 101 RefPtr<TypeBuilder::Array<int> > array = TypeBuilder::Array<int>::create(); | 100 RefPtr<TypeBuilder::Array<int> > array = TypeBuilder::Array<int>::create(); |
| 102 int count = m_profile->GetSamplesCount(); | 101 int count = m_profile->GetSamplesCount(); |
| 103 for (int i = 0; i < count; i++) | 102 for (int i = 0; i < count; i++) |
| 104 array->addItem(m_profile->GetSample(i)->GetNodeId()); | 103 array->addItem(m_profile->GetSample(i)->GetNodeId()); |
| 105 return array.release(); | 104 return array.release(); |
| 106 } | 105 } |
| 107 | 106 |
| 108 #endif | |
| 109 | 107 |
| 110 } // namespace WebCore | 108 } // namespace WebCore |
| OLD | NEW |