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

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

Issue 2695123004: DevTools: Only provide static script content to UISourceCode (Closed)
Patch Set: another try 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
index 591c0678e22bd530badd4cd136255aa45a7be956..b17c16218164db28e7d2ad98882b98dd3c9fe441 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js
@@ -33,8 +33,8 @@ SDK.CSSStyleSheetHeader = class {
originalContentProvider() {
if (!this._originalContentProvider) {
var lazyContent = this._cssModel.originalStyleSheetText.bind(this._cssModel, this);
- this._originalContentProvider =
- new Common.StaticContentProvider(this.contentURL(), this.contentType(), lazyContent);
+ this._originalContentProvider = new Common.StaticContentProvider(
+ this.contentURL(), this.contentType(), /** @type {function():!Promise<?string>} */ (lazyContent));
}
return this._originalContentProvider;
}
@@ -155,60 +155,3 @@ SDK.CSSStyleSheetHeader = class {
return this.origin === 'inspector';
}
};
-
-/**
- * @implements {Common.ContentProvider}
- * @unrestricted
- */
-SDK.CSSStyleSheetHeader.OriginalContentProvider = class {
- /**
- * @param {!SDK.CSSStyleSheetHeader} header
- */
- constructor(header) {
- this._header = header;
- }
-
- /**
- * @override
- * @return {string}
- */
- contentURL() {
- return this._header.contentURL();
- }
-
- /**
- * @override
- * @return {!Common.ResourceType}
- */
- contentType() {
- return this._header.contentType();
- }
-
- /**
- * @override
- * @return {!Promise<?string>}
- */
- requestContent() {
- return /** @type {!Promise<?string>} */ (this._header.cssModel().originalStyleSheetText(this._header));
- }
-
- /**
- * @override
- * @param {string} query
- * @param {boolean} caseSensitive
- * @param {boolean} isRegex
- * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback
- */
- searchInContent(query, caseSensitive, isRegex, callback) {
- /**
- * @param {?string} content
- */
- function performSearch(content) {
- var searchResults =
- content ? Common.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex) : [];
- callback(searchResults);
- }
-
- this.requestContent().then(performSearch);
- }
-};

Powered by Google App Engine
This is Rietveld 408576698