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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "InspectorHeapProfilerAgent.h" | 32 #include "InspectorHeapProfilerAgent.h" |
33 | 33 |
34 #include "InjectedScript.h" | 34 #include "InjectedScript.h" |
35 #include "InjectedScriptHost.h" | 35 #include "InjectedScriptHost.h" |
36 #include "InspectorState.h" | 36 #include "InspectorState.h" |
37 #include "InstrumentingAgents.h" | 37 #include "InstrumentingAgents.h" |
38 #include "ScriptProfiler.h" | 38 #include "ScriptProfiler.h" |
39 #include "WebCoreMemoryInstrumentation.h" | |
40 #include <wtf/MemoryInstrumentationHashMap.h> | |
41 | 39 |
42 namespace WebCore { | 40 namespace WebCore { |
43 | 41 |
44 namespace HeapProfilerAgentState { | 42 namespace HeapProfilerAgentState { |
45 static const char profileHeadersRequested[] = "profileHeadersRequested"; | 43 static const char profileHeadersRequested[] = "profileHeadersRequested"; |
46 } | 44 } |
47 | 45 |
48 static const char* const UserInitiatedProfileNameHeap = "org.webkit.profiles.use
r-initiated"; | 46 static const char* const UserInitiatedProfileNameHeap = "org.webkit.profiles.use
r-initiated"; |
49 | 47 |
50 PassOwnPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(Instru
mentingAgents* instrumentingAgents, InspectorCompositeState* inspectorState, Inj
ectedScriptManager* injectedScriptManager) | 48 PassOwnPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(Instru
mentingAgents* instrumentingAgents, InspectorCompositeState* inspectorState, Inj
ectedScriptManager* injectedScriptManager) |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 221 } |
224 ScriptValue value = injectedScript.findObjectById(objectId); | 222 ScriptValue value = injectedScript.findObjectById(objectId); |
225 if (value.hasNoValue() || value.isUndefined()) { | 223 if (value.hasNoValue() || value.isUndefined()) { |
226 *errorString = "Object with given id not found"; | 224 *errorString = "Object with given id not found"; |
227 return; | 225 return; |
228 } | 226 } |
229 unsigned id = ScriptProfiler::getHeapObjectId(value); | 227 unsigned id = ScriptProfiler::getHeapObjectId(value); |
230 *heapSnapshotObjectId = String::number(id); | 228 *heapSnapshotObjectId = String::number(id); |
231 } | 229 } |
232 | 230 |
233 void InspectorHeapProfilerAgent::reportMemoryUsage(MemoryObjectInfo* memoryObjec
tInfo) const | |
234 { | |
235 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::InspectorPr
ofilerAgent); | |
236 InspectorBaseAgent<InspectorHeapProfilerAgent>::reportMemoryUsage(memoryObje
ctInfo); | |
237 info.addMember(m_injectedScriptManager, "injectedScriptManager"); | |
238 info.addWeakPointer(m_frontend); | |
239 info.addMember(m_snapshots, "snapshots"); | |
240 } | |
241 | |
242 } // namespace WebCore | 231 } // namespace WebCore |
243 | 232 |
OLD | NEW |