| 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 var InspectorControllerDispatcher = {}; | 10 var InspectorControllerDispatcher = {}; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 if (method == 'inspectedWindowCleared' || | 55 if (method == 'inspectedWindowCleared' || |
| 56 method == 'reset' || | 56 method == 'reset' || |
| 57 method == 'setAttachedWindow') { | 57 method == 'setAttachedWindow') { |
| 58 // Filter out messages we don't need here. | 58 // Filter out messages we don't need here. |
| 59 // We do it on the sender side since they may have non-serializable | 59 // We do it on the sender side since they may have non-serializable |
| 60 // parameters. | 60 // parameters. |
| 61 return; | 61 return; |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Sniff some inspector controller state changes in order to support |
| 65 // cross-navigation instrumentation. Keep names in sync with |
| 66 // webdevtoolsagent_impl. |
| 67 if (method == 'timelineProfilerWasStarted') |
| 68 DevToolsAgentHost.runtimeFeatureStateChanged('timeline-profiler', true); |
| 69 else if (method == 'timelineProfilerWasStopped') |
| 70 DevToolsAgentHost.runtimeFeatureStateChanged('timeline-profiler', false); |
| 71 else if (method == 'resourceTrackingWasEnabled') |
| 72 DevToolsAgentHost.runtimeFeatureStateChanged('resource-tracking', true); |
| 73 else if (method == 'resourceTrackingWasDisabled') |
| 74 DevToolsAgentHost.runtimeFeatureStateChanged('resource-tracking', false); |
| 75 |
| 64 if (ApuAgentDispatcher.enabled) { | 76 if (ApuAgentDispatcher.enabled) { |
| 65 ApuAgentDispatcher.dispatchToApu(method, args); | 77 ApuAgentDispatcher.dispatchToApu(method, args); |
| 66 return; | 78 return; |
| 67 } | 79 } |
| 68 | 80 |
| 69 var call = JSON.stringify(args); | 81 var call = JSON.stringify(args); |
| 70 DevToolsAgentHost.dispatch(call); | 82 DevToolsAgentHost.dispatch(call); |
| 71 }; | 83 }; |
| 72 | 84 |
| 73 | 85 |
| 74 // Plugging into upstreamed support. | 86 // Plugging into upstreamed support. |
| 75 InjectedScript._window = function() { | 87 InjectedScript._window = function() { |
| 76 return contentWindow; | 88 return contentWindow; |
| 77 }; | 89 }; |
| 78 | 90 |
| 79 | 91 |
| 80 // Plugging into upstreamed support. | 92 // Plugging into upstreamed support. |
| 81 Object.className = function(obj) { | 93 Object.className = function(obj) { |
| 82 return (obj == null) ? "null" : obj.constructor.name; | 94 return (obj == null) ? "null" : obj.constructor.name; |
| 83 }; | 95 }; |
| 84 | 96 |
| 85 | 97 |
| 86 /** | 98 /** |
| 87 * A no-op function that is called by debugger agent just to trigger v8 | 99 * A no-op function that is called by debugger agent just to trigger v8 |
| 88 * execution. | 100 * execution. |
| 89 */ | 101 */ |
| 90 function devtools$$void() { | 102 function devtools$$void() { |
| 91 } | 103 } |
| OLD | NEW |