Chromium Code Reviews| 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..3a07cc00fe83b62debd3f964f459e96a50cdf606 100644 |
| --- a/components/sessions/content/content_serialized_navigation_driver.h |
| +++ b/components/sessions/content/content_serialized_navigation_driver.h |
| @@ -7,6 +7,8 @@ |
| #include "components/sessions/core/serialized_navigation_driver.h" |
| +#include <map> |
| + |
| #include "components/sessions/core/sessions_export.h" |
| namespace base { |
| @@ -15,6 +17,8 @@ template <typename T> struct DefaultSingletonTraits; |
| namespace sessions { |
| +class ExtendedInfoHandler; |
| + |
| // Provides an implementation of SerializedNavigationDriver that is backed by |
| // content classes. |
| class SESSIONS_EXPORT ContentSerializedNavigationDriver |
| @@ -38,9 +42,23 @@ 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. |
|
sky
2016/09/29 03:08:19
Also add 'As part of serialization |key| is writte
jianli
2016/09/29 22:02:29
Done.
|
| + 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_; |
| }; |
| } // namespace sessions |