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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js

Issue 1974543002: DevTools: do not pro-actively query all StyleSheets for their content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @implements {WebInspector.ContentProvider} 7 * @implements {WebInspector.ContentProvider}
8 * @param {!WebInspector.CSSModel} cssModel 8 * @param {!WebInspector.CSSModel} cssModel
9 * @param {!CSSAgent.CSSStyleSheetHeader} payload 9 * @param {!CSSAgent.CSSStyleSheetHeader} payload
10 */ 10 */
(...skipping 15 matching lines...) Expand all
26 this.setSourceMapURL(payload.sourceMapURL); 26 this.setSourceMapURL(payload.sourceMapURL);
27 } 27 }
28 28
29 WebInspector.CSSStyleSheetHeader.prototype = { 29 WebInspector.CSSStyleSheetHeader.prototype = {
30 /** 30 /**
31 * @return {!WebInspector.ContentProvider} 31 * @return {!WebInspector.ContentProvider}
32 */ 32 */
33 originalContentProvider: function() 33 originalContentProvider: function()
34 { 34 {
35 if (!this._originalContentProvider) { 35 if (!this._originalContentProvider) {
36 var originalContentPromise = this._cssModel.originalStyleSheetText(t his); 36 var lazyContent = this._cssModel.originalStyleSheetText.bind(this._c ssModel, this);
37 this._originalContentProvider = new WebInspector.StaticContentProvid er(this.contentURL(), this.contentType(), originalContentPromise); 37 this._originalContentProvider = new WebInspector.StaticContentProvid er(this.contentURL(), this.contentType(), lazyContent);
38 } 38 }
39 return this._originalContentProvider; 39 return this._originalContentProvider;
40 }, 40 },
41 41
42 /** 42 /**
43 * @param {string=} sourceMapURL 43 * @param {string=} sourceMapURL
44 */ 44 */
45 setSourceMapURL: function(sourceMapURL) 45 setSourceMapURL: function(sourceMapURL)
46 { 46 {
47 var completeSourceMapURL = this.sourceURL && sourceMapURL ? WebInspector .ParsedURL.completeURL(this.sourceURL, sourceMapURL) : null; 47 var completeSourceMapURL = this.sourceURL && sourceMapURL ? WebInspector .ParsedURL.completeURL(this.sourceURL, sourceMapURL) : null;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 * @param {?string} content 211 * @param {?string} content
212 */ 212 */
213 function performSearch(content) 213 function performSearch(content)
214 { 214 {
215 var searchResults = content ? WebInspector.ContentProvider.performSe archInContent(content, query, caseSensitive, isRegex) : []; 215 var searchResults = content ? WebInspector.ContentProvider.performSe archInContent(content, query, caseSensitive, isRegex) : [];
216 callback(searchResults); 216 callback(searchResults);
217 } 217 }
218 218
219 this.requestContent().then(performSearch); 219 this.requestContent().then(performSearch);
220 } 220 }
221 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698