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