Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: components/sessions/core/serialized_navigation_entry.h

Issue 2310363002: Persist offline page info in a navigation entry if needed (Closed)
Patch Set: Add extended info support Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sessions/core/serialized_navigation_entry.h
diff --git a/components/sessions/core/serialized_navigation_entry.h b/components/sessions/core/serialized_navigation_entry.h
index cc3b53d0f29df4d1cca140c959c8aa9b0c3f112e..666738b1e96c83db1f597b048d76bc4c1028dfd8 100644
--- a/components/sessions/core/serialized_navigation_entry.h
+++ b/components/sessions/core/serialized_navigation_entry.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <map>
#include <memory>
#include <set>
#include <string>
@@ -123,6 +124,10 @@ class SESSIONS_EXPORT SerializedNavigationEntry {
}
const std::vector<GURL>& redirect_chain() const { return redirect_chain_; }
+ const std::map<std::string, std::string>& extended_info_map() const {
+ return extended_info_map_;
+ }
+
private:
friend class ContentSerializedNavigationBuilder;
friend class ContentSerializedNavigationDriver;
@@ -156,6 +161,14 @@ class SESSIONS_EXPORT SerializedNavigationEntry {
BlockedState blocked_state_;
PasswordState password_state_;
std::set<std::string> content_pack_categories_;
+
+ // The map that tracks all the extended info that need to be persisted, but
+ // would want to avoid the core session restore to know about the details.
+ // The consumer should implement the ExtendedInfoHandler interface and calls
+ // SerializedNavigationDriver::RegisterExtendedInfoHandler to register it.
+ // Note that all the map data are not synced since the only one added now does
+ // not need it.
+ std::map<std::string, std::string> extended_info_map_;
};
} // namespace sessions

Powered by Google App Engine
This is Rietveld 408576698