| OLD | NEW |
| 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 /** @interface */ | 4 /** @interface */ |
| 5 WebInspector.LiveLocation = function() {}; | 5 Bindings.LiveLocation = function() {}; |
| 6 | 6 |
| 7 WebInspector.LiveLocation.prototype = { | 7 Bindings.LiveLocation.prototype = { |
| 8 update: function() {}, | 8 update: function() {}, |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * @return {?WebInspector.UILocation} | 11 * @return {?Workspace.UILocation} |
| 12 */ | 12 */ |
| 13 uiLocation: function() {}, | 13 uiLocation: function() {}, |
| 14 | 14 |
| 15 dispose: function() {}, | 15 dispose: function() {}, |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * @return {boolean} | 18 * @return {boolean} |
| 19 */ | 19 */ |
| 20 isBlackboxed: function() {} | 20 isBlackboxed: function() {} |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * @implements {WebInspector.LiveLocation} | 24 * @implements {Bindings.LiveLocation} |
| 25 * @unrestricted | 25 * @unrestricted |
| 26 */ | 26 */ |
| 27 WebInspector.LiveLocationWithPool = class { | 27 Bindings.LiveLocationWithPool = class { |
| 28 /** | 28 /** |
| 29 * @param {function(!WebInspector.LiveLocation)} updateDelegate | 29 * @param {function(!Bindings.LiveLocation)} updateDelegate |
| 30 * @param {!WebInspector.LiveLocationPool} locationPool | 30 * @param {!Bindings.LiveLocationPool} locationPool |
| 31 */ | 31 */ |
| 32 constructor(updateDelegate, locationPool) { | 32 constructor(updateDelegate, locationPool) { |
| 33 this._updateDelegate = updateDelegate; | 33 this._updateDelegate = updateDelegate; |
| 34 this._locationPool = locationPool; | 34 this._locationPool = locationPool; |
| 35 this._locationPool._add(this); | 35 this._locationPool._add(this); |
| 36 } | 36 } |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * @override | 39 * @override |
| 40 */ | 40 */ |
| 41 update() { | 41 update() { |
| 42 this._updateDelegate(this); | 42 this._updateDelegate(this); |
| 43 } | 43 } |
| 44 | 44 |
| 45 /** | 45 /** |
| 46 * @override | 46 * @override |
| 47 * @return {?WebInspector.UILocation} | 47 * @return {?Workspace.UILocation} |
| 48 */ | 48 */ |
| 49 uiLocation() { | 49 uiLocation() { |
| 50 throw 'Not implemented'; | 50 throw 'Not implemented'; |
| 51 } | 51 } |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * @override | 54 * @override |
| 55 */ | 55 */ |
| 56 dispose() { | 56 dispose() { |
| 57 this._locationPool._delete(this); | 57 this._locationPool._delete(this); |
| 58 this._updateDelegate = null; | 58 this._updateDelegate = null; |
| 59 } | 59 } |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * @override | 62 * @override |
| 63 * @return {boolean} | 63 * @return {boolean} |
| 64 */ | 64 */ |
| 65 isBlackboxed() { | 65 isBlackboxed() { |
| 66 throw 'Not implemented'; | 66 throw 'Not implemented'; |
| 67 } | 67 } |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * @unrestricted | 71 * @unrestricted |
| 72 */ | 72 */ |
| 73 WebInspector.LiveLocationPool = class { | 73 Bindings.LiveLocationPool = class { |
| 74 constructor() { | 74 constructor() { |
| 75 this._locations = new Set(); | 75 this._locations = new Set(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * @param {!WebInspector.LiveLocation} location | 79 * @param {!Bindings.LiveLocation} location |
| 80 */ | 80 */ |
| 81 _add(location) { | 81 _add(location) { |
| 82 this._locations.add(location); | 82 this._locations.add(location); |
| 83 } | 83 } |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * @param {!WebInspector.LiveLocation} location | 86 * @param {!Bindings.LiveLocation} location |
| 87 */ | 87 */ |
| 88 _delete(location) { | 88 _delete(location) { |
| 89 this._locations.delete(location); | 89 this._locations.delete(location); |
| 90 } | 90 } |
| 91 | 91 |
| 92 disposeAll() { | 92 disposeAll() { |
| 93 for (var location of this._locations) | 93 for (var location of this._locations) |
| 94 location.dispose(); | 94 location.dispose(); |
| 95 } | 95 } |
| 96 }; | 96 }; |
| OLD | NEW |