Chromium Code Reviews| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat e | 7 * @param {function(!WebInspector.LiveLocation)} updateDelegate |
| 8 */ | 8 */ |
| 9 WebInspector.LiveLocation = function(updateDelegate) | 9 WebInspector.LiveLocation = function(updateDelegate) |
| 10 { | 10 { |
| 11 this._updateDelegate = updateDelegate; | 11 this._updateDelegate = updateDelegate; |
| 12 /** @type {?WebInspector.UILocation} */ | |
| 13 this.uiLocation = null; | |
| 12 } | 14 } |
| 13 | 15 |
| 14 WebInspector.LiveLocation.prototype = { | 16 WebInspector.LiveLocation.prototype = { |
| 15 update: function() | 17 update: function() |
| 16 { | 18 { |
| 17 var uiLocation = this.uiLocation(); | 19 this.uiLocation = this._updateUILocation(); |
|
dgozman
2016/02/18 02:17:53
Let's not store it, better check in client.
kozy
2016/02/18 02:36:25
Done.
| |
| 18 if (!uiLocation) | 20 if (this.uiLocation) |
| 19 return; | 21 this._updateDelegate(this); |
| 20 if (this._updateDelegate(uiLocation)) | |
| 21 this.dispose(); | |
| 22 }, | 22 }, |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * @return {?WebInspector.UILocation} | 25 * @return {?WebInspector.UILocation} |
| 26 */ | 26 */ |
| 27 uiLocation: function() | 27 _updateUILocation: function() |
| 28 { | 28 { |
| 29 throw "Not implemented"; | 29 throw "Not implemented"; |
| 30 }, | 30 }, |
| 31 | 31 |
| 32 dispose: function() | 32 dispose: function() |
| 33 { | 33 { |
| 34 // Overridden by subclasses. | 34 // Overridden by subclasses. |
| 35 }, | |
| 36 | |
| 37 /** | |
| 38 * @return {boolean} | |
| 39 */ | |
| 40 isBlackboxed: function() | |
| 41 { | |
| 42 throw "Not implemented"; | |
| 35 } | 43 } |
| 36 } | 44 } |
| OLD | NEW |