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

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

Issue 115862: DevTools: pass class and method name as arguments to RPC messages (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « webkit/glue/devtools/devtools_rpc_unittest.cc ('k') | webkit/glue/webdevtoolsagent.h » ('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 Tools is a main class that wires all components of the 6 * @fileoverview Tools is a main class that wires all components of the
7 * DevTools frontend together. It is also responsible for overriding existing 7 * DevTools frontend together. It is also responsible for overriding existing
8 * WebInspector functionality while it is getting upstreamed into WebCore. 8 * WebInspector functionality while it is getting upstreamed into WebCore.
9 */ 9 */
10 goog.provide('devtools.Tools'); 10 goog.provide('devtools.Tools');
11 11
12 goog.require('devtools.DebuggerAgent'); 12 goog.require('devtools.DebuggerAgent');
13 goog.require('devtools.DomAgent'); 13 goog.require('devtools.DomAgent');
14 14
15 15
16 /** 16 /**
17 * Dispatches raw message from the host. 17 * Dispatches raw message from the host.
18 * @param {string} remoteName
19 * @prama {string} methodName
18 * @param {Object} msg Message to dispatch. 20 * @param {Object} msg Message to dispatch.
19 */ 21 */
20 devtools.dispatch = function(msg) { 22 devtools.dispatch = function(remoteName, methodName, msg) {
21 var delegate = msg[0]; 23 remoteName = 'Remote' + remoteName.substring(0, remoteName.length - 8);
22 var methodName = msg[1];
23 var remoteName = 'Remote' + delegate.substring(0, delegate.length - 8);
24 var agent = window[remoteName]; 24 var agent = window[remoteName];
25 if (!agent) { 25 if (!agent) {
26 debugPrint('No remote agent "' + remoteName + '" found.'); 26 debugPrint('No remote agent "' + remoteName + '" found.');
27 return; 27 return;
28 } 28 }
29 var method = agent[methodName]; 29 var method = agent[methodName];
30 if (!method) { 30 if (!method) {
31 debugPrint('No method "' + remoteName + '.' + methodName + '" found.'); 31 debugPrint('No method "' + remoteName + '.' + methodName + '" found.');
32 return; 32 return;
33 } 33 }
34 method.apply(this, msg.slice(2)); 34 method.apply(this, msg);
35 }; 35 };
36 36
37 37
38 devtools.ToolsAgent = function() { 38 devtools.ToolsAgent = function() {
39 RemoteToolsAgent.DidEvaluateJavaScript = devtools.Callback.processCallback; 39 RemoteToolsAgent.DidEvaluateJavaScript = devtools.Callback.processCallback;
40 RemoteToolsAgent.DidExecuteUtilityFunction = 40 RemoteToolsAgent.DidExecuteUtilityFunction =
41 devtools.Callback.processCallback; 41 devtools.Callback.processCallback;
42 RemoteToolsAgent.UpdateFocusedNode = 42 RemoteToolsAgent.UpdateFocusedNode =
43 goog.bind(this.updateFocusedNode_, this); 43 goog.bind(this.updateFocusedNode_, this);
44 RemoteToolsAgent.FrameNavigate = 44 RemoteToolsAgent.FrameNavigate =
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 (function OverrideUpdateResource() { 935 (function OverrideUpdateResource() {
936 var originalUpdateResource = WebInspector.updateResource; 936 var originalUpdateResource = WebInspector.updateResource;
937 WebInspector.updateResource = function(identifier, payload) { 937 WebInspector.updateResource = function(identifier, payload) {
938 originalUpdateResource.call(this, identifier, payload); 938 originalUpdateResource.call(this, identifier, payload);
939 var resource = this.resources[identifier]; 939 var resource = this.resources[identifier];
940 if (resource && resource.mainResource && resource.finished) { 940 if (resource && resource.mainResource && resource.finished) {
941 document.title = 'Developer Tools - ' + resource.url; 941 document.title = 'Developer Tools - ' + resource.url;
942 } 942 }
943 }; 943 };
944 })(); 944 })();
OLDNEW
« no previous file with comments | « webkit/glue/devtools/devtools_rpc_unittest.cc ('k') | webkit/glue/webdevtoolsagent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698