Web Inspector: Split Profiler domain in protocol into Profiler and HeapProfiler

https://bugs.webkit.org/show_bug.cgi?id=108653

Patch by Alexei Filippov <alph@chromium.org> on 2013-02-11
Reviewed by Yury Semikhatsky.

Currently CPU and heap profilers share the same domain 'Profiler' in the protocol.
In fact these two profile types have not too much in common. So put each into its own domain.
It should also help when Profiles panel gets split into several tools.
This is the phase 1 which adds InspectorHeapProfilerAgent but doesn't
change the original InspectorProfilerAgent.

PerformanceTests:

* inspector/heap-snapshot-performance-test.js:
(test.performanceTest.cleanup):

Source/WebCore:

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/Inspector.json:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorHeapProfilerAgent.cpp: Added.
(WebCore):
(WebCore::InspectorHeapProfilerAgent::create):
(WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent):
(WebCore::InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent):
(WebCore::InspectorHeapProfilerAgent::resetState):
(WebCore::InspectorHeapProfilerAgent::resetFrontendProfiles):
(WebCore::InspectorHeapProfilerAgent::setFrontend):
(WebCore::InspectorHeapProfilerAgent::clearFrontend):
(WebCore::InspectorHeapProfilerAgent::restore):
(WebCore::InspectorHeapProfilerAgent::collectGarbage):
(WebCore::InspectorHeapProfilerAgent::createSnapshotHeader):
(WebCore::InspectorHeapProfilerAgent::hasHeapProfiler):
(WebCore::InspectorHeapProfilerAgent::getProfileHeaders):
(WebCore::InspectorHeapProfilerAgent::getHeapSnapshot):
(WebCore::InspectorHeapProfilerAgent::removeProfile):
(WebCore::InspectorHeapProfilerAgent::takeHeapSnapshot):
(WebCore::InspectorHeapProfilerAgent::getObjectByHeapObjectId):
(WebCore::InspectorHeapProfilerAgent::getHeapObjectId):
(WebCore::InspectorHeapProfilerAgent::reportMemoryUsage):
* inspector/InspectorHeapProfilerAgent.h: Added.
(WebCore):
(InspectorHeapProfilerAgent):
(WebCore::InspectorHeapProfilerAgent::clearProfiles):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
* inspector/InstrumentingAgents.h:
(WebCore):
(InstrumentingAgents):
(WebCore::InstrumentingAgents::inspectorHeapProfilerAgent):
(WebCore::InstrumentingAgents::setInspectorHeapProfilerAgent):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/front-end/HeapSnapshotDataGrids.js:
* inspector/front-end/HeapSnapshotGridNodes.js:
(WebInspector.HeapSnapshotGenericObjectNode.prototype.queryObjectContent):
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapProfileHeader.prototype.startSnapshotTransfer):
(WebInspector.HeapProfileHeader.prototype.saveToFile.onOpen):
(WebInspector.HeapProfileHeader.prototype.saveToFile):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel):
(WebInspector.ProfilesPanel.prototype._clearProfiles):
(WebInspector.ProfilesPanel.prototype._garbageCollectButtonClicked):
(WebInspector.ProfilesPanel.prototype._removeProfileHeader):
(WebInspector.ProfilesPanel.prototype._populateProfiles.var):
(WebInspector.ProfilesPanel.prototype._populateProfiles.populateCallback):
(WebInspector.ProfilesPanel.prototype._populateProfiles):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
(WebInspector.ProfilesPanel.prototype.revealInView):
(WebInspector.HeapProfilerDispatcher):
(WebInspector.HeapProfilerDispatcher.prototype.addProfileHeader):
(WebInspector.HeapProfilerDispatcher.prototype.addHeapSnapshotChunk):
(WebInspector.HeapProfilerDispatcher.prototype.finishHeapSnapshot):
(WebInspector.HeapProfilerDispatcher.prototype.resetProfiles):
(WebInspector.HeapProfilerDispatcher.prototype.reportHeapSnapshotProgress):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._garbageCollectButtonClicked):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):

Source/WebKit/chromium:

* src/WebDevToolsAgentImpl.cpp:
(WebKit::WebDevToolsAgent::shouldInterruptForMessage):

LayoutTests:

* inspector-protocol/heap-profiler/resources/heap-snapshot-common.js:
(InspectorTest.takeHeapSnapshot.InspectorTest.eventHandler.string_appeared_here):
(InspectorTest.takeHeapSnapshot):
* inspector-protocol/nmi-webaudio-leak-test.html:
* inspector/profiler/heap-snapshot-get-profile-crash.html:
* inspector/profiler/heap-snapshot-inspect-dom-wrapper.html:
* inspector/profiler/heap-snapshot-loader.html:
* inspector/profiler/heap-snapshot-test.js:
(initialize_HeapSnapshotTest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 447e75c6
2013-02-11 Alexei Filippov <alph@chromium.org>
Web Inspector: Split Profiler domain in protocol into Profiler and HeapProfiler
https://bugs.webkit.org/show_bug.cgi?id=108653
Reviewed by Yury Semikhatsky.
Currently CPU and heap profilers share the same domain 'Profiler' in the protocol.
In fact these two profile types have not too much in common. So put each into its own domain.
It should also help when Profiles panel gets split into several tools.
This is the phase 1 which adds InspectorHeapProfilerAgent but doesn't
change the original InspectorProfilerAgent.
* inspector-protocol/heap-profiler/resources/heap-snapshot-common.js:
(InspectorTest.takeHeapSnapshot.InspectorTest.eventHandler.string_appeared_here):
(InspectorTest.takeHeapSnapshot):
* inspector-protocol/nmi-webaudio-leak-test.html:
* inspector/profiler/heap-snapshot-get-profile-crash.html:
* inspector/profiler/heap-snapshot-inspect-dom-wrapper.html:
* inspector/profiler/heap-snapshot-loader.html:
* inspector/profiler/heap-snapshot-test.js:
(initialize_HeapSnapshotTest):
2013-02-11 Christophe Dumez <ch.dumez@sisa.samsung.com>
Unreviewed EFL gardening.
......@@ -9,10 +9,10 @@ InspectorTest.importScript("../../../../../Source/WebCore/inspector/front-end/JS
InspectorTest.takeHeapSnapshot = function(callback)
{
InspectorTest.eventHandler["Profiler.addProfileHeader"] = function(messageObject)
InspectorTest.eventHandler["HeapProfiler.addProfileHeader"] = function(messageObject)
{
var profileId = messageObject["params"]["header"]["uid"];
InspectorTest.sendCommand("Profiler.getHeapSnapshot", { "uid": profileId }, didGetHeapSnapshot);
InspectorTest.sendCommand("HeapProfiler.getHeapSnapshot", { "uid": profileId }, didGetHeapSnapshot);
function didGetHeapSnapshot(messageObject)
{
......@@ -22,12 +22,12 @@ InspectorTest.takeHeapSnapshot = function(callback)
}
var chunks = [];
InspectorTest.eventHandler["Profiler.addHeapSnapshotChunk"] = function(messageObject)
InspectorTest.eventHandler["HeapProfiler.addHeapSnapshotChunk"] = function(messageObject)
{
chunks.push(messageObject["params"]["chunk"]);
}
InspectorTest.eventHandler["Profiler.finishHeapSnapshot"] = function(messageObject)
InspectorTest.eventHandler["HeapProfiler.finishHeapSnapshot"] = function(messageObject)
{
var serializedSnapshot = chunks.join("");
var parsed = JSON.parse(serializedSnapshot);
......@@ -35,5 +35,5 @@ InspectorTest.takeHeapSnapshot = function(callback)
callback(snapshot);
}
InspectorTest.sendCommand("Profiler.takeHeapSnapshot", {});
InspectorTest.sendCommand("HeapProfiler.takeHeapSnapshot", {});
}
......@@ -60,7 +60,7 @@ function test()
function iFrameNavigated(messageObject) {
InspectorTest.log("PASS: IFrame was navigated to resources/blank.html");
InspectorTest.sendCommand('Profiler.collectGarbage', {}, function() { } );
InspectorTest.sendCommand('HeapProfiler.collectGarbage', {}, function() { } );
InspectorTest.log("Action: Run GC and check Page.Audio data size");
InspectorTest.sendCommand('Memory.getProcessMemoryDistribution', {}, noAudioSharedData);
}
......
......@@ -14,7 +14,7 @@ function test()
console.log(errorString);
next();
}
ProfilerAgent.getHeapSnapshot(-1, finish);
HeapProfilerAgent.getHeapSnapshot(-1, finish);
}
]);
}
......
......@@ -14,7 +14,7 @@ function handleLoad()
function test()
{
WebInspector.showPanel("profiles");
ProfilerAgent.takeHeapSnapshot(step0);
HeapProfilerAgent.takeHeapSnapshot(step0);
function step0()
{
......@@ -42,7 +42,7 @@ function test()
bodyWrapperIds.push(it.node.id);
}
for (var i = 0; i < bodyWrapperIds.length; i++)
ProfilerAgent.getObjectByHeapObjectId(bodyWrapperIds[i], undefined, didGetObjectByHeapObjectId);
HeapProfilerAgent.getObjectByHeapObjectId(bodyWrapperIds[i], undefined, didGetObjectByHeapObjectId);
var resolvedObjectsCount = 0;
var remoteObjects = [];
......@@ -69,7 +69,7 @@ function test()
if (++didGetOwnPropertiesCount !== remoteObjects.length)
return;
ProfilerAgent.clearProfiles(done);
HeapProfilerAgent.clearProfiles(done);
WebInspector.panels.profiles._reset();
}
}
......
......@@ -17,7 +17,7 @@ function test()
var partSize = sourceStringified.length >> 3;
function injectMockProfile(overrideGetProfile, callback) {
var dispatcher = InspectorBackend._domainDispatchers["Profiler"];
var dispatcher = InspectorBackend._domainDispatchers["HeapProfiler"];
var panel = WebInspector.panels.profiles;
panel._reset();
......@@ -39,12 +39,12 @@ function test()
function snapshotLoaded()
{
if (overrideGetProfile)
InspectorTest.override(ProfilerAgent, "getHeapSnapshot", getHeapSnapshotMock);
InspectorTest.override(HeapProfilerAgent, "getHeapSnapshot", getHeapSnapshotMock);
callback(profileHeader);
}
InspectorTest.addSniffer(profileHeader, "_snapshotReceived", snapshotLoaded);
InspectorTest.override(ProfilerAgent, "getHeapSnapshot", getHeapSnapshotMock);
InspectorTest.override(HeapProfilerAgent, "getHeapSnapshot", getHeapSnapshotMock);
panel.showProfile(profileHeader);
}
......
......@@ -172,7 +172,7 @@ InspectorTest.startProfilerTest = function(callback)
function profilerEnabled()
{
InspectorTest.addResult("Profiler was enabled.");
// We mock out ProfilerAgent -- as DRT runs in single-process mode, Inspector
// We mock out HeapProfilerAgent -- as DRT runs in single-process mode, Inspector
// and test share the same heap. Taking a snapshot takes too long for a test,
// so we provide synthetic snapshots.
InspectorTest._panelReset = InspectorTest.override(WebInspector.panels.profiles, "_reset", function(){}, true);
......@@ -735,7 +735,7 @@ InspectorTest.takeAndOpenSnapshot = function(generator, callback)
WebInspector.panels.profiles._addHeapSnapshotChunk(uid, JSON.stringify(snapshot));
WebInspector.panels.profiles._finishHeapSnapshot(uid);
}
InspectorTest.override(ProfilerAgent, "getHeapSnapshot", pushGeneratedSnapshot);
InspectorTest.override(HeapProfilerAgent, "getHeapSnapshot", pushGeneratedSnapshot);
InspectorTest._takeAndOpenSnapshotCallback = callback;
WebInspector.panels.profiles.addProfileHeader(profile);
WebInspector.panels.profiles.showProfile(profile);
......
2013-02-11 Alexei Filippov <alph@chromium.org>
Web Inspector: Split Profiler domain in protocol into Profiler and HeapProfiler
https://bugs.webkit.org/show_bug.cgi?id=108653
Reviewed by Yury Semikhatsky.
Currently CPU and heap profilers share the same domain 'Profiler' in the protocol.
In fact these two profile types have not too much in common. So put each into its own domain.
It should also help when Profiles panel gets split into several tools.
This is the phase 1 which adds InspectorHeapProfilerAgent but doesn't
change the original InspectorProfilerAgent.
* inspector/heap-snapshot-performance-test.js:
(test.performanceTest.cleanup):
2013-02-05 Dominik Röttsches <dominik.rottsches@intel.com>
Add a performance test for arabic line breaking
......
......@@ -27,7 +27,7 @@ function test()
var testName = /([^\/]+)\.html$/.exec(WebInspector.inspectedPageURL)[1];
var fullTimerCookie = timer.start("full-summary-snapshot-time");
var backendTimerCookie = timer.start("take-snapshot");
ProfilerAgent.takeHeapSnapshot(step0);
HeapProfilerAgent.takeHeapSnapshot(step0);
function step0()
{
......@@ -59,7 +59,7 @@ function test()
timer.finish(changeViewTimerCookie);
timer.finish(fullTimerCookie);
clearTimerCookie = timer.start("clear-snapshot");
ProfilerAgent.clearProfiles(done);
HeapProfilerAgent.clearProfiles(done);
WebInspector.panels.profiles._reset();
}
......
......@@ -1641,6 +1641,7 @@ set(WebCore_SOURCES
inspector/InspectorFileSystemAgent.cpp
inspector/InspectorFrontendClientLocal.cpp
inspector/InspectorFrontendHost.cpp
inspector/InspectorHeapProfilerAgent.cpp
inspector/InspectorHistory.cpp
inspector/InspectorIndexedDBAgent.cpp
inspector/InspectorInputAgent.cpp
......
2013-02-11 Alexei Filippov <alph@chromium.org>
Web Inspector: Split Profiler domain in protocol into Profiler and HeapProfiler
https://bugs.webkit.org/show_bug.cgi?id=108653
Reviewed by Yury Semikhatsky.
Currently CPU and heap profilers share the same domain 'Profiler' in the protocol.
In fact these two profile types have not too much in common. So put each into its own domain.
It should also help when Profiles panel gets split into several tools.
This is the phase 1 which adds InspectorHeapProfilerAgent but doesn't
change the original InspectorProfilerAgent.
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/Inspector.json:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorHeapProfilerAgent.cpp: Added.
(WebCore):
(WebCore::InspectorHeapProfilerAgent::create):
(WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent):
(WebCore::InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent):
(WebCore::InspectorHeapProfilerAgent::resetState):
(WebCore::InspectorHeapProfilerAgent::resetFrontendProfiles):
(WebCore::InspectorHeapProfilerAgent::setFrontend):
(WebCore::InspectorHeapProfilerAgent::clearFrontend):
(WebCore::InspectorHeapProfilerAgent::restore):
(WebCore::InspectorHeapProfilerAgent::collectGarbage):
(WebCore::InspectorHeapProfilerAgent::createSnapshotHeader):
(WebCore::InspectorHeapProfilerAgent::hasHeapProfiler):
(WebCore::InspectorHeapProfilerAgent::getProfileHeaders):
(WebCore::InspectorHeapProfilerAgent::getHeapSnapshot):
(WebCore::InspectorHeapProfilerAgent::removeProfile):
(WebCore::InspectorHeapProfilerAgent::takeHeapSnapshot):
(WebCore::InspectorHeapProfilerAgent::getObjectByHeapObjectId):
(WebCore::InspectorHeapProfilerAgent::getHeapObjectId):
(WebCore::InspectorHeapProfilerAgent::reportMemoryUsage):
* inspector/InspectorHeapProfilerAgent.h: Added.
(WebCore):
(InspectorHeapProfilerAgent):
(WebCore::InspectorHeapProfilerAgent::clearProfiles):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
* inspector/InstrumentingAgents.h:
(WebCore):
(InstrumentingAgents):
(WebCore::InstrumentingAgents::inspectorHeapProfilerAgent):
(WebCore::InstrumentingAgents::setInspectorHeapProfilerAgent):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/front-end/HeapSnapshotDataGrids.js:
* inspector/front-end/HeapSnapshotGridNodes.js:
(WebInspector.HeapSnapshotGenericObjectNode.prototype.queryObjectContent):
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapProfileHeader.prototype.startSnapshotTransfer):
(WebInspector.HeapProfileHeader.prototype.saveToFile.onOpen):
(WebInspector.HeapProfileHeader.prototype.saveToFile):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel):
(WebInspector.ProfilesPanel.prototype._clearProfiles):
(WebInspector.ProfilesPanel.prototype._garbageCollectButtonClicked):
(WebInspector.ProfilesPanel.prototype._removeProfileHeader):
(WebInspector.ProfilesPanel.prototype._populateProfiles.var):
(WebInspector.ProfilesPanel.prototype._populateProfiles.populateCallback):
(WebInspector.ProfilesPanel.prototype._populateProfiles):
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
(WebInspector.ProfilesPanel.prototype.revealInView):
(WebInspector.HeapProfilerDispatcher):
(WebInspector.HeapProfilerDispatcher.prototype.addProfileHeader):
(WebInspector.HeapProfilerDispatcher.prototype.addHeapSnapshotChunk):
(WebInspector.HeapProfilerDispatcher.prototype.finishHeapSnapshot):
(WebInspector.HeapProfilerDispatcher.prototype.resetProfiles):
(WebInspector.HeapProfilerDispatcher.prototype.reportHeapSnapshotProgress):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._garbageCollectButtonClicked):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):
2013-02-11 Mike West <mkwst@chromium.org>
Use IGNORE_EXCEPTION for Editor::countMatchesForText's ignored exceptions.
......@@ -3833,6 +3833,8 @@ webcore_sources += \
Source/WebCore/inspector/InspectorFrontendClientLocal.h \
Source/WebCore/inspector/InspectorFrontendHost.cpp \
Source/WebCore/inspector/InspectorFrontendHost.h \
Source/WebCore/inspector/InspectorHeapProfilerAgent.cpp \
Source/WebCore/inspector/InspectorHeapProfilerAgent.h \
Source/WebCore/inspector/InspectorHistory.cpp \
Source/WebCore/inspector/InspectorHistory.h \
Source/WebCore/inspector/InspectorIndexedDBAgent.h \
......
......@@ -799,6 +799,7 @@ SOURCES += \
inspector/InspectorDOMStorageResource.cpp \
inspector/InspectorFrontendClientLocal.cpp \
inspector/InspectorFrontendHost.cpp \
inspector/InspectorHeapProfilerAgent.cpp \
inspector/InspectorHistory.cpp \
inspector/InspectorInputAgent.cpp \
inspector/InspectorInstrumentation.cpp \
......@@ -1992,6 +1993,7 @@ HEADERS += \
inspector/InspectorFrontendClient.h \
inspector/InspectorFrontendClientLocal.h \
inspector/InspectorFrontendHost.h \
inspector/InspectorHeapProfilerAgent.h \
inspector/InspectorHistory.h \
inspector/InspectorInstrumentation.h \
inspector/InspectorLayerTreeAgent.h \
......
......@@ -1878,6 +1878,8 @@
'inspector/InspectorFrontendClientLocal.cpp',
'inspector/InspectorFrontendHost.cpp',
'inspector/InspectorFrontendHost.h',
'inspector/InspectorHeapProfilerAgent.cpp',
'inspector/InspectorHeapProfilerAgent.h',
'inspector/InspectorHistory.cpp',
'inspector/InspectorHistory.h',
'inspector/InspectorIndexedDBAgent.cpp',
......
......@@ -76050,6 +76050,30 @@
RelativePath="..\inspector\InspectorFrontendHost.h"
>
</File>
<File
RelativePath="..\inspector\InspectorHeapProfilerAgent.cpp"
>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Production|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\inspector\InspectorHeapProfilerAgent.h"
>
</File>
<File
RelativePath="..\inspector\InspectorHistory.cpp"
>
......@@ -5692,6 +5692,9 @@
<ClCompile Include="..\inspector\InspectorFrontendHost.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\inspector\InspectorHeapProfilerAgent.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\inspector\InspectorHistory.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
......@@ -8370,6 +8373,7 @@
<ClInclude Include="..\inspector\InspectorFrontendClient.h" />
<ClInclude Include="..\inspector\InspectorFrontendClientLocal.h" />
<ClInclude Include="..\inspector\InspectorFrontendHost.h" />
<ClInclude Include="..\inspector\InspectorHeapProfilerAgent.h" />
<ClInclude Include="..\inspector\InspectorHistory.h" />
<ClInclude Include="..\inspector\InspectorIndexedDBAgent.h" />
<ClInclude Include="..\inspector\InspectorInputAgent.h" />
......
......@@ -6492,6 +6492,9 @@
<ClCompile Include="..\inspector\InspectorFrontendHost.cpp">
<Filter>inspector</Filter>
</ClCompile>
<ClCompile Include="..\inspector\InspectorHeapProfilerAgent.cpp">
<Filter>inspector</Filter>
</ClCompile>
<ClCompile Include="..\inspector\InspectorHistory.cpp">
<Filter>inspector</Filter>
</ClCompile>
......@@ -13779,6 +13782,9 @@
<ClInclude Include="..\inspector\InspectorFrontendHost.h">
<Filter>inspector</Filter>
</ClInclude>
<ClInclude Include="..\inspector\InspectorHeapProfilerAgent.h">
<Filter>inspector</Filter>
</ClInclude>
<ClInclude Include="..\inspector\InspectorHistory.h">
<Filter>inspector</Filter>
</ClInclude>
......
......@@ -3815,6 +3815,8 @@
9BF9A8811648DD2F001C6B23 /* JSHTMLFormControlsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BF9A87F1648DD2F001C6B23 /* JSHTMLFormControlsCollection.h */; };
9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */; };
9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */; };
5112935F3D54B4B52FAF973F /* InspectorHeapProfilerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511293613D6DB4B52FAF973F /* InspectorHeapProfilerAgent.cpp */; };
511293603D60B4B52FAF973F /* InspectorHeapProfilerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 511293623D85B4B52FAF973F /* InspectorHeapProfilerAgent.h */; };
9F3B947E12241758005304E7 /* ScriptHeapSnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F3B947D12241758005304E7 /* ScriptHeapSnapshot.h */; };
9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */; };
9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -11280,6 +11282,8 @@
9BF9A87F1648DD2F001C6B23 /* JSHTMLFormControlsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLFormControlsCollection.h; sourceTree = "<group>"; };
9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorProfilerAgent.cpp; sourceTree = "<group>"; };
9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorProfilerAgent.h; sourceTree = "<group>"; };
511293613D6DB4B52FAF973F /* InspectorHeapProfilerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorHeapProfilerAgent.cpp; sourceTree = "<group>"; };
511293623D85B4B52FAF973F /* InspectorHeapProfilerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorHeapProfilerAgent.h; sourceTree = "<group>"; };
9F3B947D12241758005304E7 /* ScriptHeapSnapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptHeapSnapshot.h; sourceTree = "<group>"; };
9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; };
9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; };
......@@ -15215,6 +15219,8 @@
7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */,
7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */,
7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */,
511293613D6DB4B52FAF973F /* InspectorHeapProfilerAgent.cpp */,
511293623D85B4B52FAF973F /* InspectorHeapProfilerAgent.h */,
7A54857D14E02D51006AE05A /* InspectorHistory.cpp */,
7A54857E14E02D51006AE05A /* InspectorHistory.h */,
7ACD88D114C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp */,
......@@ -24662,6 +24668,7 @@
F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
511293603D60B4B52FAF973F /* InspectorHeapProfilerAgent.h in Headers */,
7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */,
7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */,
4D273CFA1669420800259CA1 /* InspectorInputAgent.h in Headers */,
......@@ -27940,6 +27947,7 @@
4F4F5FFB11CBD2E100A186BF /* InspectorFrontend.cpp in Sources */,
F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
5112935F3D54B4B52FAF973F /* InspectorHeapProfilerAgent.cpp in Sources */,
7A54857F14E02D51006AE05A /* InspectorHistory.cpp in Sources */,
7ACD88D314C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp in Sources */,
4D273CF91669420800259CA1 /* InspectorInputAgent.cpp in Sources */,
......@@ -3245,6 +3245,115 @@
}
]
},
{
"domain": "HeapProfiler",
"hidden": true,
"types": [
{
"id": "ProfileHeader",
"type": "object",
"description": "Profile header.",
"properties": [
{ "name": "title", "type": "string", "description": "Profile title." },
{ "name": "uid", "type": "integer", "description": "Unique identifier of the profile." },
{ "name": "maxJSObjectId", "type": "integer", "optional": true, "description": "Last seen JS object Id." }
]
},
{
"id": "HeapSnapshotObjectId",
"type": "string",
"description": "Heap snashot object id."
}
],
"commands": [
{
"name": "hasHeapProfiler",
"returns": [
{ "name": "result", "type": "boolean" }
]
},
{
"name": "getProfileHeaders",
"returns": [
{ "name": "headers", "type": "array", "items": { "$ref": "ProfileHeader"} }
]
},
{
"name": "getHeapSnapshot",
"parameters": [
{ "name": "uid", "type": "integer" }
]
},
{
"name": "removeProfile",
"parameters": [
{ "name": "uid", "type": "integer" }
]
},
{
"name": "clearProfiles"
},
{
"name": "takeHeapSnapshot",
"parameters": [
{ "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
]
},
{
"name": "collectGarbage"
},
{
"name": "getObjectByHeapObjectId",
"parameters": [
{ "name": "objectId", "$ref": "HeapSnapshotObjectId" },
{ "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
],
"returns": [
{ "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }
]
},
{
"name": "getHeapObjectId",
"parameters": [
{ "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }
],
"returns": [
{ "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }
]
}
],
"events": [
{
"name": "addProfileHeader",
"parameters": [
{ "name": "header", "$ref": "ProfileHeader" }
]
},
{
"name": "addHeapSnapshotChunk",
"parameters": [
{ "name": "uid", "type": "integer" },
{ "name": "chunk", "type": "string" }
]
},
{
"name": "finishHeapSnapshot",
"parameters": [
{ "name": "uid", "type": "integer" }
]
},
{
"name": "resetProfiles"
},
{
"name": "reportHeapSnapshotProgress",
"parameters": [
{ "name": "done", "type": "integer" },
{ "name": "total", "type": "integer" }
]
}
]
},
{
"domain": "Worker",
"hidden": true,
......
......@@ -56,6 +56,7 @@
#include "InspectorFileSystemAgent.cpp"
#include "InspectorFrontendClientLocal.cpp"
#include "InspectorFrontendHost.cpp"
#include "InspectorHeapProfilerAgent.cpp"
#include "InspectorHistory.cpp"
#include "InspectorIndexedDBAgent.cpp"
#include "InspectorInputAgent.cpp"
......
......@@ -54,6 +54,7 @@
#include "InspectorFileSystemAgent.h"
#include "InspectorFrontend.h"
#include "InspectorFrontendClient.h"
#include "InspectorHeapProfilerAgent.h"
#include "InspectorIndexedDBAgent.h"
#include "InspectorInputAgent.h"
#include "InspectorInstrumentation.h"
......@@ -152,6 +153,9 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
OwnPtr<InspectorProfilerAgent> profilerAgentPtr(InspectorProfilerAgent::create(m_instrumentingAgents.get(), consoleAgent, page, m_state.get(), m_injectedScriptManager.get()));
m_profilerAgent = profilerAgentPtr.get();
m_agents.append(profilerAgentPtr.release());
m_agents.append(InspectorHeapProfilerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_injectedScriptManager.get()));
#endif
#if ENABLE(WORKERS)
......
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
#include "InspectorHeapProfilerAgent.h"
#include "InjectedScript.h"
#include "InjectedScriptHost.h"