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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 _invoke(method, args, callback) { | 627 _invoke(method, args, callback) { |
| 628 this._target._wrapCallbackAndSendMessageObject(this._domain, method, args, c allback); | 628 this._target._wrapCallbackAndSendMessageObject(this._domain, method, args, c allback); |
| 629 } | 629 } |
| 630 | 630 |
| 631 /** | 631 /** |
| 632 * @param {!Object} messageObject | 632 * @param {!Object} messageObject |
| 633 * @param {string} methodName | 633 * @param {string} methodName |
| 634 * @param {function(*)|function(?Protocol.Error, ?Object)} callback | 634 * @param {function(*)|function(?Protocol.Error, ?Object)} callback |
| 635 */ | 635 */ |
| 636 dispatchResponse(messageObject, methodName, callback) { | 636 dispatchResponse(messageObject, methodName, callback) { |
| 637 if (messageObject.error && messageObject.error.code !== Protocol.InspectorBa ckend._ConnectionClosedErrorCode && | |
|
chenwilliam
2017/01/19 23:08:00
I removed this after discussing with @pfeldman bec
dgozman
2017/01/20 17:52:09
Let's land this separately:
- I'm worried we will
chenwilliam
2017/01/20 20:19:21
OK, removing from CL. What kind of cleanup on erro
| |
| 638 messageObject.error.code !== Protocol.InspectorBackend.DevToolsStubError Code && | |
| 639 !Protocol.InspectorBackend.Options.suppressRequestErrors) { | |
| 640 var id = Protocol.InspectorBackend.Options.dumpInspectorProtocolMessages ? ' with id = ' + messageObject.id : ''; | |
| 641 console.error('Request ' + methodName + id + ' failed. ' + JSON.stringify( messageObject.error)); | |
| 642 } | |
| 643 | |
| 644 var argumentsArray = []; | 637 var argumentsArray = []; |
| 645 argumentsArray[0] = messageObject.error ? messageObject.error.message : null ; | 638 argumentsArray[0] = messageObject.error ? messageObject.error.message : null ; |
| 646 | 639 |
| 647 if (this._hasErrorData[methodName]) | 640 if (this._hasErrorData[methodName]) |
| 648 argumentsArray[1] = messageObject.error ? messageObject.error.data : null; | 641 argumentsArray[1] = messageObject.error ? messageObject.error.data : null; |
| 649 | 642 |
| 650 if (messageObject.result) { | 643 if (messageObject.result) { |
| 651 var paramNames = this._replyArgs[methodName] || []; | 644 var paramNames = this._replyArgs[methodName] || []; |
| 652 for (var i = 0; i < paramNames.length; ++i) | 645 for (var i = 0; i < paramNames.length; ++i) |
| 653 argumentsArray.push(messageObject.result[paramNames[i]]); | 646 argumentsArray.push(messageObject.result[paramNames[i]]); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 if (Protocol.InspectorBackend.Options.dumpInspectorTimeStats) | 712 if (Protocol.InspectorBackend.Options.dumpInspectorTimeStats) |
| 720 console.timeEnd(timingLabel); | 713 console.timeEnd(timingLabel); |
| 721 } | 714 } |
| 722 }; | 715 }; |
| 723 | 716 |
| 724 Protocol.InspectorBackend.Options = { | 717 Protocol.InspectorBackend.Options = { |
| 725 dumpInspectorTimeStats: false, | 718 dumpInspectorTimeStats: false, |
| 726 dumpInspectorProtocolMessages: false, | 719 dumpInspectorProtocolMessages: false, |
| 727 suppressRequestErrors: false | 720 suppressRequestErrors: false |
| 728 }; | 721 }; |
| OLD | NEW |