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

Unified Diff: content/browser/frame_host/navigation_entry_impl.cc

Issue 2482873002: Add is_srcdoc to FrameNavigationEntry and restore about::srcdoc URL. (Closed)
Patch Set: Addressed comments (@nasko) Created 4 years, 1 month 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/browser/frame_host/navigation_entry_impl.h ('k') | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_entry_impl.cc
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index b450e8ec3ae6cf7ba5397ba32c8053193cd522e2..cc9eb7145fd9c26e11e587c395b71087a12548a5 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -45,12 +45,15 @@ void RecursivelyGenerateFrameEntries(
const ExplodedFrameState& state,
const std::vector<base::NullableString16>& referenced_files,
NavigationEntryImpl::TreeNode* node) {
+ GURL renderer_url(state.url_string.string());
+ bool is_srcdoc = (renderer_url == GURL(content::kAboutSrcDocURL));
+ GURL browser_url = is_srcdoc ? GURL(url::kAboutBlankURL) : renderer_url;
+
node->frame_entry = new FrameNavigationEntry(
UTF16ToUTF8(state.target.string()), state.item_sequence_number,
- state.document_sequence_number, nullptr, nullptr,
- GURL(state.url_string.string()),
- Referrer(GURL(state.referrer.string()), state.referrer_policy), "GET",
- -1);
+ state.document_sequence_number, nullptr, nullptr, browser_url,
+ Referrer(GURL(state.referrer.string()), state.referrer_policy), "GET", -1,
+ is_srcdoc);
// Set a single-frame PageState on the entry.
ExplodedPageState page_state;
@@ -260,7 +263,8 @@ NavigationEntryImpl::NavigationEntryImpl(
url,
referrer,
"GET",
- -1))),
+ -1,
+ false))),
unique_id_(GetUniqueIDInConstructor()),
bindings_(kInvalidBindings),
page_type_(PAGE_TYPE_NORMAL),
@@ -798,7 +802,8 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
const std::vector<GURL>& redirect_chain,
const PageState& page_state,
const std::string& method,
- int64_t post_id) {
+ int64_t post_id,
+ bool is_srcdoc) {
// If this is called for the main frame, the FrameNavigationEntry is
// guaranteed to exist, so just update it directly and return.
if (frame_tree_node->IsMainFrame()) {
@@ -812,7 +817,7 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
frame_tree_node->unique_name(), item_sequence_number,
document_sequence_number, site_instance,
std::move(source_site_instance), url, referrer, redirect_chain,
- page_state, method, post_id);
+ page_state, method, post_id, is_srcdoc);
return;
}
@@ -840,7 +845,7 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
child->frame_entry->UpdateEntry(
unique_name, item_sequence_number, document_sequence_number,
site_instance, std::move(source_site_instance), url, referrer,
- redirect_chain, page_state, method, post_id);
+ redirect_chain, page_state, method, post_id, is_srcdoc);
return;
}
}
@@ -851,7 +856,7 @@ void NavigationEntryImpl::AddOrUpdateFrameEntry(
FrameNavigationEntry* frame_entry = new FrameNavigationEntry(
unique_name, item_sequence_number, document_sequence_number,
site_instance, std::move(source_site_instance), url, referrer, method,
- post_id);
+ post_id, is_srcdoc);
frame_entry->SetPageState(page_state);
frame_entry->set_redirect_chain(redirect_chain);
parent_node->children.push_back(
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.h ('k') | content/browser/frame_host/navigation_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698