* @param {!Window} win A window object. * @param {Window=} hostWindow The host window to send messages to. If not set * then we'll broadcast our messages to all parent windows and choose the * first one with a valid response to be the host window.
(win, hostWindow)
| 20 | * first one with a valid response to be the host window. |
| 21 | */ |
| 22 | constructor(win, hostWindow) { |
| 23 | /** @private {!Window} */ |
| 24 | this.win_ = win; |
| 25 | /** @private {?string} */ |
| 26 | this.rtvVersion_ = getMode().rtvVersion || null; |
| 27 | /** @private {?Window} */ |
| 28 | this.hostWindow_ = hostWindow || null; |
| 29 | /** @private {?string} */ |
| 30 | this.sentinel_ = null; |
| 31 | /** @type {number} */ |
| 32 | this.nextMessageId_ = 1; |
| 33 | /** |
| 34 | * Map messageType keys to observables to be fired when messages of that |
| 35 | * type are received. |
| 36 | * @private {!Object} |
| 37 | */ |
| 38 | this.observableFor_ = map(); |
| 39 | this.setupEventListener_(); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Retrieves data from host. |
nothing calls this directly
no test coverage detected