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

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: Fix win compiling error due to using unique_ptr map in SESSIONS_EXPORT class 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..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

Powered by Google App Engine
This is Rietveld 408576698