12345678910111213141516171819202122232425262728293031323334 |
- // Copyright 2020 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #ifndef WEBLAYER_BROWSER_PERSISTENCE_MINIMAL_BROWSER_PERSISTER_H_
- #define WEBLAYER_BROWSER_PERSISTENCE_MINIMAL_BROWSER_PERSISTER_H_
- #include <stddef.h>
- #include <vector>
- namespace weblayer {
- class BrowserImpl;
- // Returns a byte array that can later be used to restore the state (Tabs and
- // navigations) of a Browser. This does not store the full state, only a
- // minimal state. For example, it may not include all tabs or all navigations.
- // |max_navigations_per_tab| is the max number of navigations to persist per
- // tab. Depending upon space requirements, the max number of navigations may not
- // be honored. |max_size_in_bytes| is provided for tests and allows specifying
- // the max. A value of 0 means use the default max.
- std::vector<uint8_t> PersistMinimalState(BrowserImpl* browser,
- int max_navigations_per_tab = 0,
- int max_size_in_bytes = 0);
- // Restores the state previously created via PersistMinimalState(). When
- // done this ensures |browser| has at least one tab.
- void RestoreMinimalStateForBrowser(BrowserImpl* browser,
- const std::vector<uint8_t>& value);
- } // namespace weblayer
- #endif // WEBLAYER_BROWSER_PERSISTENCE_MINIMAL_BROWSER_PERSISTER_H_
|