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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 | 311 |
312 /** | 312 /** |
313 * @param {!Object} messageObject | 313 * @param {!Object} messageObject |
314 */ | 314 */ |
315 sendMessage: function(messageObject) | 315 sendMessage: function(messageObject) |
316 { | 316 { |
317 throw "Not implemented"; | 317 throw "Not implemented"; |
318 }, | 318 }, |
319 | 319 |
320 /** | 320 /** |
321 * @param {string} method | |
322 * @param {?Object} params | |
323 * @param {?function(*)} callback | |
324 */ | |
325 sendRawMessageForTesting: function(method, params, cb) | |
dgozman
2016/07/14 01:02:18
cb -> callback
| |
326 { | |
327 var domain = method.split(".")[0]; | |
328 this._wrapCallbackAndSendMessageObject(domain, method, params, cb); | |
329 }, | |
330 | |
331 /** | |
321 * @param {!Object|string} message | 332 * @param {!Object|string} message |
322 */ | 333 */ |
323 dispatch: function(message) | 334 dispatch: function(message) |
324 { | 335 { |
325 if (InspectorBackendClass.Options.dumpInspectorProtocolMessages) | 336 if (InspectorBackendClass.Options.dumpInspectorProtocolMessages) |
326 this._dumpProtocolMessage("backend: " + ((typeof message === "string ") ? message : JSON.stringify(message))); | 337 this._dumpProtocolMessage("backend: " + ((typeof message === "string ") ? message : JSON.stringify(message))); |
327 | 338 |
328 var messageObject = /** @type {!Object} */ ((typeof message === "string" ) ? JSON.parse(message) : message); | 339 var messageObject = /** @type {!Object} */ ((typeof message === "string" ) ? JSON.parse(message) : message); |
329 | 340 |
330 if ("id" in messageObject) { // just a response for some request | 341 if ("id" in messageObject) { // just a response for some request |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
722 } | 733 } |
723 } | 734 } |
724 | 735 |
725 InspectorBackendClass.Options = { | 736 InspectorBackendClass.Options = { |
726 dumpInspectorTimeStats: false, | 737 dumpInspectorTimeStats: false, |
727 dumpInspectorProtocolMessages: false, | 738 dumpInspectorProtocolMessages: false, |
728 suppressRequestErrors: false | 739 suppressRequestErrors: false |
729 } | 740 } |
730 | 741 |
731 InspectorBackend = new InspectorBackendClass(); | 742 InspectorBackend = new InspectorBackendClass(); |
OLD | NEW |