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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/StylesSourceMapping.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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 var header = this._cssModel.styleSheetHeaderForId(styleSheetId); 304 var header = this._cssModel.styleSheetHeaderForId(styleSheetId);
305 if (!header) 305 if (!header)
306 return; 306 return;
307 var styleSheetURL = header.resourceURL(); 307 var styleSheetURL = header.resourceURL();
308 if (!styleSheetURL) 308 if (!styleSheetURL)
309 return; 309 return;
310 var uiSourceCode = this._networkMapping.uiSourceCodeForStyleURL(styleShe etURL, header); 310 var uiSourceCode = this._networkMapping.uiSourceCodeForStyleURL(styleShe etURL, header);
311 if (!uiSourceCode) 311 if (!uiSourceCode)
312 return; 312 return;
313 header.requestContent(callback.bind(this, uiSourceCode)); 313 header.requestContent().then(callback.bind(this, uiSourceCode));
314 314
315 /** 315 /**
316 * @param {!WebInspector.UISourceCode} uiSourceCode 316 * @param {!WebInspector.UISourceCode} uiSourceCode
317 * @param {?string} content 317 * @param {?string} content
318 * @this {WebInspector.StylesSourceMapping} 318 * @this {WebInspector.StylesSourceMapping}
319 */ 319 */
320 function callback(uiSourceCode, content) 320 function callback(uiSourceCode, content)
321 { 321 {
322 var styleFile = this._styleFiles.get(uiSourceCode); 322 var styleFile = this._styleFiles.get(uiSourceCode);
323 if (styleFile) 323 if (styleFile)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 this._uiSourceCode.addRevision(content); 393 this._uiSourceCode.addRevision(content);
394 delete this._isAddingRevision; 394 delete this._isAddingRevision;
395 }, 395 },
396 396
397 dispose: function() 397 dispose: function()
398 { 398 {
399 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this); 399 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this);
400 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); 400 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this);
401 } 401 }
402 } 402 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698