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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2931143003: DevTools: make debugger's rawLocationToUILocation return nullable type (Closed)
Patch Set: add test Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 * @return {?string} 599 * @return {?string}
600 */ 600 */
601 function linkifyLocationAsText(scriptId, lineNumber, columnNumber) { 601 function linkifyLocationAsText(scriptId, lineNumber, columnNumber) {
602 var debuggerModel = target ? target.model(SDK.DebuggerModel) : null; 602 var debuggerModel = target ? target.model(SDK.DebuggerModel) : null;
603 if (!target || target.isDisposed() || !scriptId || !debuggerModel) 603 if (!target || target.isDisposed() || !scriptId || !debuggerModel)
604 return null; 604 return null;
605 var rawLocation = debuggerModel.createRawLocationByScriptId(scriptId, line Number, columnNumber); 605 var rawLocation = debuggerModel.createRawLocationByScriptId(scriptId, line Number, columnNumber);
606 if (!rawLocation) 606 if (!rawLocation)
607 return null; 607 return null;
608 var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation (rawLocation); 608 var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation (rawLocation);
609 return uiLocation.linkText(); 609 return uiLocation ? uiLocation.linkText() : null;
610 } 610 }
611 611
612 /** 612 /**
613 * @return {?string} 613 * @return {?string}
614 */ 614 */
615 function linkifyTopCallFrameAsText() { 615 function linkifyTopCallFrameAsText() {
616 var frame = TimelineModel.TimelineData.forEvent(event).topFrame(); 616 var frame = TimelineModel.TimelineData.forEvent(event).topFrame();
617 if (!frame) 617 if (!frame)
618 return null; 618 return null;
619 var text = linkifyLocationAsText(frame.scriptId, frame.lineNumber, frame.c olumnNumber); 619 var text = linkifyLocationAsText(frame.scriptId, frame.lineNumber, frame.c olumnNumber);
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 * @param {string=} warningType 2308 * @param {string=} warningType
2309 */ 2309 */
2310 appendWarningRow(event, warningType) { 2310 appendWarningRow(event, warningType) {
2311 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); 2311 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType);
2312 if (warning) 2312 if (warning)
2313 this.appendElementRow(Common.UIString('Warning'), warning, true); 2313 this.appendElementRow(Common.UIString('Warning'), warning, true);
2314 } 2314 }
2315 }; 2315 };
2316 2316
2317 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache'); 2317 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698