Index: third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js b/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js |
index 6f2f8ddd1ac4def893e4818dfb11dae1642b0e46..5288f26d204772d75556c3912029df3707d135fb 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ContentProviders.js |
@@ -27,89 +27,85 @@ |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
- |
/** |
- * @constructor |
* @implements {WebInspector.ContentProvider} |
- * @param {string} sourceURL |
- * @param {!WebInspector.ResourceType} contentType |
+ * @unrestricted |
*/ |
-WebInspector.CompilerSourceMappingContentProvider = function(sourceURL, contentType) |
-{ |
+WebInspector.CompilerSourceMappingContentProvider = class { |
+ /** |
+ * @param {string} sourceURL |
+ * @param {!WebInspector.ResourceType} contentType |
+ */ |
+ constructor(sourceURL, contentType) { |
this._sourceURL = sourceURL; |
this._contentType = contentType; |
-}; |
+ } |
-WebInspector.CompilerSourceMappingContentProvider.prototype = { |
- /** |
- * @override |
- * @return {string} |
- */ |
- contentURL: function() |
- { |
- return this._sourceURL; |
- }, |
+ /** |
+ * @override |
+ * @return {string} |
+ */ |
+ contentURL() { |
+ return this._sourceURL; |
+ } |
- /** |
- * @override |
- * @return {!WebInspector.ResourceType} |
- */ |
- contentType: function() |
- { |
- return this._contentType; |
- }, |
+ /** |
+ * @override |
+ * @return {!WebInspector.ResourceType} |
+ */ |
+ contentType() { |
+ return this._contentType; |
+ } |
+ |
+ /** |
+ * @override |
+ * @return {!Promise<?string>} |
+ */ |
+ requestContent() { |
+ var callback; |
+ var promise = new Promise(fulfill => callback = fulfill); |
+ WebInspector.multitargetNetworkManager.loadResource(this._sourceURL, contentLoaded.bind(this)); |
+ return promise; |
/** |
- * @override |
- * @return {!Promise<?string>} |
+ * @param {number} statusCode |
+ * @param {!Object.<string, string>} headers |
+ * @param {string} content |
+ * @this {WebInspector.CompilerSourceMappingContentProvider} |
*/ |
- requestContent: function() |
- { |
- var callback; |
- var promise = new Promise(fulfill => callback = fulfill); |
- WebInspector.multitargetNetworkManager.loadResource(this._sourceURL, contentLoaded.bind(this)); |
- return promise; |
+ function contentLoaded(statusCode, headers, content) { |
+ if (statusCode >= 400) { |
+ console.error( |
+ 'Could not load content for ' + this._sourceURL + ' : ' + |
+ 'HTTP status code: ' + statusCode); |
+ callback(null); |
+ return; |
+ } |
- /** |
- * @param {number} statusCode |
- * @param {!Object.<string, string>} headers |
- * @param {string} content |
- * @this {WebInspector.CompilerSourceMappingContentProvider} |
- */ |
- function contentLoaded(statusCode, headers, content) |
- { |
- if (statusCode >= 400) { |
- console.error("Could not load content for " + this._sourceURL + " : " + "HTTP status code: " + statusCode); |
- callback(null); |
- return; |
- } |
+ callback(content); |
+ } |
+ } |
- callback(content); |
- } |
- }, |
+ /** |
+ * @override |
+ * @param {string} query |
+ * @param {boolean} caseSensitive |
+ * @param {boolean} isRegex |
+ * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback |
+ */ |
+ searchInContent(query, caseSensitive, isRegex, callback) { |
+ this.requestContent().then(contentLoaded); |
/** |
- * @override |
- * @param {string} query |
- * @param {boolean} caseSensitive |
- * @param {boolean} isRegex |
- * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback |
+ * @param {?string} content |
*/ |
- searchInContent: function(query, caseSensitive, isRegex, callback) |
- { |
- this.requestContent().then(contentLoaded); |
- |
- /** |
- * @param {?string} content |
- */ |
- function contentLoaded(content) |
- { |
- if (typeof content !== "string") { |
- callback([]); |
- return; |
- } |
+ function contentLoaded(content) { |
+ if (typeof content !== 'string') { |
+ callback([]); |
+ return; |
+ } |
- callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); |
- } |
+ callback(WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex)); |
} |
+ } |
}; |