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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/ServiceWorkerManager.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 /** @type {!Map.<string, !WebInspector.ServiceWorkerRegistration>} */ 44 /** @type {!Map.<string, !WebInspector.ServiceWorkerRegistration>} */
45 this._registrations = new Map(); 45 this._registrations = new Map();
46 this.enable(); 46 this.enable();
47 this._forceUpdateSetting = WebInspector.settings.createSetting("serviceWorke rUpdateOnReload", false); 47 this._forceUpdateSetting = WebInspector.settings.createSetting("serviceWorke rUpdateOnReload", false);
48 if (this._forceUpdateSetting.get()) 48 if (this._forceUpdateSetting.get())
49 this._forceUpdateSettingChanged(); 49 this._forceUpdateSettingChanged();
50 this._forceUpdateSetting.addChangeListener(this._forceUpdateSettingChanged, this); 50 this._forceUpdateSetting.addChangeListener(this._forceUpdateSettingChanged, this);
51 WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebIn spector.RuntimeModel.Events.ExecutionContextCreated, this._executionContextCreat ed, this); 51 WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebIn spector.RuntimeModel.Events.ExecutionContextCreated, this._executionContextCreat ed, this);
52 } 52 }
53 53
54 /** @enum {symbol} */
54 WebInspector.ServiceWorkerManager.Events = { 55 WebInspector.ServiceWorkerManager.Events = {
55 WorkersUpdated: "WorkersUpdated", 56 WorkersUpdated: Symbol("WorkersUpdated"),
56 RegistrationUpdated: "RegistrationUpdated", 57 RegistrationUpdated: Symbol("RegistrationUpdated"),
57 RegistrationErrorAdded: "RegistrationErrorAdded", 58 RegistrationErrorAdded: Symbol("RegistrationErrorAdded"),
58 RegistrationDeleted: "RegistrationDeleted" 59 RegistrationDeleted: Symbol("RegistrationDeleted")
59 } 60 }
60 61
61 WebInspector.ServiceWorkerManager.prototype = { 62 WebInspector.ServiceWorkerManager.prototype = {
62 enable: function() 63 enable: function()
63 { 64 {
64 if (this._enabled) 65 if (this._enabled)
65 return; 66 return;
66 this._enabled = true; 67 this._enabled = true;
67 68
68 this._agent.enable(); 69 this._agent.enable();
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 { 885 {
885 return this._isRedundant() && (!this.errors.length || this._deleting); 886 return this._isRedundant() && (!this.errors.length || this._deleting);
886 }, 887 },
887 888
888 clearErrors: function() 889 clearErrors: function()
889 { 890 {
890 this._fingerprint = Symbol("fingerprint"); 891 this._fingerprint = Symbol("fingerprint");
891 this.errors = []; 892 this.errors = [];
892 } 893 }
893 } 894 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698