| 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 | 4 |
| 5 /** @interface */ | 5 /** @interface */ |
| 6 WebInspector.LiveLocation = function() {} | 6 WebInspector.LiveLocation = function() {}; |
| 7 | 7 |
| 8 WebInspector.LiveLocation.prototype = { | 8 WebInspector.LiveLocation.prototype = { |
| 9 update: function() {}, | 9 update: function() {}, |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * @return {?WebInspector.UILocation} | 12 * @return {?WebInspector.UILocation} |
| 13 */ | 13 */ |
| 14 uiLocation: function() {}, | 14 uiLocation: function() {}, |
| 15 | 15 |
| 16 dispose: function() {}, | 16 dispose: function() {}, |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * @return {boolean} | 19 * @return {boolean} |
| 20 */ | 20 */ |
| 21 isBlackboxed: function() {} | 21 isBlackboxed: function() {} |
| 22 } | 22 }; |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @constructor | 25 * @constructor |
| 26 * @implements {WebInspector.LiveLocation} | 26 * @implements {WebInspector.LiveLocation} |
| 27 * @param {function(!WebInspector.LiveLocation)} updateDelegate | 27 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 28 * @param {!WebInspector.LiveLocationPool} locationPool | 28 * @param {!WebInspector.LiveLocationPool} locationPool |
| 29 */ | 29 */ |
| 30 WebInspector.LiveLocationWithPool = function(updateDelegate, locationPool) | 30 WebInspector.LiveLocationWithPool = function(updateDelegate, locationPool) |
| 31 { | 31 { |
| 32 this._updateDelegate = updateDelegate; | 32 this._updateDelegate = updateDelegate; |
| 33 this._locationPool = locationPool; | 33 this._locationPool = locationPool; |
| 34 this._locationPool._add(this); | 34 this._locationPool._add(this); |
| 35 } | 35 }; |
| 36 | 36 |
| 37 WebInspector.LiveLocationWithPool.prototype = { | 37 WebInspector.LiveLocationWithPool.prototype = { |
| 38 /** | 38 /** |
| 39 * @override | 39 * @override |
| 40 */ | 40 */ |
| 41 update: function() | 41 update: function() |
| 42 { | 42 { |
| 43 this._updateDelegate(this); | 43 this._updateDelegate(this); |
| 44 }, | 44 }, |
| 45 | 45 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 }, | 62 }, |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * @override | 65 * @override |
| 66 * @return {boolean} | 66 * @return {boolean} |
| 67 */ | 67 */ |
| 68 isBlackboxed: function() | 68 isBlackboxed: function() |
| 69 { | 69 { |
| 70 throw "Not implemented"; | 70 throw "Not implemented"; |
| 71 } | 71 } |
| 72 } | 72 }; |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * @constructor | 75 * @constructor |
| 76 */ | 76 */ |
| 77 WebInspector.LiveLocationPool = function() | 77 WebInspector.LiveLocationPool = function() |
| 78 { | 78 { |
| 79 this._locations = new Set(); | 79 this._locations = new Set(); |
| 80 } | 80 }; |
| 81 | 81 |
| 82 WebInspector.LiveLocationPool.prototype = { | 82 WebInspector.LiveLocationPool.prototype = { |
| 83 /** | 83 /** |
| 84 * @param {!WebInspector.LiveLocation} location | 84 * @param {!WebInspector.LiveLocation} location |
| 85 */ | 85 */ |
| 86 _add: function(location) | 86 _add: function(location) |
| 87 { | 87 { |
| 88 this._locations.add(location); | 88 this._locations.add(location); |
| 89 }, | 89 }, |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * @param {!WebInspector.LiveLocation} location | 92 * @param {!WebInspector.LiveLocation} location |
| 93 */ | 93 */ |
| 94 _delete: function(location) | 94 _delete: function(location) |
| 95 { | 95 { |
| 96 this._locations.delete(location); | 96 this._locations.delete(location); |
| 97 }, | 97 }, |
| 98 | 98 |
| 99 disposeAll: function() | 99 disposeAll: function() |
| 100 { | 100 { |
| 101 for (var location of this._locations) | 101 for (var location of this._locations) |
| 102 location.dispose(); | 102 location.dispose(); |
| 103 } | 103 } |
| 104 } | 104 }; |
| OLD | NEW |