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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 * @override 546 * @override
547 * @return {!WebInspector.ResourceType} 547 * @return {!WebInspector.ResourceType}
548 */ 548 */
549 contentType: function() 549 contentType: function()
550 { 550 {
551 return WebInspector.resourceTypes.Script; 551 return WebInspector.resourceTypes.Script;
552 }, 552 },
553 553
554 /** 554 /**
555 * @override 555 * @override
556 * @param {function(?string)} callback 556 * @return {!Promise<?string>}
557 */ 557 */
558 requestContent: function(callback) 558 requestContent: function()
559 { 559 {
560 callback(this._snippet.content); 560 return Promise.resolve(/** @type {?string} */(this._snippet.content));
561 }, 561 },
562 562
563 /** 563 /**
564 * @override 564 * @override
565 * @param {string} query 565 * @param {string} query
566 * @param {boolean} caseSensitive 566 * @param {boolean} caseSensitive
567 * @param {boolean} isRegex 567 * @param {boolean} isRegex
568 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal lback 568 * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} cal lback
569 */ 569 */
570 searchInContent: function(query, caseSensitive, isRegex, callback) 570 searchInContent: function(query, caseSensitive, isRegex, callback)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 this._model.deleteScriptSnippet(url); 667 this._model.deleteScriptSnippet(url);
668 }, 668 },
669 669
670 __proto__: WebInspector.ContentProviderBasedProject.prototype 670 __proto__: WebInspector.ContentProviderBasedProject.prototype
671 } 671 }
672 672
673 /** 673 /**
674 * @type {!WebInspector.ScriptSnippetModel} 674 * @type {!WebInspector.ScriptSnippetModel}
675 */ 675 */
676 WebInspector.scriptSnippetModel = new WebInspector.ScriptSnippetModel(WebInspect or.workspace); 676 WebInspector.scriptSnippetModel = new WebInspector.ScriptSnippetModel(WebInspect or.workspace);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698