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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/common/Object.js

Issue 2562453003: [DevTools] Remove Common.Event.target field. (Closed)
Patch Set: works Created 4 years 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 /** 86 /**
87 * @override 87 * @override
88 * @param {symbol} eventType 88 * @param {symbol} eventType
89 * @param {*=} eventData 89 * @param {*=} eventData
90 */ 90 */
91 dispatchEventToListeners(eventType, eventData) { 91 dispatchEventToListeners(eventType, eventData) {
92 if (!this._listeners || !this._listeners.has(eventType)) 92 if (!this._listeners || !this._listeners.has(eventType))
93 return; 93 return;
94 94
95 var event = new Common.Event(this, eventData); 95 var event = new Common.Event(eventData);
96 var listeners = this._listeners.get(eventType).slice(0); 96 var listeners = this._listeners.get(eventType).slice(0);
97 for (var i = 0; i < listeners.length; ++i) 97 for (var i = 0; i < listeners.length; ++i)
98 listeners[i].listener.call(listeners[i].thisObject, event); 98 listeners[i].listener.call(listeners[i].thisObject, event);
99 } 99 }
100 }; 100 };
101 101
102 /** 102 /**
103 * @unrestricted 103 * @unrestricted
104 */ 104 */
105 Common.Event = class { 105 Common.Event = class {
106 /** 106 /**
107 * @param {!Common.EventTarget} target
108 * @param {*=} data 107 * @param {*=} data
109 */ 108 */
110 constructor(target, data) { 109 constructor(data) {
111 this.target = target;
112 this.data = data; 110 this.data = data;
113 } 111 }
114 }; 112 };
115 113
116 /** 114 /**
117 * @interface 115 * @interface
118 */ 116 */
119 Common.EventTarget = function() {}; 117 Common.EventTarget = function() {};
120 118
121 /** 119 /**
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 * @param {(!Object|undefined)} receiver 169 * @param {(!Object|undefined)} receiver
172 * @param {function(?):?} method 170 * @param {function(?):?} method
173 */ 171 */
174 constructor(eventTarget, eventType, receiver, method) { 172 constructor(eventTarget, eventType, receiver, method) {
175 this.eventTarget = eventTarget; 173 this.eventTarget = eventTarget;
176 this.eventType = eventType; 174 this.eventType = eventType;
177 this.receiver = receiver; 175 this.receiver = receiver;
178 this.method = method; 176 this.method = method;
179 } 177 }
180 }; 178 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698