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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js

Issue 2850333002: DevTools: Promisify Profiler and HeapProfiler domains (Closed)
Patch Set: addressing comments Created 3 years, 7 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 for (var paramName of this._replyArgs[method] || []) 621 for (var paramName of this._replyArgs[method] || [])
622 argumentsArray.push(result[paramName]); 622 argumentsArray.push(result[paramName]);
623 } 623 }
624 resolve(argumentsArray); 624 resolve(argumentsArray);
625 } 625 }
626 this._target._wrapCallbackAndSendMessageObject(this._domain, method, param s, prepareArgsAndResolve.bind(this)); 626 this._target._wrapCallbackAndSendMessageObject(this._domain, method, param s, prepareArgsAndResolve.bind(this));
627 } 627 }
628 628
629 /** 629 /**
630 * @param {!Array<*>} args 630 * @param {!Array<*>} args
631 * @return {?}
631 */ 632 */
632 function runUserCallback(args) { 633 function runUserCallback(args) {
633 return userCallback ? userCallback.apply(null, args) : undefined; 634 return userCallback ? userCallback.apply(null, args) : !args[0] && args[1] || null;
634 } 635 }
635 } 636 }
636 637
637 /** 638 /**
638 * @param {string} method 639 * @param {string} method
639 * @param {?Object} request 640 * @param {?Object} request
640 * @return {!Promise<!Object>} 641 * @return {!Promise<!Object>}
641 */ 642 */
642 _invoke(method, request) { 643 _invoke(method, request) {
643 return new Promise(fulfill => { 644 return new Promise(fulfill => {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 if (Protocol.InspectorBackend.Options.dumpInspectorTimeStats) 730 if (Protocol.InspectorBackend.Options.dumpInspectorTimeStats)
730 console.timeEnd(timingLabel); 731 console.timeEnd(timingLabel);
731 } 732 }
732 }; 733 };
733 734
734 Protocol.InspectorBackend.Options = { 735 Protocol.InspectorBackend.Options = {
735 dumpInspectorTimeStats: false, 736 dumpInspectorTimeStats: false,
736 dumpInspectorProtocolMessages: false, 737 dumpInspectorProtocolMessages: false,
737 suppressRequestErrors: false 738 suppressRequestErrors: false
738 }; 739 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698