| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_ | 5 #ifndef COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_ |
| 6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_ | 6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Returns the singleton ContentSerializedNavigationDriver. Almost all | 30 // Returns the singleton ContentSerializedNavigationDriver. Almost all |
| 31 // callers should use SerializedNavigationDriver::Get() instead. | 31 // callers should use SerializedNavigationDriver::Get() instead. |
| 32 static ContentSerializedNavigationDriver* GetInstance(); | 32 static ContentSerializedNavigationDriver* GetInstance(); |
| 33 | 33 |
| 34 // Allows an embedder to override the instance returned by GetInstance(). | 34 // Allows an embedder to override the instance returned by GetInstance(). |
| 35 static void SetInstance(ContentSerializedNavigationDriver* instance); | 35 static void SetInstance(ContentSerializedNavigationDriver* instance); |
| 36 | 36 |
| 37 // SerializedNavigationDriver implementation. | 37 // SerializedNavigationDriver implementation. |
| 38 int GetDefaultReferrerPolicy() const override; | 38 int GetDefaultReferrerPolicy() const override; |
| 39 bool MapReferrerPolicyToOldValues(int referrer_policy, | |
| 40 int* mapped_referrer_policy) const override; | |
| 41 bool MapReferrerPolicyToNewValues(int referrer_policy, | |
| 42 int* mapped_referrer_policy) const override; | |
| 43 std::string GetSanitizedPageStateForPickle( | 39 std::string GetSanitizedPageStateForPickle( |
| 44 const SerializedNavigationEntry* navigation) const override; | 40 const SerializedNavigationEntry* navigation) const override; |
| 45 void Sanitize(SerializedNavigationEntry* navigation) const override; | 41 void Sanitize(SerializedNavigationEntry* navigation) const override; |
| 46 std::string StripReferrerFromPageState( | 42 std::string StripReferrerFromPageState( |
| 47 const std::string& page_state) const override; | 43 const std::string& page_state) const override; |
| 48 | 44 |
| 49 // Registers a handler that is used to read and write the extended | 45 // Registers a handler that is used to read and write the extended |
| 50 // info stored in SerializedNavigationEntry. As part of serialization |key| | 46 // info stored in SerializedNavigationEntry. As part of serialization |key| |
| 51 // is written to disk, as such once a handler is registered it should always | 47 // is written to disk, as such once a handler is registered it should always |
| 52 // be registered to the same key. | 48 // be registered to the same key. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 friend class ContentSerializedNavigationBuilderTest; | 64 friend class ContentSerializedNavigationBuilderTest; |
| 69 | 65 |
| 70 ExtendedInfoHandlerMap extended_info_handler_map_; | 66 ExtendedInfoHandlerMap extended_info_handler_map_; |
| 71 | 67 |
| 72 DISALLOW_COPY_AND_ASSIGN(ContentSerializedNavigationDriver); | 68 DISALLOW_COPY_AND_ASSIGN(ContentSerializedNavigationDriver); |
| 73 }; | 69 }; |
| 74 | 70 |
| 75 } // namespace sessions | 71 } // namespace sessions |
| 76 | 72 |
| 77 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_ | 73 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_ |
| OLD | NEW |