| OLD | NEW |
| 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 29 matching lines...) Expand all Loading... |
| 40 // Handle all messages with non-primitieve arguments here. | 40 // Handle all messages with non-primitieve arguments here. |
| 41 var args = Array.prototype.slice.call(arguments); | 41 var args = Array.prototype.slice.call(arguments); |
| 42 | 42 |
| 43 // Serialize objects here. | 43 // Serialize objects here. |
| 44 if (method == 'addMessageToConsole') { | 44 if (method == 'addMessageToConsole') { |
| 45 // Skip first argument since it is serializable. | 45 // Skip first argument since it is serializable. |
| 46 // Method has index 0, first argument has index 1. Skip both. | 46 // Method has index 0, first argument has index 1. Skip both. |
| 47 for (var i = 2; i < args.length; ++i) { | 47 for (var i = 2; i < args.length; ++i) { |
| 48 args[i] = devtools$$obj.wrapConsoleObject(args[i]); | 48 args[i] = devtools$$obj.wrapConsoleObject(args[i]); |
| 49 } | 49 } |
| 50 } else if (method == 'inspectedWindowCleared' || |
| 51 method == 'reset' || |
| 52 method == 'setAttachedWindow') { |
| 53 // Filter out messages we don't need here. |
| 54 // We do it on the sender side since they may have non-serializable |
| 55 // parameters. |
| 56 return; |
| 50 } | 57 } |
| 51 var call = JSON.stringify(args); | 58 var call = JSON.stringify(args); |
| 52 DevToolsAgentHost.dispatch(call); | 59 DevToolsAgentHost.dispatch(call); |
| 53 }; | 60 }; |
| OLD | NEW |