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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/profiler/ProfilesPanel.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 /* 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 27 matching lines...) Expand all
38 /** @type {!Array.<!WebInspector.ProfileHeader>} */ 38 /** @type {!Array.<!WebInspector.ProfileHeader>} */
39 this._profiles = []; 39 this._profiles = [];
40 /** @type {?WebInspector.ProfileHeader} */ 40 /** @type {?WebInspector.ProfileHeader} */
41 this._profileBeingRecorded = null; 41 this._profileBeingRecorded = null;
42 this._nextProfileUid = 1; 42 this._nextProfileUid = 1;
43 43
44 if (!window.opener) 44 if (!window.opener)
45 window.addEventListener("unload", this._clearTempStorage.bind(this), fal se); 45 window.addEventListener("unload", this._clearTempStorage.bind(this), fal se);
46 } 46 }
47 47
48 /** 48 /** @enum {symbol} */
49 * @enum {string}
50 */
51 WebInspector.ProfileType.Events = { 49 WebInspector.ProfileType.Events = {
52 AddProfileHeader: "add-profile-header", 50 AddProfileHeader: Symbol("add-profile-header"),
53 ProfileComplete: "profile-complete", 51 ProfileComplete: Symbol("profile-complete"),
54 RemoveProfileHeader: "remove-profile-header", 52 RemoveProfileHeader: Symbol("remove-profile-header"),
55 ViewUpdated: "view-updated" 53 ViewUpdated: Symbol("view-updated")
56 } 54 }
57 55
58 WebInspector.ProfileType.prototype = { 56 WebInspector.ProfileType.prototype = {
59 /** 57 /**
60 * @return {string} 58 * @return {string}
61 */ 59 */
62 typeName: function() 60 typeName: function()
63 { 61 {
64 return ""; 62 return "";
65 }, 63 },
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 * @param {boolean|undefined} wait 322 * @param {boolean|undefined} wait
325 */ 323 */
326 WebInspector.ProfileHeader.StatusUpdate = function(subtitle, wait) 324 WebInspector.ProfileHeader.StatusUpdate = function(subtitle, wait)
327 { 325 {
328 /** @type {?string} */ 326 /** @type {?string} */
329 this.subtitle = subtitle; 327 this.subtitle = subtitle;
330 /** @type {boolean|undefined} */ 328 /** @type {boolean|undefined} */
331 this.wait = wait; 329 this.wait = wait;
332 } 330 }
333 331
332 /** @enum {symbol} */
334 WebInspector.ProfileHeader.Events = { 333 WebInspector.ProfileHeader.Events = {
335 UpdateStatus: "UpdateStatus", 334 UpdateStatus: Symbol("UpdateStatus"),
336 ProfileReceived: "ProfileReceived" 335 ProfileReceived: Symbol("ProfileReceived")
337 } 336 }
338 337
339 WebInspector.ProfileHeader.prototype = { 338 WebInspector.ProfileHeader.prototype = {
340 /** 339 /**
341 * @return {?WebInspector.Target} 340 * @return {?WebInspector.Target}
342 */ 341 */
343 target: function() 342 target: function()
344 { 343 {
345 return this._target; 344 return this._target;
346 }, 345 },
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 * @return {boolean} 1285 * @return {boolean}
1287 */ 1286 */
1288 handleAction: function(context, actionId) 1287 handleAction: function(context, actionId)
1289 { 1288 {
1290 var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel); 1289 var panel = WebInspector.context.flavor(WebInspector.ProfilesPanel);
1291 console.assert(panel && panel instanceof WebInspector.ProfilesPanel); 1290 console.assert(panel && panel instanceof WebInspector.ProfilesPanel);
1292 panel.toggleRecord(); 1291 panel.toggleRecord();
1293 return true; 1292 return true;
1294 } 1293 }
1295 } 1294 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698