OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class ScriptState; | 47 class ScriptState; |
48 class ScriptCallStack; | 48 class ScriptCallStack; |
49 class ScriptProfile; | 49 class ScriptProfile; |
50 | 50 |
51 | 51 |
52 typedef String ErrorString; | 52 typedef String ErrorString; |
53 | 53 |
54 class InspectorProfilerAgent FINAL : public InspectorBaseAgent<InspectorProfiler
Agent>, public InspectorBackendDispatcher::ProfilerCommandHandler { | 54 class InspectorProfilerAgent FINAL : public InspectorBaseAgent<InspectorProfiler
Agent>, public InspectorBackendDispatcher::ProfilerCommandHandler { |
55 WTF_MAKE_NONCOPYABLE(InspectorProfilerAgent); WTF_MAKE_FAST_ALLOCATED; | 55 WTF_MAKE_NONCOPYABLE(InspectorProfilerAgent); WTF_MAKE_FAST_ALLOCATED; |
56 public: | 56 public: |
57 static PassOwnPtr<InspectorProfilerAgent> create(InjectedScriptManager*, Ins
pectorOverlay*, InspectorAgentRegistry*); | 57 static PassOwnPtr<InspectorProfilerAgent> create(InjectedScriptManager*, Ins
pectorOverlay*); |
58 virtual ~InspectorProfilerAgent(); | 58 virtual ~InspectorProfilerAgent(); |
59 | 59 |
60 void consoleProfile(const String& title, ScriptState*); | 60 void consoleProfile(const String& title, ScriptState*); |
61 void consoleProfileEnd(const String& title, ScriptState*); | 61 void consoleProfileEnd(const String& title, ScriptState*); |
62 | 62 |
63 virtual void enable(ErrorString*) OVERRIDE; | 63 virtual void enable(ErrorString*) OVERRIDE; |
64 virtual void disable(ErrorString*) OVERRIDE; | 64 virtual void disable(ErrorString*) OVERRIDE; |
65 virtual void setSamplingInterval(ErrorString*, int) OVERRIDE; | 65 virtual void setSamplingInterval(ErrorString*, int) OVERRIDE; |
66 virtual void start(ErrorString*) OVERRIDE; | 66 virtual void start(ErrorString*) OVERRIDE; |
67 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>&)
OVERRIDE; | 67 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>&)
OVERRIDE; |
68 | 68 |
69 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 69 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
70 virtual void clearFrontend() OVERRIDE; | 70 virtual void clearFrontend() OVERRIDE; |
71 virtual void restore() OVERRIDE; | 71 virtual void restore() OVERRIDE; |
72 | 72 |
73 void willProcessTask(); | 73 void willProcessTask(); |
74 void didProcessTask(); | 74 void didProcessTask(); |
75 void willEnterNestedRunLoop(); | 75 void willEnterNestedRunLoop(); |
76 void didLeaveNestedRunLoop(); | 76 void didLeaveNestedRunLoop(); |
77 | 77 |
78 private: | 78 private: |
79 InspectorProfilerAgent(InjectedScriptManager*, InspectorOverlay*, InspectorA
gentRegistry*); | 79 InspectorProfilerAgent(InjectedScriptManager*, InspectorOverlay*); |
80 bool enabled(); | 80 bool enabled(); |
81 void doEnable(); | 81 void doEnable(); |
82 void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>*); | 82 void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>*); |
83 String nextProfileId(); | 83 String nextProfileId(); |
84 | 84 |
85 InjectedScriptManager* m_injectedScriptManager; | 85 InjectedScriptManager* m_injectedScriptManager; |
86 InspectorFrontend::Profiler* m_frontend; | 86 InspectorFrontend::Profiler* m_frontend; |
87 bool m_recordingCPUProfile; | 87 bool m_recordingCPUProfile; |
88 class ProfileDescriptor; | 88 class ProfileDescriptor; |
89 Vector<ProfileDescriptor> m_startedProfiles; | 89 Vector<ProfileDescriptor> m_startedProfiles; |
90 String m_frontendInitiatedProfileId; | 90 String m_frontendInitiatedProfileId; |
91 | 91 |
92 typedef HashMap<String, double> ProfileNameIdleTimeMap; | 92 typedef HashMap<String, double> ProfileNameIdleTimeMap; |
93 ProfileNameIdleTimeMap* m_profileNameIdleTimeMap; | 93 ProfileNameIdleTimeMap* m_profileNameIdleTimeMap; |
94 double m_idleStartTime; | 94 double m_idleStartTime; |
95 InspectorOverlay* m_overlay; | 95 InspectorOverlay* m_overlay; |
96 InspectorAgentRegistry* m_registry; | |
97 | 96 |
98 void idleStarted(); | 97 void idleStarted(); |
99 void idleFinished(); | 98 void idleFinished(); |
100 }; | 99 }; |
101 | 100 |
102 } // namespace WebCore | 101 } // namespace WebCore |
103 | 102 |
104 | 103 |
105 #endif // !defined(InspectorProfilerAgent_h) | 104 #endif // !defined(InspectorProfilerAgent_h) |
OLD | NEW |