| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class InspectorOverlay; | 45 class InspectorOverlay; |
| 46 class InstrumentingAgents; | 46 class InstrumentingAgents; |
| 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); |
| 56 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 56 public: | 57 public: |
| 57 static PassOwnPtr<InspectorProfilerAgent> create(InjectedScriptManager*, Ins
pectorOverlay*); | 58 static PassOwnPtrWillBeRawPtr<InspectorProfilerAgent> create(InjectedScriptM
anager*, InspectorOverlay*); |
| 58 virtual ~InspectorProfilerAgent(); | 59 virtual ~InspectorProfilerAgent(); |
| 59 | 60 |
| 60 void consoleProfile(const String& title, ScriptState*); | 61 void consoleProfile(const String& title, ScriptState*); |
| 61 void consoleProfileEnd(const String& title, ScriptState*); | 62 void consoleProfileEnd(const String& title, ScriptState*); |
| 62 | 63 |
| 63 virtual void enable(ErrorString*) OVERRIDE; | 64 virtual void enable(ErrorString*) OVERRIDE; |
| 64 virtual void disable(ErrorString*) OVERRIDE; | 65 virtual void disable(ErrorString*) OVERRIDE; |
| 65 virtual void setSamplingInterval(ErrorString*, int) OVERRIDE; | 66 virtual void setSamplingInterval(ErrorString*, int) OVERRIDE; |
| 66 virtual void start(ErrorString*) OVERRIDE; | 67 virtual void start(ErrorString*) OVERRIDE; |
| 67 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>&)
OVERRIDE; | 68 virtual void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>&)
OVERRIDE; |
| 68 | 69 |
| 69 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 70 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 70 virtual void clearFrontend() OVERRIDE; | 71 virtual void clearFrontend() OVERRIDE; |
| 71 virtual void restore() OVERRIDE; | 72 virtual void restore() OVERRIDE; |
| 72 | 73 |
| 73 void willProcessTask(); | 74 void willProcessTask(); |
| 74 void didProcessTask(); | 75 void didProcessTask(); |
| 75 void willEnterNestedRunLoop(); | 76 void willEnterNestedRunLoop(); |
| 76 void didLeaveNestedRunLoop(); | 77 void didLeaveNestedRunLoop(); |
| 77 | 78 |
| 78 private: | 79 private: |
| 79 InspectorProfilerAgent(InjectedScriptManager*, InspectorOverlay*); | 80 InspectorProfilerAgent(InjectedScriptManager*, InspectorOverlay*); |
| 80 bool enabled(); | 81 bool enabled(); |
| 81 void doEnable(); | 82 void doEnable(); |
| 82 void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>*); | 83 void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::CPUProfile>*); |
| 83 String nextProfileId(); | 84 String nextProfileId(); |
| 84 | 85 |
| 86 // FIXME: Oilpan: Move InjectedScriptManager to heap in follow-up CL. |
| 85 InjectedScriptManager* m_injectedScriptManager; | 87 InjectedScriptManager* m_injectedScriptManager; |
| 86 InspectorFrontend::Profiler* m_frontend; | 88 InspectorFrontend::Profiler* m_frontend; |
| 87 bool m_recordingCPUProfile; | 89 bool m_recordingCPUProfile; |
| 88 class ProfileDescriptor; | 90 class ProfileDescriptor; |
| 89 Vector<ProfileDescriptor> m_startedProfiles; | 91 Vector<ProfileDescriptor> m_startedProfiles; |
| 90 String m_frontendInitiatedProfileId; | 92 String m_frontendInitiatedProfileId; |
| 91 | 93 |
| 92 typedef HashMap<String, double> ProfileNameIdleTimeMap; | 94 typedef HashMap<String, double> ProfileNameIdleTimeMap; |
| 93 ProfileNameIdleTimeMap* m_profileNameIdleTimeMap; | 95 ProfileNameIdleTimeMap* m_profileNameIdleTimeMap; |
| 94 double m_idleStartTime; | 96 double m_idleStartTime; |
| 95 InspectorOverlay* m_overlay; | 97 InspectorOverlay* m_overlay; |
| 96 | 98 |
| 97 void idleStarted(); | 99 void idleStarted(); |
| 98 void idleFinished(); | 100 void idleFinished(); |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace WebCore | 103 } // namespace WebCore |
| 102 | 104 |
| 103 | 105 |
| 104 #endif // !defined(InspectorProfilerAgent_h) | 106 #endif // !defined(InspectorProfilerAgent_h) |
| OLD | NEW |