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

Side by Side Diff: content/browser/frame_host/navigator_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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 entry = NavigationEntryImpl::FromNavigationEntry( 885 entry = NavigationEntryImpl::FromNavigationEntry(
886 controller_->CreateNavigationEntry( 886 controller_->CreateNavigationEntry(
887 GURL(url::kAboutBlankURL), referrer_to_use, page_transition, 887 GURL(url::kAboutBlankURL), referrer_to_use, page_transition,
888 is_renderer_initiated, extra_headers, 888 is_renderer_initiated, extra_headers,
889 controller_->GetBrowserContext())); 889 controller_->GetBrowserContext()));
890 } 890 }
891 entry->AddOrUpdateFrameEntry( 891 entry->AddOrUpdateFrameEntry(
892 node, -1, -1, nullptr, 892 node, -1, -1, nullptr,
893 static_cast<SiteInstanceImpl*>(source_site_instance), 893 static_cast<SiteInstanceImpl*>(source_site_instance),
894 dest_url, referrer_to_use, redirect_chain, PageState(), method, 894 dest_url, referrer_to_use, redirect_chain, PageState(), method,
895 -1); 895 -1, false);
896 } else { 896 } else {
897 // Main frame case. 897 // Main frame case.
898 entry = NavigationEntryImpl::FromNavigationEntry( 898 entry = NavigationEntryImpl::FromNavigationEntry(
899 controller_->CreateNavigationEntry( 899 controller_->CreateNavigationEntry(
900 dest_url, referrer_to_use, page_transition, is_renderer_initiated, 900 dest_url, referrer_to_use, page_transition, is_renderer_initiated,
901 extra_headers, controller_->GetBrowserContext())); 901 extra_headers, controller_->GetBrowserContext()));
902 entry->root_node()->frame_entry->set_source_site_instance( 902 entry->root_node()->frame_entry->set_source_site_instance(
903 static_cast<SiteInstanceImpl*>(source_site_instance)); 903 static_cast<SiteInstanceImpl*>(source_site_instance));
904 entry->SetRedirectChain(redirect_chain); 904 entry->SetRedirectChain(redirect_chain);
905 } 905 }
(...skipping 12 matching lines...) Expand all
918 // We may not have successfully added the FrameNavigationEntry to |entry| 918 // We may not have successfully added the FrameNavigationEntry to |entry|
919 // above (per https://crbug.com/608402), in which case we create it from 919 // above (per https://crbug.com/608402), in which case we create it from
920 // scratch. This works because we do not depend on |frame_entry| being inside 920 // scratch. This works because we do not depend on |frame_entry| being inside
921 // |entry| during NavigateToEntry. This will go away when we shortcut this 921 // |entry| during NavigateToEntry. This will go away when we shortcut this
922 // further in https://crbug.com/536906. 922 // further in https://crbug.com/536906.
923 scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node)); 923 scoped_refptr<FrameNavigationEntry> frame_entry(entry->GetFrameEntry(node));
924 if (!frame_entry) { 924 if (!frame_entry) {
925 frame_entry = new FrameNavigationEntry( 925 frame_entry = new FrameNavigationEntry(
926 node->unique_name(), -1, -1, nullptr, 926 node->unique_name(), -1, -1, nullptr,
927 static_cast<SiteInstanceImpl*>(source_site_instance), dest_url, 927 static_cast<SiteInstanceImpl*>(source_site_instance), dest_url,
928 referrer_to_use, method, -1); 928 referrer_to_use, method, -1, false);
929 } 929 }
930 NavigateToEntry(node, *frame_entry, *entry.get(), ReloadType::NONE, false, 930 NavigateToEntry(node, *frame_entry, *entry.get(), ReloadType::NONE, false,
931 false, false, post_body); 931 false, false, post_body);
932 } 932 }
933 933
934 // PlzNavigate 934 // PlzNavigate
935 void NavigatorImpl::OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, 935 void NavigatorImpl::OnBeforeUnloadACK(FrameTreeNode* frame_tree_node,
936 bool proceed) { 936 bool proceed) {
937 CHECK(IsBrowserSideNavigationEnabled()); 937 CHECK(IsBrowserSideNavigationEnabled());
938 DCHECK(frame_tree_node); 938 DCHECK(frame_tree_node);
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 if (navigation_handle) 1277 if (navigation_handle)
1278 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1278 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1279 1279
1280 controller_->SetPendingEntry(std::move(entry)); 1280 controller_->SetPendingEntry(std::move(entry));
1281 if (delegate_) 1281 if (delegate_)
1282 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1282 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1283 } 1283 }
1284 } 1284 }
1285 1285
1286 } // namespace content 1286 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/test/data/navigation_controller/page_with_srcdoc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698