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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js

Issue 2146163002: [DevTools] Remove Console.messagesCleared event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2139543002
Patch Set: rebased on ToT Created 4 years, 5 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 * @param {!WebInspector.ConsoleMessage} msg 75 * @param {!WebInspector.ConsoleMessage} msg
76 */ 76 */
77 addMessage: function(msg) 77 addMessage: function(msg)
78 { 78 {
79 if (this._isBlacklisted(msg)) 79 if (this._isBlacklisted(msg))
80 return; 80 return;
81 81
82 if (msg.source === WebInspector.ConsoleMessage.MessageSource.Worker && m sg.target().workerManager && msg.target().workerManager.targetByWorkerId(msg.wor kerId)) 82 if (msg.source === WebInspector.ConsoleMessage.MessageSource.Worker && m sg.target().workerManager && msg.target().workerManager.targetByWorkerId(msg.wor kerId))
83 return; 83 return;
84 84
85 if (msg.source === WebInspector.ConsoleMessage.MessageSource.ConsoleAPI && msg.type === WebInspector.ConsoleMessage.MessageType.Clear)
86 this.clear();
87
85 if (msg.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError && msg._revokedExceptionId) { 88 if (msg.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError && msg._revokedExceptionId) {
86 var exceptionMessage = this._messageByExceptionId.get(msg._revokedEx ceptionId); 89 var exceptionMessage = this._messageByExceptionId.get(msg._revokedEx ceptionId);
87 if (!exceptionMessage) 90 if (!exceptionMessage)
88 return; 91 return;
89 this._errors--; 92 this._errors--;
90 this._revokedErrors++; 93 this._revokedErrors++;
91 exceptionMessage.level = WebInspector.ConsoleMessage.MessageLevel.Re vokedError; 94 exceptionMessage.level = WebInspector.ConsoleMessage.MessageLevel.Re vokedError;
92 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.Messa geUpdated, exceptionMessage); 95 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.Messa geUpdated, exceptionMessage);
93 return; 96 return;
94 } 97 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 * @return {!Array.<!WebInspector.ConsoleMessage>} 141 * @return {!Array.<!WebInspector.ConsoleMessage>}
139 */ 142 */
140 messages: function() 143 messages: function()
141 { 144 {
142 return this._messages; 145 return this._messages;
143 }, 146 },
144 147
145 requestClearMessages: function() 148 requestClearMessages: function()
146 { 149 {
147 this._consoleAgent.clearMessages(); 150 this._consoleAgent.clearMessages();
148 this._messagesCleared(); 151 this.clear();
149 }, 152 },
150 153
151 _messagesCleared: function() 154 clear: function()
152 { 155 {
153 this._messages = []; 156 this._messages = [];
154 this._messageByExceptionId.clear(); 157 this._messageByExceptionId.clear();
155 this._errors = 0; 158 this._errors = 0;
156 this._revokedErrors = 0; 159 this._revokedErrors = 0;
157 this._warnings = 0; 160 this._warnings = 0;
158 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCl eared); 161 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCl eared);
159 }, 162 },
160 163
161 /** 164 /**
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 */ 559 */
557 messageRepeatCountUpdated: function(count) 560 messageRepeatCountUpdated: function(count)
558 { 561 {
559 }, 562 },
560 563
561 /** 564 /**
562 * @override 565 * @override
563 */ 566 */
564 messagesCleared: function() 567 messagesCleared: function()
565 { 568 {
566 if (!WebInspector.moduleSetting("preserveConsoleLog").get())
567 this._console._messagesCleared();
568 } 569 }
569 } 570 }
570 571
571 /** 572 /**
572 * @constructor 573 * @constructor
573 * @extends {WebInspector.Object} 574 * @extends {WebInspector.Object}
574 * @implements {WebInspector.TargetManager.Observer} 575 * @implements {WebInspector.TargetManager.Observer}
575 */ 576 */
576 WebInspector.MultitargetConsoleModel = function() 577 WebInspector.MultitargetConsoleModel = function()
577 { 578 {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data); 648 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data);
648 }, 649 },
649 650
650 __proto__: WebInspector.Object.prototype 651 __proto__: WebInspector.Object.prototype
651 } 652 }
652 653
653 /** 654 /**
654 * @type {!WebInspector.MultitargetConsoleModel} 655 * @type {!WebInspector.MultitargetConsoleModel}
655 */ 656 */
656 WebInspector.multitargetConsoleModel; 657 WebInspector.multitargetConsoleModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698