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

Unified Diff: content/renderer/history_serialization.cc

Issue 1415603018: OOPIF: Support session restore by combining/splitting frame states. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up and fix bugs Created 5 years 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
« no previous file with comments | « content/renderer/history_serialization.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/history_serialization.cc
diff --git a/content/renderer/history_serialization.cc b/content/renderer/history_serialization.cc
index d015cf29c99bc1d1f1586974738f51c0dd98bef3..e2c41d12b48177d9481f2694ffb1c0fa9ee98e5b 100644
--- a/content/renderer/history_serialization.cc
+++ b/content/renderer/history_serialization.cc
@@ -5,6 +5,7 @@
#include "content/renderer/history_serialization.h"
#include "content/common/page_state_serialization.h"
+#include "content/common/site_isolation_policy.h"
#include "content/public/common/page_state.h"
#include "content/renderer/history_entry.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
@@ -172,6 +173,8 @@ void RecursivelyGenerateHistoryItem(const ExplodedFrameState& state,
} // namespace
PageState HistoryEntryToPageState(HistoryEntry* entry) {
+ DCHECK(!SiteIsolationPolicy::UseSubframeNavigationEntries());
+
ExplodedPageState state;
RecursivelyGenerateFrameState(entry->root_history_node(), &state.top,
&state.referenced_files);
@@ -184,6 +187,8 @@ PageState HistoryEntryToPageState(HistoryEntry* entry) {
}
PageState SingleHistoryItemToPageState(const WebHistoryItem& item) {
+ DCHECK(!SiteIsolationPolicy::UseSubframeNavigationEntries());
+
ExplodedPageState state;
ToNullableString16Vector(item.getReferencedFilePaths(),
&state.referenced_files);
@@ -197,6 +202,8 @@ PageState SingleHistoryItemToPageState(const WebHistoryItem& item) {
}
scoped_ptr<HistoryEntry> PageStateToHistoryEntry(const PageState& page_state) {
+ DCHECK(!SiteIsolationPolicy::UseSubframeNavigationEntries());
+
ExplodedPageState state;
if (!DecodePageState(page_state.ToEncodedData(), &state))
return scoped_ptr<HistoryEntry>();
@@ -207,4 +214,21 @@ scoped_ptr<HistoryEntry> PageStateToHistoryEntry(const PageState& page_state) {
return entry.Pass();
}
+ExplodedFrameState HistoryItemToFrameState(const WebHistoryItem& item) {
+ DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
+
+ // TODO(creis): We're missing the list of referenced_files.
+ ExplodedFrameState state;
+ GenerateFrameStateFromItem(item, &state);
+ return state;
+}
+
+WebHistoryItem FrameStateToHistoryItem(const ExplodedFrameState& state) {
+ DCHECK(SiteIsolationPolicy::UseSubframeNavigationEntries());
+
+ scoped_ptr<HistoryEntry> entry(new HistoryEntry());
+ RecursivelyGenerateHistoryItem(state, entry->root_history_node());
+ return entry->root_history_node()->item();
+}
+
} // namespace content
« no previous file with comments | « content/renderer/history_serialization.h ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698