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

Side by Side Diff: Source/devtools/front_end/ConsoleViewMessage.js

Issue 211023002: DevTools: Remove event Console.messageRepeatCountUpdated (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix inspector-protocol/console/console-timestamp.html Created 6 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
« no previous file with comments | « Source/devtools/front_end/ConsoleView.js ('k') | Source/devtools/front_end/Main.js » ('j') | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 21 matching lines...) Expand all
32 * @constructor 32 * @constructor
33 * 33 *
34 * @param {!WebInspector.ConsoleMessage} consoleMessage 34 * @param {!WebInspector.ConsoleMessage} consoleMessage
35 * @param {?WebInspector.Linkifier} linkifier 35 * @param {?WebInspector.Linkifier} linkifier
36 */ 36 */
37 WebInspector.ConsoleViewMessage = function(target, consoleMessage, linkifier) 37 WebInspector.ConsoleViewMessage = function(target, consoleMessage, linkifier)
38 { 38 {
39 this._message = consoleMessage; 39 this._message = consoleMessage;
40 this._linkifier = linkifier; 40 this._linkifier = linkifier;
41 this._target = target; 41 this._target = target;
42 this._repeatCount = 1;
42 43
43 /** @type {!Array.<!WebInspector.DataGrid>} */ 44 /** @type {!Array.<!WebInspector.DataGrid>} */
44 this._dataGrids = []; 45 this._dataGrids = [];
45 /** @type {!Map.<!WebInspector.DataGrid, ?Element>} */ 46 /** @type {!Map.<!WebInspector.DataGrid, ?Element>} */
46 this._dataGridParents = new Map(); 47 this._dataGridParents = new Map();
47 48
48 this._customFormatters = { 49 this._customFormatters = {
49 "object": this._formatParameterAsObject, 50 "object": this._formatParameterAsObject,
50 "array": this._formatParameterAsArray, 51 "array": this._formatParameterAsArray,
51 "node": this._formatParameterAsNode, 52 "node": this._formatParameterAsNode,
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 case WebInspector.ConsoleMessage.MessageLevel.Info: 875 case WebInspector.ConsoleMessage.MessageLevel.Info:
875 element.classList.add("console-info-level"); 876 element.classList.add("console-info-level");
876 break; 877 break;
877 } 878 }
878 879
879 if (this._message.type === WebInspector.ConsoleMessage.MessageType.Start Group || this._message.type === WebInspector.ConsoleMessage.MessageType.StartGro upCollapsed) 880 if (this._message.type === WebInspector.ConsoleMessage.MessageType.Start Group || this._message.type === WebInspector.ConsoleMessage.MessageType.StartGro upCollapsed)
880 element.classList.add("console-group-title"); 881 element.classList.add("console-group-title");
881 882
882 element.appendChild(this.formattedMessage()); 883 element.appendChild(this.formattedMessage());
883 884
884 if (this._message.repeatCount > 1) 885 if (this._repeatCount > 1)
885 this.updateRepeatCount(); 886 this._showRepeatCountElement();
886 887
887 return element; 888 return element;
888 }, 889 },
889 890
890 _populateStackTraceTreeElement: function(parentTreeElement) 891 _populateStackTraceTreeElement: function(parentTreeElement)
891 { 892 {
892 for (var i = 0; i < this._message.stackTrace.length; i++) { 893 for (var i = 0; i < this._message.stackTrace.length; i++) {
893 var frame = this._message.stackTrace[i]; 894 var frame = this._message.stackTrace[i];
894 895
895 var content = document.createElementWithClass("div", "stacktrace-ent ry"); 896 var content = document.createElementWithClass("div", "stacktrace-ent ry");
896 var messageTextElement = document.createElement("span"); 897 var messageTextElement = document.createElement("span");
897 messageTextElement.className = "console-message-text source-code"; 898 messageTextElement.className = "console-message-text source-code";
898 var functionName = frame.functionName || WebInspector.UIString("(ano nymous function)"); 899 var functionName = frame.functionName || WebInspector.UIString("(ano nymous function)");
899 messageTextElement.appendChild(document.createTextNode(functionName) ); 900 messageTextElement.appendChild(document.createTextNode(functionName) );
900 content.appendChild(messageTextElement); 901 content.appendChild(messageTextElement);
901 902
902 if (frame.scriptId) { 903 if (frame.scriptId) {
903 content.appendChild(document.createTextNode(" ")); 904 content.appendChild(document.createTextNode(" "));
904 var urlElement = this._linkifyCallFrame(frame); 905 var urlElement = this._linkifyCallFrame(frame);
905 if (!urlElement) 906 if (!urlElement)
906 continue; 907 continue;
907 content.appendChild(urlElement); 908 content.appendChild(urlElement);
908 } 909 }
909 910
910 var treeElement = new TreeElement(content); 911 var treeElement = new TreeElement(content);
911 parentTreeElement.appendChild(treeElement); 912 parentTreeElement.appendChild(treeElement);
912 } 913 }
913 }, 914 },
914 915
915 updateRepeatCount: function() { 916 incrementRepeatCount: function()
917 {
918 this._repeatCount++;
919 this._showRepeatCountElement();
920 },
921
922 _showRepeatCountElement: function()
923 {
916 if (!this._element) 924 if (!this._element)
917 return; 925 return;
918 926
919 if (!this.repeatCountElement) { 927 if (!this.repeatCountElement) {
920 this.repeatCountElement = document.createElement("span"); 928 this.repeatCountElement = document.createElement("span");
921 this.repeatCountElement.className = "bubble"; 929 this.repeatCountElement.className = "bubble";
922 930
923 this._element.insertBefore(this.repeatCountElement, this._element.fi rstChild); 931 this._element.insertBefore(this.repeatCountElement, this._element.fi rstChild);
924 this._element.classList.add("repeated-message"); 932 this._element.classList.add("repeated-message");
925 } 933 }
926 this.repeatCountElement.textContent = this._message.repeatCount; 934 this.repeatCountElement.textContent = this._repeatCount;
927 }, 935 },
928 936
929 /** 937 /**
930 * @return {string} 938 * @return {string}
931 */ 939 */
932 toString: function() 940 toString: function()
933 { 941 {
934 var sourceString; 942 var sourceString;
935 switch (this._message.source) { 943 switch (this._message.source) {
936 case WebInspector.ConsoleMessage.MessageSource.XML: 944 case WebInspector.ConsoleMessage.MessageSource.XML:
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 } 1026 }
1019 1027
1020 return sourceString + " " + typeString + " " + levelString + ": " + this .formattedMessage().textContent + "\n" + this._message.url + " line " + this._me ssage.line; 1028 return sourceString + " " + typeString + " " + levelString + ": " + this .formattedMessage().textContent + "\n" + this._message.url + " line " + this._me ssage.line;
1021 }, 1029 },
1022 1030
1023 get text() 1031 get text()
1024 { 1032 {
1025 return this._message.messageText; 1033 return this._message.messageText;
1026 } 1034 }
1027 } 1035 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ConsoleView.js ('k') | Source/devtools/front_end/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698