Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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[1] || null; |
|
dgozman
2017/05/02 20:03:41
Everyone was checking for error, not for null/unde
alph
2017/05/02 22:48:06
Done.
| |
| 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 Loading... | |
| 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 }; |
| OLD | NEW |