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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js

Issue 2751173003: [DevTools] Turn ConsoleModel into a singleton (Closed)
Patch Set: rebased Created 3 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 26 matching lines...) Expand all
37 */ 37 */
38 constructor(workspace) { 38 constructor(workspace) {
39 this._workspace = workspace; 39 this._workspace = workspace;
40 40
41 /** @type {!Object.<string, !Array.<!SDK.ConsoleMessage>>} */ 41 /** @type {!Object.<string, !Array.<!SDK.ConsoleMessage>>} */
42 this._pendingConsoleMessages = {}; 42 this._pendingConsoleMessages = {};
43 43
44 /** @type {!Array.<!Bindings.PresentationConsoleMessage>} */ 44 /** @type {!Array.<!Bindings.PresentationConsoleMessage>} */
45 this._presentationConsoleMessages = []; 45 this._presentationConsoleMessages = [];
46 46
47 SDK.multitargetConsoleModel.addEventListener(SDK.ConsoleModel.Events.Console Cleared, this._consoleCleared, this); 47 SDK.consoleModel.addEventListener(SDK.ConsoleModel.Events.ConsoleCleared, th is._consoleCleared, this);
48 SDK.multitargetConsoleModel.addEventListener( 48 SDK.consoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, this ._onConsoleMessageAdded, this);
49 SDK.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this) ; 49 SDK.consoleModel.messages().forEach(this._consoleMessageAdded, this);
50 SDK.multitargetConsoleModel.messages().forEach(this._consoleMessageAdded, th is);
51 // TODO(dgozman): setImmediate because we race with DebuggerWorkspaceBinding on ParsedScriptSource event delivery. 50 // TODO(dgozman): setImmediate because we race with DebuggerWorkspaceBinding on ParsedScriptSource event delivery.
52 SDK.targetManager.addModelListener( 51 SDK.targetManager.addModelListener(
53 SDK.DebuggerModel, SDK.DebuggerModel.Events.ParsedScriptSource, 52 SDK.DebuggerModel, SDK.DebuggerModel.Events.ParsedScriptSource,
54 event => setImmediate(this._parsedScriptSource.bind(this, event))); 53 event => setImmediate(this._parsedScriptSource.bind(this, event)));
55 SDK.targetManager.addModelListener( 54 SDK.targetManager.addModelListener(
56 SDK.DebuggerModel, SDK.DebuggerModel.Events.FailedToParseScriptSource, 55 SDK.DebuggerModel, SDK.DebuggerModel.Events.FailedToParseScriptSource,
57 event => setImmediate(this._parsedScriptSource.bind(this, event))); 56 event => setImmediate(this._parsedScriptSource.bind(this, event)));
58 SDK.targetManager.addModelListener( 57 SDK.targetManager.addModelListener(
59 SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._d ebuggerReset, this); 58 SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._d ebuggerReset, this);
60 59
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 196 }
198 197
199 dispose() { 198 dispose() {
200 if (this._uiMessage) 199 if (this._uiMessage)
201 this._uiMessage.remove(); 200 this._uiMessage.remove();
202 } 201 }
203 }; 202 };
204 203
205 /** @type {!Bindings.PresentationConsoleMessageHelper} */ 204 /** @type {!Bindings.PresentationConsoleMessageHelper} */
206 Bindings.presentationConsoleMessageHelper; 205 Bindings.presentationConsoleMessageHelper;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698