Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: chrome/tools/test/reference_build/chrome_linux/resources/inspector/CallStackSidebarPane.js

Issue 177049: On Linux, move the passing of filedescriptors to a dedicated socketpair(). (Closed)
Patch Set: Removed *.d files from reference build Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/tools/test/reference_build/chrome_linux/resources/inspector/CallStackSidebarPane.js
diff --git a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/CallStackSidebarPane.js b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/CallStackSidebarPane.js
index a2c8bedae2367732649099402bd8a78ead9e3015..2fe4315c15c516bd66be12124484e6c1ef3b6005 100644
--- a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/CallStackSidebarPane.js
+++ b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/CallStackSidebarPane.js
@@ -26,17 +26,27 @@
WebInspector.CallStackSidebarPane = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
+
+ this._shortcuts = {};
+
+ var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Period,
+ WebInspector.KeyboardShortcut.Modifiers.Ctrl);
+ this._shortcuts[shortcut] = this._selectNextCallFrameOnStack.bind(this);
+
+ var shortcut = WebInspector.KeyboardShortcut.makeKey(WebInspector.KeyboardShortcut.KeyCodes.Comma,
+ WebInspector.KeyboardShortcut.Modifiers.Ctrl);
+ this._shortcuts[shortcut] = this._selectPreviousCallFrameOnStack.bind(this);
}
WebInspector.CallStackSidebarPane.prototype = {
- update: function(callFrame, sourceIDMap)
+ update: function(callFrames, sourceIDMap)
{
this.bodyElement.removeChildren();
this.placards = [];
delete this._selectedCallFrame;
- if (!callFrame) {
+ if (!callFrames) {
var infoElement = document.createElement("div");
infoElement.className = "info";
infoElement.textContent = WebInspector.UIString("Not Paused");
@@ -48,7 +58,8 @@ WebInspector.CallStackSidebarPane.prototype = {
var subtitle;
var scriptOrResource;
- do {
+ for (var i = 0; i < callFrames.length; ++i) {
+ var callFrame = callFrames[i];
switch (callFrame.type) {
case "function":
title = callFrame.functionName || WebInspector.UIString("(anonymous function)");
@@ -75,9 +86,7 @@ WebInspector.CallStackSidebarPane.prototype = {
this.placards.push(placard);
this.bodyElement.appendChild(placard.element);
-
- callFrame = callFrame.caller;
- } while (callFrame);
+ }
},
get selectedCallFrame()
@@ -100,6 +109,53 @@ WebInspector.CallStackSidebarPane.prototype = {
this.dispatchEventToListeners("call frame selected");
},
+ handleKeyEvent: function(event)
+ {
+ var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(event);
+ var handler = this._shortcuts[shortcut];
+ if (handler) {
+ handler(event);
+ event.preventDefault();
+ event.handled = true;
+ }
+ },
+
+ _selectNextCallFrameOnStack: function()
+ {
+ var index = this._selectedCallFrameIndex();
+ if (index == -1)
+ return;
+ this._selectedPlacardByIndex(index + 1);
+ },
+
+ _selectPreviousCallFrameOnStack: function()
+ {
+ var index = this._selectedCallFrameIndex();
+ if (index == -1)
+ return;
+ this._selectedPlacardByIndex(index - 1);
+ },
+
+ _selectedPlacardByIndex: function(index)
+ {
+ if (index < 0 || index >= this.placards.length)
+ return;
+ var placard = this.placards[index];
+ this.selectedCallFrame = placard.callFrame
+ },
+
+ _selectedCallFrameIndex: function()
+ {
+ if (!this._selectedCallFrame)
+ return -1;
+ for (var i = 0; i < this.placards.length; ++i) {
+ var placard = this.placards[i];
+ if (placard.callFrame === this._selectedCallFrame)
+ return i;
+ }
+ return -1;
+ },
+
_placardSelected: function(event)
{
var placardElement = event.target.enclosingNodeOrSelfWithClass("placard");

Powered by Google App Engine
This is Rietveld 408576698