OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class ScriptHeapSnapshot; | 47 class ScriptHeapSnapshot; |
48 | 48 |
49 typedef String ErrorString; | 49 typedef String ErrorString; |
50 | 50 |
51 class InspectorHeapProfilerAgent FINAL : public InspectorBaseAgent<InspectorHeap
ProfilerAgent>, public InspectorBackendDispatcher::HeapProfilerCommandHandler { | 51 class InspectorHeapProfilerAgent FINAL : public InspectorBaseAgent<InspectorHeap
ProfilerAgent>, public InspectorBackendDispatcher::HeapProfilerCommandHandler { |
52 WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent); | 52 WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent); |
53 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 53 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
54 public: | 54 public: |
55 static PassOwnPtrWillBeRawPtr<InspectorHeapProfilerAgent> create(InjectedScr
iptManager*); | 55 static PassOwnPtrWillBeRawPtr<InspectorHeapProfilerAgent> create(InjectedScr
iptManager*); |
56 virtual ~InspectorHeapProfilerAgent(); | 56 virtual ~InspectorHeapProfilerAgent(); |
| 57 virtual void trace(Visitor*) OVERRIDE; |
57 | 58 |
58 virtual void collectGarbage(ErrorString*) OVERRIDE; | 59 virtual void collectGarbage(ErrorString*) OVERRIDE; |
59 | 60 |
60 virtual void enable(ErrorString*) OVERRIDE; | 61 virtual void enable(ErrorString*) OVERRIDE; |
61 virtual void disable(ErrorString*) OVERRIDE; | 62 virtual void disable(ErrorString*) OVERRIDE; |
62 virtual void startTrackingHeapObjects(ErrorString*, const bool* trackAllocat
ions) OVERRIDE; | 63 virtual void startTrackingHeapObjects(ErrorString*, const bool* trackAllocat
ions) OVERRIDE; |
63 virtual void stopTrackingHeapObjects(ErrorString*, const bool* reportProgres
s) OVERRIDE; | 64 virtual void stopTrackingHeapObjects(ErrorString*, const bool* reportProgres
s) OVERRIDE; |
64 | 65 |
65 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 66 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
66 virtual void clearFrontend() OVERRIDE; | 67 virtual void clearFrontend() OVERRIDE; |
67 virtual void restore() OVERRIDE; | 68 virtual void restore() OVERRIDE; |
68 | 69 |
69 virtual void takeHeapSnapshot(ErrorString*, const bool* reportProgress) OVER
RIDE; | 70 virtual void takeHeapSnapshot(ErrorString*, const bool* reportProgress) OVER
RIDE; |
70 | 71 |
71 virtual void getObjectByHeapObjectId(ErrorString*, const String& heapSnapsho
tObjectId, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>
& result) OVERRIDE; | 72 virtual void getObjectByHeapObjectId(ErrorString*, const String& heapSnapsho
tObjectId, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>
& result) OVERRIDE; |
72 virtual void getHeapObjectId(ErrorString*, const String& objectId, String* h
eapSnapshotObjectId) OVERRIDE; | 73 virtual void getHeapObjectId(ErrorString*, const String& objectId, String* h
eapSnapshotObjectId) OVERRIDE; |
73 | 74 |
74 private: | 75 private: |
75 class HeapStatsStream; | 76 class HeapStatsStream; |
76 class HeapStatsUpdateTask; | 77 class HeapStatsUpdateTask; |
77 | 78 |
78 explicit InspectorHeapProfilerAgent(InjectedScriptManager*); | 79 explicit InspectorHeapProfilerAgent(InjectedScriptManager*); |
79 | 80 |
80 void requestHeapStatsUpdate(); | 81 void requestHeapStatsUpdate(); |
81 void pushHeapStatsUpdate(const uint32_t* const data, const int size); | 82 void pushHeapStatsUpdate(const uint32_t* const data, const int size); |
82 | 83 |
83 void startTrackingHeapObjectsInternal(bool trackAllocations); | 84 void startTrackingHeapObjectsInternal(bool trackAllocations); |
84 void stopTrackingHeapObjectsInternal(); | 85 void stopTrackingHeapObjectsInternal(); |
85 | 86 |
86 // FIXME: Oilpan: Move InjectedScriptManager to heap in follow-up CL. | 87 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; |
87 InjectedScriptManager* m_injectedScriptManager; | |
88 InspectorFrontend::HeapProfiler* m_frontend; | 88 InspectorFrontend::HeapProfiler* m_frontend; |
89 unsigned m_nextUserInitiatedHeapSnapshotNumber; | 89 unsigned m_nextUserInitiatedHeapSnapshotNumber; |
90 OwnPtr<HeapStatsUpdateTask> m_heapStatsUpdateTask; | 90 OwnPtrWillBeMember<HeapStatsUpdateTask> m_heapStatsUpdateTask; |
91 }; | 91 }; |
92 | 92 |
93 } // namespace WebCore | 93 } // namespace WebCore |
94 | 94 |
95 | 95 |
96 #endif // !defined(InspectorHeapProfilerAgent_h) | 96 #endif // !defined(InspectorHeapProfilerAgent_h) |
OLD | NEW |