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

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

Issue 2702583003: DevTools: do not assign empty content to CSS UISourceCode in case of protocol error (Closed)
Patch Set: fix test Created 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * @implements {Common.ContentProvider} 5 * @implements {Common.ContentProvider}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 SDK.CSSStyleSheetHeader = class { 8 SDK.CSSStyleSheetHeader = class {
9 /** 9 /**
10 * @param {!SDK.CSSModel} cssModel 10 * @param {!SDK.CSSModel} cssModel
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 */ 122 */
123 contentType() { 123 contentType() {
124 return Common.resourceTypes.Stylesheet; 124 return Common.resourceTypes.Stylesheet;
125 } 125 }
126 126
127 /** 127 /**
128 * @override 128 * @override
129 * @return {!Promise<?string>} 129 * @return {!Promise<?string>}
130 */ 130 */
131 requestContent() { 131 requestContent() {
132 return /** @type {!Promise<?string>} */ (this._cssModel.getStyleSheetText(th is.id)); 132 return this._cssModel.getStyleSheetText(this.id);
133 } 133 }
134 134
135 /** 135 /**
136 * @override 136 * @override
137 * @param {string} query 137 * @param {string} query
138 * @param {boolean} caseSensitive 138 * @param {boolean} caseSensitive
139 * @param {boolean} isRegex 139 * @param {boolean} isRegex
140 * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback 140 * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback
141 */ 141 */
142 searchInContent(query, caseSensitive, isRegex, callback) { 142 searchInContent(query, caseSensitive, isRegex, callback) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 */ 205 */
206 function performSearch(content) { 206 function performSearch(content) {
207 var searchResults = 207 var searchResults =
208 content ? Common.ContentProvider.performSearchInContent(content, query , caseSensitive, isRegex) : []; 208 content ? Common.ContentProvider.performSearchInContent(content, query , caseSensitive, isRegex) : [];
209 callback(searchResults); 209 callback(searchResults);
210 } 210 }
211 211
212 this.requestContent().then(performSearch); 212 this.requestContent().then(performSearch);
213 } 213 }
214 }; 214 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/CSSModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698