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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/Context.js

Issue 2261933002: DevTools: Use JS symbols instead of strings for eligible events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @constructor 6 * @constructor
7 */ 7 */
8 WebInspector.Context = function() 8 WebInspector.Context = function()
9 { 9 {
10 this._flavors = new Map(); 10 this._flavors = new Map();
11 this._eventDispatchers = new Map(); 11 this._eventDispatchers = new Map();
12 } 12 }
13 13
14 /** 14 /** @enum {symbol} */
15 * @enum {string}
16 */
17 WebInspector.Context.Events = { 15 WebInspector.Context.Events = {
18 FlavorChanged: "FlavorChanged" 16 FlavorChanged: Symbol("FlavorChanged")
19 } 17 }
20 18
21 WebInspector.Context.prototype = { 19 WebInspector.Context.prototype = {
22 /** 20 /**
23 * @param {function(new:T, ...)} flavorType 21 * @param {function(new:T, ...)} flavorType
24 * @param {?T} flavorValue 22 * @param {?T} flavorValue
25 * @template T 23 * @template T
26 */ 24 */
27 setFlavor: function(flavorType, flavorValue) 25 setFlavor: function(flavorType, flavorValue)
28 { 26 {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 WebInspector.ContextFlavorListener = function() { } 124 WebInspector.ContextFlavorListener = function() { }
127 125
128 WebInspector.ContextFlavorListener.prototype = { 126 WebInspector.ContextFlavorListener.prototype = {
129 /** 127 /**
130 * @param {?Object} object 128 * @param {?Object} object
131 */ 129 */
132 flavorChanged: function(object) { } 130 flavorChanged: function(object) { }
133 } 131 }
134 132
135 WebInspector.context = new WebInspector.Context(); 133 WebInspector.context = new WebInspector.Context();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698