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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/resources/DatabaseModel.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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 */ 139 */
140 WebInspector.DatabaseModel = function(target) 140 WebInspector.DatabaseModel = function(target)
141 { 141 {
142 WebInspector.SDKModel.call(this, WebInspector.DatabaseModel, target); 142 WebInspector.SDKModel.call(this, WebInspector.DatabaseModel, target);
143 143
144 this._databases = []; 144 this._databases = [];
145 this._agent = target.databaseAgent(); 145 this._agent = target.databaseAgent();
146 this.target().registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher (this)); 146 this.target().registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher (this));
147 } 147 }
148 148
149 /** @enum {symbol} */
149 WebInspector.DatabaseModel.Events = { 150 WebInspector.DatabaseModel.Events = {
150 DatabaseAdded: "DatabaseAdded", 151 DatabaseAdded: Symbol("DatabaseAdded"),
151 DatabasesRemoved: "DatabasesRemoved" 152 DatabasesRemoved: Symbol("DatabasesRemoved")
152 } 153 }
153 154
154 WebInspector.DatabaseModel.prototype = { 155 WebInspector.DatabaseModel.prototype = {
155 enable: function() 156 enable: function()
156 { 157 {
157 if (this._enabled) 158 if (this._enabled)
158 return; 159 return;
159 this._agent.enable(); 160 this._agent.enable();
160 this._enabled = true; 161 this._enabled = true;
161 }, 162 },
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 * @param {!WebInspector.Target} target 225 * @param {!WebInspector.Target} target
225 * @return {!WebInspector.DatabaseModel} 226 * @return {!WebInspector.DatabaseModel}
226 */ 227 */
227 WebInspector.DatabaseModel.fromTarget = function(target) 228 WebInspector.DatabaseModel.fromTarget = function(target)
228 { 229 {
229 if (!target[WebInspector.DatabaseModel._symbol]) 230 if (!target[WebInspector.DatabaseModel._symbol])
230 target[WebInspector.DatabaseModel._symbol] = new WebInspector.DatabaseMo del(target); 231 target[WebInspector.DatabaseModel._symbol] = new WebInspector.DatabaseMo del(target);
231 232
232 return target[WebInspector.DatabaseModel._symbol]; 233 return target[WebInspector.DatabaseModel._symbol];
233 } 234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698