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

Unified Diff: components/sessions/content/content_serialized_navigation_driver.h

Issue 2310363002: Persist offline page info in a navigation entry if needed (Closed)
Patch Set: Update 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/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

Powered by Google App Engine
This is Rietveld 408576698