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

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

Issue 1141553003: DevTools: make getInternalProperties work when Debugger is not enabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed failing test Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 { 475 {
476 var parsedObjectId = this._parseObjectId(objectId); 476 var parsedObjectId = this._parseObjectId(objectId);
477 var object = this._objectForId(parsedObjectId); 477 var object = this._objectForId(parsedObjectId);
478 var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjec tId.id); 478 var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjec tId.id);
479 if (!this._isDefined(object) || isSymbol(object)) 479 if (!this._isDefined(object) || isSymbol(object))
480 return false; 480 return false;
481 object = /** @type {!Object} */ (object); 481 object = /** @type {!Object} */ (object);
482 var descriptors = []; 482 var descriptors = [];
483 var internalProperties = InjectedScriptHost.getInternalProperties(object ); 483 var internalProperties = InjectedScriptHost.getInternalProperties(object );
484 if (internalProperties) { 484 if (internalProperties) {
485 for (var i = 0; i < internalProperties.length; i++) { 485 for (var i = 0; i < internalProperties.length; i += 2) {
486 var property = internalProperties[i];
487 var descriptor = { 486 var descriptor = {
488 name: property.name, 487 name: internalProperties[i],
489 value: this._wrapObject(property.value, objectGroupName), 488 value: this._wrapObject(internalProperties[i + 1], objectGro upName),
490 __proto__: null 489 __proto__: null
491 }; 490 };
492 push(descriptors, descriptor); 491 push(descriptors, descriptor);
493 } 492 }
494 } 493 }
495 return descriptors; 494 return descriptors;
496 }, 495 },
497 496
498 /** 497 /**
499 * @param {string} functionId 498 * @param {string} functionId
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 }; 1390 };
1392 1391
1393 try { 1392 try {
1394 var descriptors = injectedScript._propertyDescriptors(object, undefi ned, undefined, firstLevelKeys); 1393 var descriptors = injectedScript._propertyDescriptors(object, undefi ned, undefined, firstLevelKeys);
1395 1394
1396 this._appendPropertyDescriptors(preview, descriptors, propertiesThre shold, secondLevelKeys, isTable); 1395 this._appendPropertyDescriptors(preview, descriptors, propertiesThre shold, secondLevelKeys, isTable);
1397 if (propertiesThreshold.indexes < 0 || propertiesThreshold.propertie s < 0) 1396 if (propertiesThreshold.indexes < 0 || propertiesThreshold.propertie s < 0)
1398 return preview; 1397 return preview;
1399 1398
1400 // Add internal properties to preview. 1399 // Add internal properties to preview.
1401 var internalProperties = InjectedScriptHost.getInternalProperties(ob ject) || []; 1400 var rawInternalProperties = InjectedScriptHost.getInternalProperties (object) || [];
1402 for (var i = 0; i < internalProperties.length; ++i) { 1401 var internalProperties = [];
1403 internalProperties[i] = nullifyObjectProto(internalProperties[i] ); 1402 for (var i = 0; i < rawInternalProperties.length; i += 2) {
1404 internalProperties[i].isOwn = true; 1403 push(internalProperties, {
1405 internalProperties[i].enumerable = true; 1404 name: rawInternalProperties[i],
1405 value: rawInternalProperties[i + 1],
1406 isOwn: true,
1407 enumerable: true,
1408 __proto__: null
1409 });
1406 } 1410 }
1407 this._appendPropertyDescriptors(preview, internalProperties, propert iesThreshold, secondLevelKeys, isTable); 1411 this._appendPropertyDescriptors(preview, internalProperties, propert iesThreshold, secondLevelKeys, isTable);
1408 1412
1409 if (this.subtype === "map" || this.subtype === "set" || this.subtype === "iterator") 1413 if (this.subtype === "map" || this.subtype === "set" || this.subtype === "iterator")
1410 this._appendEntriesPreview(object, preview, skipEntriesPreview); 1414 this._appendEntriesPreview(object, preview, skipEntriesPreview);
1411 1415
1412 } catch (e) { 1416 } catch (e) {
1413 preview.lossless = false; 1417 preview.lossless = false;
1414 } 1418 }
1415 1419
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 */ 2024 */
2021 _logEvent: function(event) 2025 _logEvent: function(event)
2022 { 2026 {
2023 inspectedWindow.console.log(event.type, event); 2027 inspectedWindow.console.log(event.type, event);
2024 } 2028 }
2025 } 2029 }
2026 2030
2027 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); 2031 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl();
2028 return injectedScript; 2032 return injectedScript;
2029 }) 2033 })
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698