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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 }, 415 },
416 416
417 /** 417 /**
418 * @return {boolean} 418 * @return {boolean}
419 */ 419 */
420 isMergingToVM: function() 420 isMergingToVM: function()
421 { 421 {
422 return this._isMergingToVM; 422 return this._isMergingToVM;
423 }, 423 },
424 424
425 /**
426 * @return {!Promise}
427 */
425 checkMapping: function() 428 checkMapping: function()
426 { 429 {
427 if (!this._script) 430 if (!this._script)
428 return; 431 return Promise.resolve();
429 if (typeof this._scriptSource !== "undefined") 432 if (typeof this._scriptSource !== "undefined")
430 return; 433 return Promise.resolve();
431 this._script.requestContent(callback.bind(this)); 434 return this._script.requestContent().then(callback.bind(this));
432 435
433 /** 436 /**
434 * @param {?string} source 437 * @param {?string} source
435 * @this {WebInspector.ResourceScriptFile} 438 * @this {WebInspector.ResourceScriptFile}
436 */ 439 */
437 function callback(source) 440 function callback(source)
438 { 441 {
439 this._scriptSource = source; 442 this._scriptSource = source;
440 this._update(); 443 this._update();
441 } 444 }
(...skipping 28 matching lines...) Expand all
470 /** 473 /**
471 * @return {boolean} 474 * @return {boolean}
472 */ 475 */
473 hasSourceMapURL: function() 476 hasSourceMapURL: function()
474 { 477 {
475 return this._script && !!this._script.sourceMapURL; 478 return this._script && !!this._script.sourceMapURL;
476 }, 479 },
477 480
478 __proto__: WebInspector.Object.prototype 481 __proto__: WebInspector.Object.prototype
479 } 482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698