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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 /** | 401 /** |
402 * @param {string} domain | 402 * @param {string} domain |
403 * @param {string} method | 403 * @param {string} method |
404 * @param {?Object} params | 404 * @param {?Object} params |
405 * @param {?function(*)} callback | 405 * @param {?function(*)} callback |
406 * @private | 406 * @private |
407 */ | 407 */ |
408 _wrapCallbackAndSendMessageObject: function(domain, method, params, callback
) | 408 _wrapCallbackAndSendMessageObject: function(domain, method, params, callback
) |
409 { | 409 { |
410 var messageObject = {}; | 410 var messageObject = {}; |
| 411 |
| 412 var messageId = this.nextMessageId(); |
| 413 messageObject.id = messageId; |
| 414 |
411 messageObject.method = method; | 415 messageObject.method = method; |
412 if (params) | 416 if (params) |
413 messageObject.params = params; | 417 messageObject.params = params; |
414 | 418 |
415 var wrappedCallback = this._wrap(callback, domain, method); | 419 var wrappedCallback = this._wrap(callback, domain, method); |
416 | 420 |
417 var messageId = this.nextMessageId(); | |
418 messageObject.id = messageId; | |
419 | |
420 if (InspectorBackendClass.Options.dumpInspectorProtocolMessages) | 421 if (InspectorBackendClass.Options.dumpInspectorProtocolMessages) |
421 this._dumpProtocolMessage("frontend: " + JSON.stringify(messageObjec
t)); | 422 this._dumpProtocolMessage("frontend: " + JSON.stringify(messageObjec
t)); |
422 | 423 |
423 this.sendMessage(messageObject); | 424 this.sendMessage(messageObject); |
424 ++this._pendingResponsesCount; | 425 ++this._pendingResponsesCount; |
425 this._callbacks[messageId] = wrappedCallback; | 426 this._callbacks[messageId] = wrappedCallback; |
426 }, | 427 }, |
427 | 428 |
428 /** | 429 /** |
429 * @param {?function(*)} callback | 430 * @param {?function(*)} callback |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 } | 868 } |
868 | 869 |
869 } | 870 } |
870 | 871 |
871 InspectorBackendClass.Options = { | 872 InspectorBackendClass.Options = { |
872 dumpInspectorTimeStats: false, | 873 dumpInspectorTimeStats: false, |
873 dumpInspectorProtocolMessages: false | 874 dumpInspectorProtocolMessages: false |
874 } | 875 } |
875 | 876 |
876 InspectorBackend = new InspectorBackendClass(); | 877 InspectorBackend = new InspectorBackendClass(); |
OLD | NEW |