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

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

Issue 23788005: Remove calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review (pfeldman) Created 7 years, 3 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 | Annotate | Revision Log
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 27 matching lines...) Expand all
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 ScriptProfile::~ScriptProfile() 41 ScriptProfile::~ScriptProfile()
42 { 42 {
43 const_cast<v8::CpuProfile*>(m_profile)->Delete(); 43 const_cast<v8::CpuProfile*>(m_profile)->Delete();
44 } 44 }
45 45
46 String ScriptProfile::title() const 46 String ScriptProfile::title() const
47 { 47 {
48 v8::HandleScope scope; 48 v8::HandleScope scope(v8::Isolate::GetCurrent());
49 return toWebCoreString(m_profile->GetTitle()); 49 return toWebCoreString(m_profile->GetTitle());
50 } 50 }
51 51
52 unsigned int ScriptProfile::uid() const 52 unsigned int ScriptProfile::uid() const
53 { 53 {
54 return m_profile->GetUid(); 54 return m_profile->GetUid();
55 } 55 }
56 56
57 double ScriptProfile::idleTime() const 57 double ScriptProfile::idleTime() const
58 { 58 {
59 return m_idleTime; 59 return m_idleTime;
60 } 60 }
61 61
62 double ScriptProfile::startTime() const 62 double ScriptProfile::startTime() const
63 { 63 {
64 return static_cast<double>(m_profile->GetStartTime()) / 1000000; 64 return static_cast<double>(m_profile->GetStartTime()) / 1000000;
65 } 65 }
66 66
67 double ScriptProfile::endTime() const 67 double ScriptProfile::endTime() const
68 { 68 {
69 return static_cast<double>(m_profile->GetEndTime()) / 1000000; 69 return static_cast<double>(m_profile->GetEndTime()) / 1000000;
70 } 70 }
71 71
72 static PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectFor (const v8::CpuProfileNode* node) 72 static PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectFor (const v8::CpuProfileNode* node)
73 { 73 {
74 v8::HandleScope handleScope; 74 v8::HandleScope handleScope(v8::Isolate::GetCurrent());
75 75
76 RefPtr<TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode> > children = TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode>::create(); 76 RefPtr<TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode> > children = TypeBuilder::Array<TypeBuilder::Profiler::CPUProfileNode>::create();
77 const int childrenCount = node->GetChildrenCount(); 77 const int childrenCount = node->GetChildrenCount();
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()))
(...skipping 16 matching lines...) Expand all
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 | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/testing/v8/WebCoreTestSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698