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

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

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 11 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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.SidebarPane} 7 * @extends {WebInspector.SidebarPane}
8 * @param {!WebInspector.BreakpointManager} breakpointManager 8 * @param {!WebInspector.BreakpointManager} breakpointManager
9 * @param {function(!WebInspector.UISourceCode, number=, number=, boolean=)} sho wSourceLineDelegate 9 * @param {function(!WebInspector.UISourceCode, number=, number=, boolean=)} sho wSourceLineDelegate
10 */ 10 */
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 var contentString = new String(content); 92 var contentString = new String(content);
93 if (lineNumber < contentString.lineCount()) { 93 if (lineNumber < contentString.lineCount()) {
94 var lineText = contentString.lineAt(lineNumber); 94 var lineText = contentString.lineAt(lineNumber);
95 var maxSnippetLength = 200; 95 var maxSnippetLength = 200;
96 var snippetStartIndex = columnNumber > 100 ? columnNumber : 0; 96 var snippetStartIndex = columnNumber > 100 ? columnNumber : 0;
97 snippetElement.textContent = lineText.substr(snippetStartIndex). trimEnd(maxSnippetLength); 97 snippetElement.textContent = lineText.substr(snippetStartIndex). trimEnd(maxSnippetLength);
98 } 98 }
99 this.didReceiveBreakpointLineForTest(uiLocation.uiSourceCode); 99 this.didReceiveBreakpointLineForTest(uiLocation.uiSourceCode);
100 } 100 }
101 101
102 uiLocation.uiSourceCode.requestContent(didRequestContent.bind(this)); 102 uiLocation.uiSourceCode.requestContent().then(didRequestContent.bind(thi s));
103 103
104 element._data = uiLocation; 104 element._data = uiLocation;
105 var currentElement = this.listElement.firstChild; 105 var currentElement = this.listElement.firstChild;
106 while (currentElement) { 106 while (currentElement) {
107 if (currentElement._data && this._compareBreakpoints(currentElement. _data, element._data) > 0) 107 if (currentElement._data && this._compareBreakpoints(currentElement. _data, element._data) > 0)
108 break; 108 break;
109 currentElement = currentElement.nextSibling; 109 currentElement = currentElement.nextSibling;
110 } 110 }
111 this._addListElement(element, currentElement); 111 this._addListElement(element, currentElement);
112 112
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 this.listElement.removeChildren(); 251 this.listElement.removeChildren();
252 if (this.listElement.parentElement) { 252 if (this.listElement.parentElement) {
253 this.element.removeChild(this.listElement); 253 this.element.removeChild(this.listElement);
254 this.element.appendChild(this.emptyElement); 254 this.element.appendChild(this.emptyElement);
255 } 255 }
256 this._items.clear(); 256 this._items.clear();
257 }, 257 },
258 258
259 __proto__: WebInspector.SidebarPane.prototype 259 __proto__: WebInspector.SidebarPane.prototype
260 } 260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698