| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef ScriptProfile_h | 31 #ifndef ScriptProfile_h |
| 32 #define ScriptProfile_h | 32 #define ScriptProfile_h |
| 33 | 33 |
| 34 #include "InspectorTypeBuilder.h" | 34 #include "InspectorTypeBuilder.h" |
| 35 #include "platform/heap/Handle.h" |
| 35 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
| 36 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 37 #include <v8-profiler.h> | 38 #include <v8-profiler.h> |
| 38 | 39 |
| 39 namespace WebCore { | 40 namespace WebCore { |
| 40 | 41 |
| 41 class ScriptProfile FINAL : public RefCounted<ScriptProfile> { | 42 class ScriptProfile FINAL : public RefCountedWillBeGarbageCollectedFinalized<Scr
iptProfile> { |
| 42 public: | 43 public: |
| 43 static PassRefPtr<ScriptProfile> create(v8::CpuProfile* profile, double idle
Time) | 44 static PassRefPtrWillBeRawPtr<ScriptProfile> create(v8::CpuProfile* profile,
double idleTime) |
| 44 { | 45 { |
| 45 return adoptRef(new ScriptProfile(profile, idleTime)); | 46 return adoptRefWillBeNoop(new ScriptProfile(profile, idleTime)); |
| 46 } | 47 } |
| 47 ~ScriptProfile(); | 48 ~ScriptProfile(); |
| 49 void trace(Visitor*) { } |
| 48 | 50 |
| 49 String title() const; | 51 String title() const; |
| 50 double idleTime() const; | 52 double idleTime() const; |
| 51 | 53 |
| 52 double startTime() const; | 54 double startTime() const; |
| 53 double endTime() const; | 55 double endTime() const; |
| 54 | 56 |
| 55 PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectForHea
d() const; | 57 PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectForHea
d() const; |
| 56 PassRefPtr<TypeBuilder::Array<int> > buildInspectorObjectForSamples() const; | 58 PassRefPtr<TypeBuilder::Array<int> > buildInspectorObjectForSamples() const; |
| 57 PassRefPtr<TypeBuilder::Array<double> > buildInspectorObjectForTimestamps()
const; | 59 PassRefPtr<TypeBuilder::Array<double> > buildInspectorObjectForTimestamps()
const; |
| 58 | 60 |
| 59 private: | 61 private: |
| 60 ScriptProfile(v8::CpuProfile* profile, double idleTime) | 62 ScriptProfile(v8::CpuProfile* profile, double idleTime) |
| 61 : m_profile(profile) | 63 : m_profile(profile) |
| 62 , m_idleTime(idleTime) | 64 , m_idleTime(idleTime) |
| 63 { | 65 { |
| 64 } | 66 } |
| 65 | 67 |
| 66 v8::CpuProfile* m_profile; | 68 v8::CpuProfile* m_profile; |
| 67 double m_idleTime; | 69 double m_idleTime; |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace WebCore | 72 } // namespace WebCore |
| 71 | 73 |
| 72 #endif // ScriptProfile_h | 74 #endif // ScriptProfile_h |
| OLD | NEW |