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

Side by Side Diff: components/sessions/content/content_serialized_navigation_driver.cc

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, 2 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 unified diff | Download patch
OLDNEW
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 #include "components/sessions/content/content_serialized_navigation_driver.h" 5 #include "components/sessions/content/content_serialized_navigation_driver.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "components/sessions/core/serialized_navigation_entry.h" 9 #include "components/sessions/core/serialized_navigation_entry.h"
10 #include "content/public/common/page_state.h" 10 #include "content/public/common/page_state.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 #endif // defined(OS_ANDROID) 126 #endif // defined(OS_ANDROID)
127 } 127 }
128 128
129 std::string ContentSerializedNavigationDriver::StripReferrerFromPageState( 129 std::string ContentSerializedNavigationDriver::StripReferrerFromPageState(
130 const std::string& page_state) const { 130 const std::string& page_state) const {
131 return content::PageState::CreateFromEncodedData(page_state) 131 return content::PageState::CreateFromEncodedData(page_state)
132 .RemoveReferrer() 132 .RemoveReferrer()
133 .ToEncodedData(); 133 .ToEncodedData();
134 } 134 }
135 135
136 void ContentSerializedNavigationDriver::RegisterExtendedInfoHandler(
137 const std::string& key,
138 std::unique_ptr<ExtendedInfoHandler> handler) {
139 DCHECK(!key.empty());
140 DCHECK(!extended_info_handler_map_.count(key));
141 DCHECK(handler.get());
142 extended_info_handler_map_[key] = std::move(handler);
143 }
144
145 const ContentSerializedNavigationDriver::ExtendedInfoHandlerMap&
146 ContentSerializedNavigationDriver::GetAllExtendedInfoHandlers() const {
147 return extended_info_handler_map_;
148 }
149
136 } // namespace sessions 150 } // namespace sessions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698