Chromium Code Reviews| 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)); |
|
nasko
2016/11/09 01:41:01
Is the URL in the state indeed "about:srcdoc"?
arthursonzogni
2016/11/09 09:23:13
Yes, because the FrameState has been built coming
|
| + 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( |