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

Side by Side Diff: webkit/glue/devtools/js/inject_dispatch.js

Issue 113836: DevTools: introduce bound object on the agent side. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « webkit/glue/devtools/js/dom_agent.js ('k') | webkit/glue/devtools/js/net_agent.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Injects 'injected' object into the inspectable page. 6 * @fileoverview Injects 'injected' object into the inspectable page.
7 */ 7 */
8 8
9 /** 9 /**
10 * Dispatches host calls into the injected function calls. 10 * Dispatches host calls into the injected function calls.
(...skipping 13 matching lines...) Expand all
24 * @param {Node} node Node context of the call. 24 * @param {Node} node Node context of the call.
25 * @param {string} json_args JSON-serialized call parameters. 25 * @param {string} json_args JSON-serialized call parameters.
26 * @return {string} JSON-serialized result of the dispatched call. 26 * @return {string} JSON-serialized result of the dispatched call.
27 */ 27 */
28 function devtools$$dispatch(functionName, node, json_args) { 28 function devtools$$dispatch(functionName, node, json_args) {
29 var params = JSON.parse(json_args); 29 var params = JSON.parse(json_args);
30 params.splice(0, 0, node); 30 params.splice(0, 0, node);
31 var result = devtools$$obj[functionName].apply(devtools$$obj, params); 31 var result = devtools$$obj[functionName].apply(devtools$$obj, params);
32 return JSON.stringify(result); 32 return JSON.stringify(result);
33 }; 33 };
34
35
36 /**
37 * This is called by the InspectorFrontend for serialization.
38 * We serialize the call and send it to the client over the IPC
39 * using dispatchOut bound method.
40 */
41 var dispatch = function(method, var_args) {
42 // Handle all messages with non-primitieve arguments here.
43 // TODO(pfeldman): Add more.
44 if (method == 'inspectedWindowCleared') {
45 return;
46 }
47 var call = JSON.stringify(Array.prototype.slice.call(arguments));
48 RemoteWebInspector.dispatch(call);
49 };
OLDNEW
« no previous file with comments | « webkit/glue/devtools/js/dom_agent.js ('k') | webkit/glue/devtools/js/net_agent.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698