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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/common/StaticContentProvider.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.ResourceType} contentType 8 * @param {!WebInspector.ResourceType} contentType
9 * @param {string} content 9 * @param {string} content
10 * @param {string=} contentURL 10 * @param {string=} contentURL
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 * @override 48 * @override
49 * @return {!WebInspector.ResourceType} 49 * @return {!WebInspector.ResourceType}
50 */ 50 */
51 contentType: function() 51 contentType: function()
52 { 52 {
53 return this._contentType; 53 return this._contentType;
54 }, 54 },
55 55
56 /** 56 /**
57 * @override 57 * @override
58 * @param {function(?string)} callback 58 * @return {!Promise<?string>}
59 */ 59 */
60 requestContent: function(callback) 60 requestContent: function()
61 { 61 {
62 callback(this._content); 62 return Promise.resolve(/** @type {?string} */(this._content));
63 }, 63 },
64 64
65 /** 65 /**
66 * @override 66 * @override
67 * @param {string} query 67 * @param {string} query
68 * @param {boolean} caseSensitive 68 * @param {boolean} caseSensitive
69 * @param {boolean} isRegex 69 * @param {boolean} isRegex
70 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal lback 70 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal lback
71 */ 71 */
72 searchInContent: function(query, caseSensitive, isRegex, callback) 72 searchInContent: function(query, caseSensitive, isRegex, callback)
73 { 73 {
74 WebInspector.StaticContentProvider.searchInContent(this._content, query, caseSensitive, isRegex, callback); 74 WebInspector.StaticContentProvider.searchInContent(this._content, query, caseSensitive, isRegex, callback);
75 } 75 }
76 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698