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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/LogModel.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 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @implements {Protocol.LogDispatcher} 6 * @implements {Protocol.LogDispatcher}
7 */ 7 */
8 SDK.LogModel = class extends SDK.SDKModel { 8 SDK.LogModel = class extends SDK.SDKModel {
9 /** 9 /**
10 * @param {!SDK.Target} target 10 * @param {!SDK.Target} target
(...skipping 10 matching lines...) Expand all
21 {name: 'recurringHandler', threshold: 50}, {name: 'discouragedAPIUse', t hreshold: -1} 21 {name: 'recurringHandler', threshold: 50}, {name: 'discouragedAPIUse', t hreshold: -1}
22 ]); 22 ]);
23 } 23 }
24 } 24 }
25 25
26 /** 26 /**
27 * @override 27 * @override
28 * @param {!Protocol.Log.LogEntry} payload 28 * @param {!Protocol.Log.LogEntry} payload
29 */ 29 */
30 entryAdded(payload) { 30 entryAdded(payload) {
31 this.emit(new SDK.LogModel.EntryAddedEvent(payload)); 31 this.emit(new SDK.LogModel.EntryAddedEvent(this, payload));
32 } 32 }
33 33
34 requestClear() { 34 requestClear() {
35 this._logAgent.clear(); 35 this._logAgent.clear();
36 } 36 }
37 }; 37 };
38 38
39 SDK.SDKModel.register(SDK.LogModel, SDK.Target.Capability.Log); 39 SDK.SDKModel.register(SDK.LogModel, SDK.Target.Capability.Log);
40 40
41 /** @implements {Common.Emittable} */ 41 /** @implements {Common.Emittable} */
42 SDK.LogModel.EntryAddedEvent = class { 42 SDK.LogModel.EntryAddedEvent = class {
43 /** 43 /**
44 * @param {!SDK.LogModel} logModel
44 * @param {!Protocol.Log.LogEntry} entry 45 * @param {!Protocol.Log.LogEntry} entry
45 */ 46 */
46 constructor(entry) { 47 constructor(logModel, entry) {
48 this.logModel = logModel;
47 this.entry = entry; 49 this.entry = entry;
48 } 50 }
49 }; 51 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698