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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 1916023002: [DevTools] Move last inspected objects to V8InspectorSessionImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-part-command-line-api-to-native
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 633 }
634 return "function " + name + "(" + funcArgsSyntax + ") { [Command Line API] }"; 634 return "function " + name + "(" + funcArgsSyntax + ") { [Command Line API] }";
635 }; 635 };
636 } 636 }
637 637
638 for (var i = 0; i < CommandLineAPIImpl.members_.length; ++i) { 638 for (var i = 0; i < CommandLineAPIImpl.members_.length; ++i) {
639 var member = CommandLineAPIImpl.members_[i]; 639 var member = CommandLineAPIImpl.members_[i];
640 nativeCommandLineAPI[member] = bind(commandLineAPIImpl[member], comm andLineAPIImpl); 640 nativeCommandLineAPI[member] = bind(commandLineAPIImpl[member], comm andLineAPIImpl);
641 nativeCommandLineAPI[member].toString = customToStringMethod(member) ; 641 nativeCommandLineAPI[member].toString = customToStringMethod(member) ;
642 } 642 }
643
644 for (var i = 0; i < 5; ++i) {
645 var member = "$" + i;
646 nativeCommandLineAPI[member] = bind(commandLineAPIImpl._inspectedObj ect, commandLineAPIImpl, i);
647 }
648 return nativeCommandLineAPI; 643 return nativeCommandLineAPI;
649 }, 644 },
650 645
651 /** 646 /**
652 * @param {string} objectGroup 647 * @param {string} objectGroup
653 * @return {!Object} 648 * @return {!Object}
654 */ 649 */
655 remoteObjectAPI: function(objectGroup) 650 remoteObjectAPI: function(objectGroup)
656 { 651 {
657 /** 652 /**
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 var listeners = result[type]; 1339 var listeners = result[type];
1345 for (var i = 0, listener; listener = listeners[i]; ++i) { 1340 for (var i = 0, listener; listener = listeners[i]; ++i) {
1346 listener["type"] = type; 1341 listener["type"] = type;
1347 listener["remove"] = removeFunc; 1342 listener["remove"] = removeFunc;
1348 } 1343 }
1349 } 1344 }
1350 return result; 1345 return result;
1351 }, 1346 },
1352 1347
1353 /** 1348 /**
1354 * @param {number} num
1355 */
1356 _inspectedObject: function(num)
1357 {
1358 return InjectedScriptHost.inspectedObject(num);
1359 },
1360
1361 /**
1362 * @param {!Array.<string>|string=} types 1349 * @param {!Array.<string>|string=} types
1363 * @return {!Array.<string>} 1350 * @return {!Array.<string>}
1364 */ 1351 */
1365 _normalizeEventTypes: function(types) 1352 _normalizeEventTypes: function(types)
1366 { 1353 {
1367 if (typeof types === "undefined") 1354 if (typeof types === "undefined")
1368 types = ["mouse", "key", "touch", "pointer", "control", "load", "unl oad", "abort", "error", "select", "input", "change", "submit", "reset", "focus", "blur", "resize", "scroll", "search", "devicemotion", "deviceorientation"]; 1355 types = ["mouse", "key", "touch", "pointer", "control", "load", "unl oad", "abort", "error", "select", "input", "change", "submit", "reset", "focus", "blur", "resize", "scroll", "search", "devicemotion", "deviceorientation"];
1369 else if (typeof types === "string") 1356 else if (typeof types === "string")
1370 types = [types]; 1357 types = [types];
1371 1358
(...skipping 20 matching lines...) Expand all
1392 */ 1379 */
1393 _logEvent: function(event) 1380 _logEvent: function(event)
1394 { 1381 {
1395 inspectedGlobalObject.console.log(event.type, event); 1382 inspectedGlobalObject.console.log(event.type, event);
1396 } 1383 }
1397 } 1384 }
1398 1385
1399 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1386 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1400 return injectedScript; 1387 return injectedScript;
1401 }) 1388 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698