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

Unified Diff: content/renderer/history_serialization.cc

Issue 805563003: Track referenced files of subframes in PageState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change file_path to file Created 6 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/common/page_state_serialization.h ('k') | content/test/data/file_input_subframe.html » ('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 7a8167bcfa01980e0e6432e2c403035eea49588e..04460aa7c5e5f45fcec378dd0ff8b9c398027c7e 100644
--- a/content/renderer/history_serialization.cc
+++ b/content/renderer/history_serialization.cc
@@ -26,7 +26,7 @@ namespace {
void ToNullableString16Vector(const WebVector<WebString>& input,
std::vector<base::NullableString16>* output) {
- output->reserve(input.size());
+ output->reserve(output->size() + input.size());
for (size_t i = 0; i < input.size(); ++i)
output->push_back(input[i]);
}
@@ -114,14 +114,20 @@ void GenerateFrameStateFromItem(const WebHistoryItem& item,
}
}
-void RecursivelyGenerateFrameState(HistoryEntry::HistoryNode* node,
- ExplodedFrameState* state) {
+void RecursivelyGenerateFrameState(
+ HistoryEntry::HistoryNode* node,
+ ExplodedFrameState* state,
+ std::vector<base::NullableString16>* referenced_files) {
GenerateFrameStateFromItem(node->item(), state);
+ ToNullableString16Vector(node->item().getReferencedFilePaths(),
+ referenced_files);
std::vector<HistoryEntry::HistoryNode*>& children = node->children();
state->children.resize(children.size());
- for (size_t i = 0; i < children.size(); ++i)
- RecursivelyGenerateFrameState(children[i], &state->children[i]);
+ for (size_t i = 0; i < children.size(); ++i) {
+ RecursivelyGenerateFrameState(children[i], &state->children[i],
+ referenced_files);
+ }
}
void RecursivelyGenerateHistoryItem(const ExplodedFrameState& state,
@@ -169,10 +175,8 @@ void RecursivelyGenerateHistoryItem(const ExplodedFrameState& state,
PageState HistoryEntryToPageState(HistoryEntry* entry) {
ExplodedPageState state;
- ToNullableString16Vector(entry->root().getReferencedFilePaths(),
- &state.referenced_files);
-
- RecursivelyGenerateFrameState(entry->root_history_node(), &state.top);
+ RecursivelyGenerateFrameState(entry->root_history_node(), &state.top,
+ &state.referenced_files);
std::string encoded_data;
if (!EncodePageState(state, &encoded_data))
« no previous file with comments | « content/common/page_state_serialization.h ('k') | content/test/data/file_input_subframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698