1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_DRIVER_H_
6 #define COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_DRIVER_H_
10 #include "components/sessions/sessions_export.h"
13 class SerializedNavigationEntry
;
15 // The SerializedNavigationDriver interface allows SerializedNavigationEntry to
16 // obtain information from a singleton driver object. A concrete implementation
17 // must be provided by the driver on each platform.
18 class SESSIONS_EXPORT_PRIVATE SerializedNavigationDriver
{
20 virtual ~SerializedNavigationDriver() {}
22 // Returns the singleton SerializedNavigationDriver.
23 static SerializedNavigationDriver
* Get();
25 // Returns the default referrer policy.
26 virtual int GetDefaultReferrerPolicy() const = 0;
28 // Returns a sanitized version of the given |navigation|'s encoded_page_state
29 // suitable for writing to disk.
30 virtual std::string
GetSanitizedPageStateForPickle(
31 const SerializedNavigationEntry
* navigation
) const = 0;
33 // Sanitizes the data in the given |navigation| to be more robust against
34 // faulty data written by older versions.
35 virtual void Sanitize(SerializedNavigationEntry
* navigation
) const = 0;
38 } // namespace sessions
40 #endif // COMPONENTS_SESSIONS_CORE_SERIALIZED_NAVIGATION_DRIVER_H_