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

Side by Side Diff: Source/core/inspector/InjectedScriptSource.js

Issue 16143005: monitor console command implemented. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing windows build. Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 } 1147 }
1148 1148
1149 // NOTE: Please keep the list of API methods below snchronized to that in WebIns pector.RuntimeModel! 1149 // NOTE: Please keep the list of API methods below snchronized to that in WebIns pector.RuntimeModel!
1150 /** 1150 /**
1151 * @type {Array.<string>} 1151 * @type {Array.<string>}
1152 * @const 1152 * @const
1153 */ 1153 */
1154 CommandLineAPI.members_ = [ 1154 CommandLineAPI.members_ = [
1155 "$", "$$", "$x", "dir", "dirxml", "keys", "values", "profile", "profileEnd", 1155 "$", "$$", "$x", "dir", "dirxml", "keys", "values", "profile", "profileEnd",
1156 "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear", "getEventLis teners", 1156 "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear", "getEventLis teners",
1157 "debug", "undebug", "table" 1157 "debug", "undebug", "monitor", "unmonitor", "table"
1158 ]; 1158 ];
1159 1159
1160 /** 1160 /**
1161 * @constructor 1161 * @constructor
1162 */ 1162 */
1163 function CommandLineAPIImpl() 1163 function CommandLineAPIImpl()
1164 { 1164 {
1165 } 1165 }
1166 1166
1167 CommandLineAPIImpl.prototype = { 1167 CommandLineAPIImpl.prototype = {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 /** 1306 /**
1307 * @param {Node} node 1307 * @param {Node} node
1308 */ 1308 */
1309 getEventListeners: function(node) 1309 getEventListeners: function(node)
1310 { 1310 {
1311 return InjectedScriptHost.getEventListeners(node); 1311 return InjectedScriptHost.getEventListeners(node);
1312 }, 1312 },
1313 1313
1314 debug: function(fn) 1314 debug: function(fn)
1315 { 1315 {
1316 InjectedScriptHost.setBreakpoint(fn); 1316 InjectedScriptHost.setDebugBreakpoint(fn);
1317 }, 1317 },
1318 1318
1319 undebug: function(fn) 1319 undebug: function(fn)
1320 { 1320 {
1321 InjectedScriptHost.removeBreakpoint(fn); 1321 InjectedScriptHost.removeDebugBreakpoint(fn);
1322 },
1323
1324 monitor: function(fn) {
1325 if (typeof fn != "function")
1326 return;
1327
1328 var details = InjectedScriptHost.functionDetails(fn);
vsevik 2013/06/10 15:06:01 Looking at this piece of code I think that you don
SeRya 2013/06/11 08:24:12 Now I use results of InjectedScriptHost.functionDe
1329 var name = details.name || details.inferredName || "(anonimous function) ";
1330 InjectedScriptHost.setMonitorBreakpoint(fn, "console.log('function " + n ame + " called' + (arguments.length > 0 ? ' with arguments: ' + Array.prototype. join.call(arguments, ', ') : '')) && false");
vsevik 2013/06/10 15:06:01 Please don't use single quotes in blink.
SeRya 2013/06/11 08:24:12 Replaced by \"
1331 },
1332
1333 unmonitor: function(fn) {
1334 InjectedScriptHost.removeMonitorBreakpoint(fn);
1322 }, 1335 },
1323 1336
1324 table: function() 1337 table: function()
1325 { 1338 {
1326 inspectedWindow.console.table.apply(inspectedWindow.console, arguments); 1339 inspectedWindow.console.table.apply(inspectedWindow.console, arguments);
1327 }, 1340 },
1328 1341
1329 /** 1342 /**
1330 * @param {number} num 1343 * @param {number} num
1331 */ 1344 */
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 */ 1379 */
1367 _logEvent: function(event) 1380 _logEvent: function(event)
1368 { 1381 {
1369 inspectedWindow.console.log(event.type, event); 1382 inspectedWindow.console.log(event.type, event);
1370 } 1383 }
1371 } 1384 }
1372 1385
1373 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1386 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1374 return injectedScript; 1387 return injectedScript;
1375 }) 1388 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698