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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 101573003: Add the navigation redirect-chain to Sync sessions proto for offline analysis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: routine rebase Created 6 years, 9 months 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/frame_host/frame_tree.h" 8 #include "content/browser/frame_host/frame_tree.h"
9 #include "content/browser/frame_host/frame_tree_node.h" 9 #include "content/browser/frame_host/frame_tree_node.h"
10 #include "content/browser/frame_host/navigation_controller_impl.h" 10 #include "content/browser/frame_host/navigation_controller_impl.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Avoid downloading when in view-source mode. 98 // Avoid downloading when in view-source mode.
99 params->allow_download = !entry.IsViewSourceMode(); 99 params->allow_download = !entry.IsViewSourceMode();
100 params->is_post = entry.GetHasPostData(); 100 params->is_post = entry.GetHasPostData();
101 if (entry.GetBrowserInitiatedPostData()) { 101 if (entry.GetBrowserInitiatedPostData()) {
102 params->browser_initiated_post_data.assign( 102 params->browser_initiated_post_data.assign(
103 entry.GetBrowserInitiatedPostData()->front(), 103 entry.GetBrowserInitiatedPostData()->front(),
104 entry.GetBrowserInitiatedPostData()->front() + 104 entry.GetBrowserInitiatedPostData()->front() +
105 entry.GetBrowserInitiatedPostData()->size()); 105 entry.GetBrowserInitiatedPostData()->size());
106 } 106 }
107 107
108 params->redirects = entry.redirect_chain(); 108 // We no longer clear redirects in the navigation entry upon commit, so
brettw 2014/03/27 22:16:22 This comment only makes sense in the context of th
donnd 2014/03/28 03:11:38 I should have known better than to write a non-dur
109 // we need to clear them when returning to a previously committed navigation.
110 // Those cases are reload and forward/back.
111 bool is_transition_reload = PageTransitionCoreTypeIs(
112 params->transition, content::PAGE_TRANSITION_RELOAD);
113 bool is_transition_forward_back = PageTransitionIsForwardBack(
114 params->transition);
115 if (is_transition_forward_back || is_transition_reload) {
116 params->redirects = std::vector<GURL>();
brettw 2014/03/27 22:16:22 Actually, I'm curious why you need to not send the
donnd 2014/03/28 03:11:38 No, the old behavior was to preserve the redirects
117 } else {
118 params->redirects = entry.GetRedirectChain();
119 }
109 120
110 params->can_load_local_resources = entry.GetCanLoadLocalResources(); 121 params->can_load_local_resources = entry.GetCanLoadLocalResources();
111 params->frame_to_navigate = entry.GetFrameToNavigate(); 122 params->frame_to_navigate = entry.GetFrameToNavigate();
112 } 123 }
113 124
114 } // namespace 125 } // namespace
115 126
116 127
117 NavigatorImpl::NavigatorImpl( 128 NavigatorImpl::NavigatorImpl(
118 NavigationControllerImpl* navigation_controller, 129 NavigationControllerImpl* navigation_controller,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 controller_->GetBrowserContext())); 172 controller_->GetBrowserContext()));
162 entry->set_site_instance( 173 entry->set_site_instance(
163 static_cast<SiteInstanceImpl*>( 174 static_cast<SiteInstanceImpl*>(
164 render_frame_host->render_view_host()->GetSiteInstance())); 175 render_frame_host->render_view_host()->GetSiteInstance()));
165 // TODO(creis): If there's a pending entry already, find a safe way to 176 // TODO(creis): If there's a pending entry already, find a safe way to
166 // update it instead of replacing it and copying over things like this. 177 // update it instead of replacing it and copying over things like this.
167 if (pending_entry) { 178 if (pending_entry) {
168 entry->set_transferred_global_request_id( 179 entry->set_transferred_global_request_id(
169 pending_entry->transferred_global_request_id()); 180 pending_entry->transferred_global_request_id());
170 entry->set_should_replace_entry(pending_entry->should_replace_entry()); 181 entry->set_should_replace_entry(pending_entry->should_replace_entry());
171 entry->set_redirect_chain(pending_entry->redirect_chain()); 182 entry->SetRedirectChain(pending_entry->GetRedirectChain());
172 } 183 }
173 controller_->SetPendingEntry(entry); 184 controller_->SetPendingEntry(entry);
174 if (delegate_) 185 if (delegate_)
175 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 186 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
176 } 187 }
177 } 188 }
178 189
179 if (delegate_) { 190 if (delegate_) {
180 // Notify the observer about the start of the provisional load. 191 // Notify the observer about the start of the provisional load.
181 delegate_->DidStartProvisionalLoad( 192 delegate_->DidStartProvisionalLoad(
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 // still be used for a normal web site. 538 // still be used for a normal web site.
528 if (url == GURL(kAboutBlankURL)) 539 if (url == GURL(kAboutBlankURL))
529 return false; 540 return false;
530 541
531 // The embedder will then have the opportunity to determine if the URL 542 // The embedder will then have the opportunity to determine if the URL
532 // should "use up" the SiteInstance. 543 // should "use up" the SiteInstance.
533 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); 544 return GetContentClient()->browser()->ShouldAssignSiteForURL(url);
534 } 545 }
535 546
536 } // namespace content 547 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/public/browser/navigation_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698