Index: components/sessions/content/content_serialized_navigation_driver.h |
diff --git a/components/sessions/content/content_serialized_navigation_driver.h b/components/sessions/content/content_serialized_navigation_driver.h |
index c0911d70e87bd0f102fc689703f557e2349bb382..a471738f33930721bcfc8720ee7899f51e16b79a 100644 |
--- a/components/sessions/content/content_serialized_navigation_driver.h |
+++ b/components/sessions/content/content_serialized_navigation_driver.h |
@@ -7,6 +7,12 @@ |
#include "components/sessions/core/serialized_navigation_driver.h" |
+#include <map> |
+#include <memory> |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "components/sessions/content/extended_info_handler.h" |
#include "components/sessions/core/sessions_export.h" |
namespace base { |
@@ -38,9 +44,27 @@ class SESSIONS_EXPORT ContentSerializedNavigationDriver |
std::string StripReferrerFromPageState( |
const std::string& page_state) const override; |
+ // Registers a handler that is used to read and write the extended |
+ // info stored in SerializedNavigationEntry. As part of serialization |key| |
+ // is written to disk, as such once a handler is registered it should always |
+ // be registered to the same key. |
+ void RegisterExtendedInfoHandler( |
+ const std::string& key, |
+ std::unique_ptr<ExtendedInfoHandler> handler); |
+ |
+ using ExtendedInfoHandlerMap = |
+ std::map<std::string, std::unique_ptr<ExtendedInfoHandler>>; |
+ |
+ // Returns all the registered handlers to deal with the extended info. |
+ const ExtendedInfoHandlerMap& GetAllExtendedInfoHandlers() const; |
+ |
private: |
ContentSerializedNavigationDriver(); |
friend struct base::DefaultSingletonTraits<ContentSerializedNavigationDriver>; |
+ |
+ ExtendedInfoHandlerMap extended_info_handler_map_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ContentSerializedNavigationDriver); |
}; |
} // namespace sessions |