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

Side by Side Diff: Source/devtools/front_end/sdk/InspectorBackend.js

Issue 316813003: DevTools: make Id the first parameter of protocol message. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/CodeGeneratorInspectorStrings.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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();
OLDNEW
« no previous file with comments | « Source/core/inspector/CodeGeneratorInspectorStrings.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698