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

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

Issue 1818473002: [DevTools] Move getInternalProperties to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-call-function-on
Patch Set: Created 4 years, 9 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 if (!("enumerable" in descriptor)) 443 if (!("enumerable" in descriptor))
444 descriptor.enumerable = false; 444 descriptor.enumerable = false;
445 if ("symbol" in descriptor) 445 if ("symbol" in descriptor)
446 descriptor.symbol = this._wrapObject(descriptor.symbol, objectGr oupName); 446 descriptor.symbol = this._wrapObject(descriptor.symbol, objectGr oupName);
447 push(descriptors, descriptor); 447 push(descriptors, descriptor);
448 } 448 }
449 return descriptors; 449 return descriptors;
450 }, 450 },
451 451
452 /** 452 /**
453 * @param {string} objectId
454 * @return {!Array.<!Object>|boolean}
455 */
456 getInternalProperties: function(objectId)
457 {
458 var parsedObjectId = this._parseObjectId(objectId);
459 var object = this._objectForId(parsedObjectId);
460 var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjec tId.id);
461 if (!this._isDefined(object) || isSymbol(object))
462 return false;
463 object = /** @type {!Object} */ (object);
464 var descriptors = [];
465 var internalProperties = InjectedScriptHost.getInternalProperties(object );
466 if (internalProperties) {
467 for (var i = 0; i < internalProperties.length; i += 2) {
468 var descriptor = {
469 name: internalProperties[i],
470 value: this._wrapObject(internalProperties[i + 1], objectGro upName),
471 __proto__: null
472 };
473 push(descriptors, descriptor);
474 }
475 }
476 return descriptors;
477 },
478
479 /**
480 * @param {string} functionId 453 * @param {string} functionId
481 * @return {!DebuggerAgent.FunctionDetails|string} 454 * @return {!DebuggerAgent.FunctionDetails|string}
482 */ 455 */
483 getFunctionDetails: function(functionId) 456 getFunctionDetails: function(functionId)
484 { 457 {
485 var parsedFunctionId = this._parseObjectId(functionId); 458 var parsedFunctionId = this._parseObjectId(functionId);
486 var func = this._objectForId(parsedFunctionId); 459 var func = this._objectForId(parsedFunctionId);
487 if (typeof func !== "function") 460 if (typeof func !== "function")
488 return "Cannot resolve function by id."; 461 return "Cannot resolve function by id.";
489 var details = nullifyObjectProto(/** @type {!DebuggerAgent.FunctionDetai ls} */ (InjectedScriptHost.functionDetails(func))); 462 var details = nullifyObjectProto(/** @type {!DebuggerAgent.FunctionDetai ls} */ (InjectedScriptHost.functionDetails(func)));
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 */ 1612 */
1640 _logEvent: function(event) 1613 _logEvent: function(event)
1641 { 1614 {
1642 inspectedGlobalObject.console.log(event.type, event); 1615 inspectedGlobalObject.console.log(event.type, event);
1643 } 1616 }
1644 } 1617 }
1645 1618
1646 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 1619 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
1647 return injectedScript; 1620 return injectedScript;
1648 }) 1621 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698