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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 2605693003: DevTools: introduce object previews experiment (Closed)
Patch Set: rebase Created 3 years, 10 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 if (!executionContext) 564 if (!executionContext)
565 return; 565 return;
566 var callFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame); 566 var callFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame);
567 if (!callFrame) 567 if (!callFrame)
568 return; 568 return;
569 569
570 var localScope = callFrame.localScope(); 570 var localScope = callFrame.localScope();
571 var functionLocation = callFrame.functionLocation(); 571 var functionLocation = callFrame.functionLocation();
572 if (localScope && functionLocation) { 572 if (localScope && functionLocation) {
573 Sources.SourceMapNamesResolver.resolveScopeInObject(localScope) 573 Sources.SourceMapNamesResolver.resolveScopeInObject(localScope)
574 .getAllProperties(false, this._prepareScopeVariables.bind(this, callFr ame)); 574 .getAllProperties(false, false, this._prepareScopeVariables.bind(this, callFrame));
575 } 575 }
576 576
577 if (this._clearValueWidgetsTimer) { 577 if (this._clearValueWidgetsTimer) {
578 clearTimeout(this._clearValueWidgetsTimer); 578 clearTimeout(this._clearValueWidgetsTimer);
579 delete this._clearValueWidgetsTimer; 579 delete this._clearValueWidgetsTimer;
580 } 580 }
581 } 581 }
582 582
583 /** 583 /**
584 * @param {!SDK.DebuggerModel.CallFrame} callFrame 584 * @param {!SDK.DebuggerModel.CallFrame} callFrame
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (namesPerLine.get(i - 1) && namesPerLine.get(i - 1).has(name)) 682 if (namesPerLine.get(i - 1) && namesPerLine.get(i - 1).has(name))
683 continue; // Only render name once in the given continuous block. 683 continue; // Only render name once in the given continuous block.
684 if (renderedNameCount) 684 if (renderedNameCount)
685 widget.createTextChild(', '); 685 widget.createTextChild(', ');
686 var nameValuePair = widget.createChild('span'); 686 var nameValuePair = widget.createChild('span');
687 widget.__nameToToken.set(name, nameValuePair); 687 widget.__nameToToken.set(name, nameValuePair);
688 nameValuePair.createTextChild(name + ' = '); 688 nameValuePair.createTextChild(name + ' = ');
689 var value = valuesMap.get(name); 689 var value = valuesMap.get(name);
690 var propertyCount = value.preview ? value.preview.properties.length : 0; 690 var propertyCount = value.preview ? value.preview.properties.length : 0;
691 var entryCount = value.preview && value.preview.entries ? value.preview. entries.length : 0; 691 var entryCount = value.preview && value.preview.entries ? value.preview. entries.length : 0;
692 if (value.preview && propertyCount + entryCount < 10) 692 if (value.preview && propertyCount + entryCount < 10) {
693 formatter.appendObjectPreview(nameValuePair, value.preview); 693 formatter.appendObjectPreview(nameValuePair, value.preview, false /* i sEntry */);
694 else 694 } else {
695 nameValuePair.appendChild(Components.ObjectPropertiesSection.createVal ueElement(value, false)); 695 nameValuePair.appendChild(Components.ObjectPropertiesSection.createVal ueElement(
696 value, false /* wasThrown */, false /* showPreview */));
697 }
696 ++renderedNameCount; 698 ++renderedNameCount;
697 } 699 }
698 700
699 var widgetChanged = true; 701 var widgetChanged = true;
700 if (oldWidget) { 702 if (oldWidget) {
701 widgetChanged = false; 703 widgetChanged = false;
702 for (var name of widget.__nameToToken.keys()) { 704 for (var name of widget.__nameToToken.keys()) {
703 var oldText = oldWidget.__nameToToken.get(name) ? oldWidget.__nameToTo ken.get(name).textContent : ''; 705 var oldText = oldWidget.__nameToToken.get(name) ? oldWidget.__nameToTo ken.get(name).textContent : '';
704 var newText = widget.__nameToToken.get(name) ? widget.__nameToToken.ge t(name).textContent : ''; 706 var newText = widget.__nameToToken.get(name) ? widget.__nameToToken.ge t(name).textContent : '';
705 if (newText !== oldText) { 707 if (newText !== oldText) {
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 hide() { 1374 hide() {
1373 if (!this.bookmark) 1375 if (!this.bookmark)
1374 return; 1376 return;
1375 this.bookmark.clear(); 1377 this.bookmark.clear();
1376 this.bookmark = null; 1378 this.bookmark = null;
1377 } 1379 }
1378 }; 1380 };
1379 1381
1380 Sources.JavaScriptSourceFrame.BreakpointDecoration.bookmarkSymbol = Symbol('book mark'); 1382 Sources.JavaScriptSourceFrame.BreakpointDecoration.bookmarkSymbol = Symbol('book mark');
1381 Sources.JavaScriptSourceFrame.BreakpointDecoration._elementSymbolForTest = Symbo l('element'); 1383 Sources.JavaScriptSourceFrame.BreakpointDecoration._elementSymbolForTest = Symbo l('element');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698