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

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

Issue 2310363002: Persist offline page info in a navigation entry if needed (Closed)
Patch Set: Add missing new file 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_driver.h
diff --git a/components/sessions/core/serialized_navigation_driver.h b/components/sessions/core/serialized_navigation_driver.h
index 5fc261e4a95c5915f0c3dc2fef55beb33ad14352..c4e6ea6a646e63ccbb62f3a1650c4d5d8e05ce3c 100644
--- a/components/sessions/core/serialized_navigation_driver.h
+++ b/components/sessions/core/serialized_navigation_driver.h
@@ -5,12 +5,19 @@
#ifndef COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_DRIVER_H_
#define COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_DRIVER_H_
+#include <map>
+#include <memory>
#include <string>
#include "components/sessions/core/sessions_export.h"
+namespace content {
+class NavigationEntry;
+}
+
namespace sessions {
+class ExtendedInfoHandler;
class SerializedNavigationEntry;
// The SerializedNavigationDriver interface allows SerializedNavigationEntry to
@@ -50,6 +57,18 @@ class SESSIONS_EXPORT SerializedNavigationDriver {
// Removes the referrer from the encoded page state.
virtual std::string StripReferrerFromPageState(
const std::string& page_state) const = 0;
+
+ // Registers a handler that is used to read and write the extended
+ // info stored in SerializedNavigationEntry.
+ virtual void RegisterExtendedInfoHandler(
sky 2016/09/28 00:22:00 Can you clarify why you want to add these function
+ const std::string& key,
+ std::unique_ptr<ExtendedInfoHandler> handler) = 0;
+
+ using ExtendedInfoHandlerMap =
+ std::map<std::string, std::unique_ptr<ExtendedInfoHandler>>;
+
+ // Returns all the registered handlers to deal with the extended info.
+ virtual const ExtendedInfoHandlerMap& GetAllExtendedInfoHandlers() const = 0;
};
} // namespace sessions
« no previous file with comments | « components/sessions/content/extended_info_handler.h ('k') | components/sessions/core/serialized_navigation_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698