code: function () {
                  this._removeOldStates();
                  ariaUtilsEvent.removeListener(window, "unload", this._saveStateCB);
                  this._storage.setItem(this._STORAGE_KEY, stateMemory);
                  this._storage.$dispose();
                  this._storage = null;
              }
docs: Save the states that are still valid and needed in order to support page refresh and external navigation.
  Called on window unload.
  @private