diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 18:18:02 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 18:18:02 +0000 |
commit | 4a6621d76d5c1f12746a06cb8efd96c1224ab9c3 (patch) | |
tree | 423a85f645b135bb089eec2964d5b9212fef340c /webkit/glue | |
parent | d120c37264be4ed06b52e64acd390939ebe6e13e (diff) | |
download | chromium_src-4a6621d76d5c1f12746a06cb8efd96c1224ab9c3.zip chromium_src-4a6621d76d5c1f12746a06cb8efd96c1224ab9c3.tar.gz chromium_src-4a6621d76d5c1f12746a06cb8efd96c1224ab9c3.tar.bz2 |
DevTools: prepare for WebKit change 50460.
TBR=pfeldman@chromium.org
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/355012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/devtools/js/debugger_agent.js | 4 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 11 | ||||
-rw-r--r-- | webkit/glue/devtools/js/heap_profiler_panel.js | 6 | ||||
-rw-r--r-- | webkit/glue/devtools/js/inspector_controller.js | 13 | ||||
-rw-r--r-- | webkit/glue/devtools/js/inspector_controller_impl.js | 28 | ||||
-rw-r--r-- | webkit/glue/devtools/js/tests.js | 4 |
6 files changed, 40 insertions, 26 deletions
diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js index 41020d6..c079bb8 100644 --- a/webkit/glue/devtools/js/debugger_agent.js +++ b/webkit/glue/devtools/js/debugger_agent.js @@ -662,7 +662,9 @@ devtools.DebuggerAgent.prototype.setupProfilerProcessorCallbacks = function() { }, function onProfileProcessingFinished(profile) { profilesSidebar.removeChild(processingIcon); - WebInspector.addProfile(profile); + profile.typeId = WebInspector.CPUProfileType.TypeId; + InspectorController.addFullProfile(profile); + WebInspector.addProfileHeader(profile); // If no profile is currently shown, show the new one. var profilesPanel = WebInspector.panels.profiles; if (!profilesPanel.visibleView) { diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index f1e9490..0a452e2 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -432,17 +432,6 @@ WebInspector.ResourcesPanel.prototype._createResourceView = function( })(); -// Temporary workaround for a patch from WebKit bug 30328. -// TODO(mnaganov): Remove when after WebKit roll. -if (!('addProfile' in WebInspector)) { - WebInspector.addProfile = function(profile) { - WebInspector.__fullProfiles = WebInspector.__fullProfiles || {}; - WebInspector.__fullProfiles[profile.uid] = profile; - WebInspector.addProfileHeader(profile); - }; -} - - (function() { var orig = InjectedScriptAccess.getCompletions; InjectedScriptAccess.getCompletions = function(expressionString, diff --git a/webkit/glue/devtools/js/heap_profiler_panel.js b/webkit/glue/devtools/js/heap_profiler_panel.js index ee80506..b0d9b68 100644 --- a/webkit/glue/devtools/js/heap_profiler_panel.js +++ b/webkit/glue/devtools/js/heap_profiler_panel.js @@ -8,13 +8,17 @@ WebInspector.ProfilesPanel.prototype.addSnapshot = function(snapshot) { snapshot.title = WebInspector.UIString("Snapshot %d", snapshot.number); + snapshot.typeId = WebInspector.HeapSnapshotProfileType.TypeId; var snapshots = WebInspector.HeapSnapshotProfileType.snapshots; snapshots.push(snapshot); snapshot.listIndex = snapshots.length - 1; - this.addProfileHeader(WebInspector.HeapSnapshotProfileType.TypeId, snapshot); + if (WebInspector.CPUProfile) + this.addProfileHeader(WebInspector.HeapSnapshotProfileType.TypeId, snapshot); + else + this.addProfileHeader(snapshot); this.dispatchEventToListeners("snapshot added"); } diff --git a/webkit/glue/devtools/js/inspector_controller.js b/webkit/glue/devtools/js/inspector_controller.js index 474b0b5..0dc1652 100644 --- a/webkit/glue/devtools/js/inspector_controller.js +++ b/webkit/glue/devtools/js/inspector_controller.js @@ -446,19 +446,9 @@ devtools.InspectorController.prototype.stopProfiling = function() { /** - * TODO(mnaganov): Remove after injected script change landing in WebKit. - * @return {Array.<Object>} Profile snapshots array. - */ -devtools.InspectorController.prototype.profiles = function() { - return []; -}; - - -/** * Async function for retrieving headers of existing profiles. */ devtools.InspectorController.prototype.getProfileHeaders = function(callId) { - WebInspector.didGetProfileHeaders(callId, []); }; @@ -466,9 +456,6 @@ devtools.InspectorController.prototype.getProfileHeaders = function(callId) { * Async function for lazy loading an existing profile. */ devtools.InspectorController.prototype.getProfile = function(callId, uid) { - if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles)) { - WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]); - } }; diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js index e327bc3..6b341b3 100644 --- a/webkit/glue/devtools/js/inspector_controller_impl.js +++ b/webkit/glue/devtools/js/inspector_controller_impl.js @@ -248,6 +248,34 @@ devtools.InspectorControllerImpl.prototype.stopProfiling = function() { /** * @override */ +devtools.InspectorControllerImpl.prototype.getProfileHeaders = function(callId) { + WebInspector.didGetProfileHeaders(callId, []); +}; + + +/** + * Emulate WebKit InspectorController behavior. It stores profiles on renderer side, + * and is able to retrieve them by uid using 'getProfile'. + */ +devtools.InspectorControllerImpl.prototype.addFullProfile = function(profile) { + WebInspector.__fullProfiles = WebInspector.__fullProfiles || {}; + WebInspector.__fullProfiles[profile.uid] = profile; +}; + + +/** + * @override + */ +devtools.InspectorControllerImpl.prototype.getProfile = function(callId, uid) { + if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles)) { + WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]); + } +}; + + +/** + * @override + */ devtools.InspectorControllerImpl.prototype.takeHeapSnapshot = function() { devtools.tools.getDebuggerAgent().startProfiling( devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT diff --git a/webkit/glue/devtools/js/tests.js b/webkit/glue/devtools/js/tests.js index 53bee69..4a50c55 100644 --- a/webkit/glue/devtools/js/tests.js +++ b/webkit/glue/devtools/js/tests.js @@ -371,6 +371,10 @@ TestSuite.prototype.testProfilerTab = function() { var test = this; this.addSniffer(WebInspector, 'addProfileHeader', function(type, profile) { + if (!profile) { + profile = type; + type = profile.typeId; + } var panel = WebInspector.panels.profiles; panel.showProfile(profile); var node = panel.visibleView.profileDataGridTree.children[0]; |