| 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 "bindings/v8/ScriptWrappable.h" | |
| 36 #include "core/inspector/ScriptProfileNode.h" | |
| 37 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
| 38 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 39 | 37 |
| 40 namespace v8 { | 38 namespace v8 { |
| 41 class CpuProfile; | 39 class CpuProfile; |
| 42 } | 40 } |
| 43 | 41 |
| 44 namespace WebCore { | 42 namespace WebCore { |
| 45 | 43 |
| 46 class InspectorObject; | 44 class InspectorObject; |
| 47 | 45 |
| 48 class ScriptProfile : public RefCounted<ScriptProfile>, public ScriptWrappable { | 46 class ScriptProfile : public RefCounted<ScriptProfile> { |
| 49 public: | 47 public: |
| 50 static PassRefPtr<ScriptProfile> create(const v8::CpuProfile* profile, doubl
e idleTime) | 48 static PassRefPtr<ScriptProfile> create(const v8::CpuProfile* profile, doubl
e idleTime) |
| 51 { | 49 { |
| 52 return adoptRef(new ScriptProfile(profile, idleTime)); | 50 return adoptRef(new ScriptProfile(profile, idleTime)); |
| 53 } | 51 } |
| 54 virtual ~ScriptProfile(); | 52 virtual ~ScriptProfile(); |
| 55 | 53 |
| 56 String title() const; | 54 String title() const; |
| 57 unsigned int uid() const; | 55 unsigned int uid() const; |
| 58 PassRefPtr<ScriptProfileNode> head() const; | |
| 59 double idleTime() const; | 56 double idleTime() const; |
| 60 | 57 |
| 61 PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectForHea
d() const; | 58 PassRefPtr<TypeBuilder::Profiler::CPUProfileNode> buildInspectorObjectForHea
d() const; |
| 62 PassRefPtr<TypeBuilder::Array<int> > buildInspectorObjectForSamples() const; | 59 PassRefPtr<TypeBuilder::Array<int> > buildInspectorObjectForSamples() const; |
| 63 | 60 |
| 64 private: | 61 private: |
| 65 ScriptProfile(const v8::CpuProfile* profile, double idleTime) | 62 ScriptProfile(const v8::CpuProfile* profile, double idleTime) |
| 66 : m_profile(profile) | 63 : m_profile(profile) |
| 67 , m_idleTime(idleTime) | 64 , m_idleTime(idleTime) |
| 68 { | 65 { |
| 69 ScriptWrappable::init(this); | |
| 70 } | 66 } |
| 71 | 67 |
| 72 const v8::CpuProfile* m_profile; | 68 const v8::CpuProfile* m_profile; |
| 73 double m_idleTime; | 69 double m_idleTime; |
| 74 }; | 70 }; |
| 75 | 71 |
| 76 } // namespace WebCore | 72 } // namespace WebCore |
| 77 | 73 |
| 78 #endif // ScriptProfile_h | 74 #endif // ScriptProfile_h |
| OLD | NEW |