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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/AsyncOperationsSidebarPane.js

Issue 1666563005: DevTools: merge ScriptCallStack and ScriptAsyncCallStack, move CallStacks from console to Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: testts Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.BreakpointsSidebarPaneBase} 7 * @extends {WebInspector.BreakpointsSidebarPaneBase}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.AsyncOperationsSidebarPane = function() 10 WebInspector.AsyncOperationsSidebarPane = function()
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 272 }
273 }, 273 },
274 274
275 /** 275 /**
276 * @param {!DebuggerAgent.AsyncOperation} operation 276 * @param {!DebuggerAgent.AsyncOperation} operation
277 */ 277 */
278 _createAsyncOperationItem: function(operation) 278 _createAsyncOperationItem: function(operation)
279 { 279 {
280 var element = createElementWithClass("li", "async-operation"); 280 var element = createElementWithClass("li", "async-operation");
281 281
282 var title = operation.description || WebInspector.UIString("Async Operat ion"); 282 var title;
283 if (operation.stack)
284 title = operation.stack.description;
285 if (!title)
286 title = WebInspector.UIString("Async Operation");
287
283 var label = createCheckboxLabel(title, operation[this._checkedSymbol]); 288 var label = createCheckboxLabel(title, operation[this._checkedSymbol]);
284 label.checkboxElement.addEventListener("click", this._checkboxClicked.bi nd(this, operation.id), false); 289 label.checkboxElement.addEventListener("click", this._checkboxClicked.bi nd(this, operation.id), false);
285 element.appendChild(label); 290 element.appendChild(label);
286 var debuggerModel = WebInspector.DebuggerModel.fromTarget(this._target); 291 var debuggerModel = WebInspector.DebuggerModel.fromTarget(this._target);
287 var callFrame = WebInspector.DebuggerPresentationUtils.callFrameAnchorFr omStackTrace(debuggerModel, operation.stackTrace, operation.asyncStackTrace, thi s._revealBlackboxedCallFrames); 292 var callFrame = WebInspector.DebuggerPresentationUtils.callFrameAnchorFr omStackTrace(debuggerModel, operation.stack, this._revealBlackboxedCallFrames);
288 if (callFrame) 293 if (callFrame)
289 element.createChild("div").appendChild(this._linkifier.linkifyConsol eCallFrame(this._target, callFrame)); 294 element.createChild("div").appendChild(this._linkifier.linkifyConsol eCallFrame(this._target, callFrame));
290 295
291 element[this._operationIdSymbol] = operation.id; 296 element[this._operationIdSymbol] = operation.id;
292 this._operationIdToElement.set(operation.id, element); 297 this._operationIdToElement.set(operation.id, element);
293 this.addListElement(element, this.listElement.firstChild); 298 this.addListElement(element, this.listElement.firstChild);
294 299
295 if (operation.id === this._breakpointHitId) { 300 if (operation.id === this._breakpointHitId) {
296 element.classList.add("breakpoint-hit"); 301 element.classList.add("breakpoint-hit");
297 this.expand(); 302 this.expand();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 351
347 /** 352 /**
348 * @param {!Element} anchor 353 * @param {!Element} anchor
349 * @param {!WebInspector.Popover} popover 354 * @param {!WebInspector.Popover} popover
350 */ 355 */
351 _showPopover: function(anchor, popover) 356 _showPopover: function(anchor, popover)
352 { 357 {
353 var operation = this._operationForPopover(anchor); 358 var operation = this._operationForPopover(anchor);
354 if (!operation) 359 if (!operation)
355 return; 360 return;
356 var content = WebInspector.DOMPresentationUtils.buildStackTracePreviewCo ntents(this._target, this._linkifier, operation.stackTrace, operation.asyncStack Trace); 361 var content = WebInspector.DOMPresentationUtils.buildStackTracePreviewCo ntents(this._target, this._linkifier, operation.stack);
357 popover.setCanShrink(true); 362 popover.setCanShrink(true);
358 popover.showForAnchor(content, anchor); 363 popover.showForAnchor(content, anchor);
359 }, 364 },
360 365
361 /** 366 /**
362 * @param {!Element} element 367 * @param {!Element} element
363 * @return {?DebuggerAgent.AsyncOperation} 368 * @return {?DebuggerAgent.AsyncOperation}
364 */ 369 */
365 _operationForPopover: function(element) 370 _operationForPopover: function(element)
366 { 371 {
367 var asyncOperations = this._target && this._asyncOperationsByTarget.get( this._target); 372 var asyncOperations = this._target && this._asyncOperationsByTarget.get( this._target);
368 if (!asyncOperations) 373 if (!asyncOperations)
369 return null; 374 return null;
370 var anchor = element.enclosingNodeOrSelfWithClass("async-operation"); 375 var anchor = element.enclosingNodeOrSelfWithClass("async-operation");
371 if (!anchor) 376 if (!anchor)
372 return null; 377 return null;
373 var operationId = anchor[this._operationIdSymbol]; 378 var operationId = anchor[this._operationIdSymbol];
374 var operation = operationId && asyncOperations.get(operationId); 379 var operation = operationId && asyncOperations.get(operationId);
375 if (!operation || !operation.stackTrace) 380 if (!operation || !operation.stack)
376 return null; 381 return null;
377 return operation; 382 return operation;
378 }, 383 },
379 384
380 __proto__: WebInspector.BreakpointsSidebarPaneBase.prototype 385 __proto__: WebInspector.BreakpointsSidebarPaneBase.prototype
381 } 386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698