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

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: Address comments from creis on patch set 43. Created 6 years, 8 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 // Set the redirect chain to the navigation's redirects, unless we are
109 // returning to a completed navigation (whose previous redirects don't apply).
110 if (PageTransitionIsNewNavigation(params->transition)) {
111 params->redirects = entry.GetRedirectChain();
112 } else {
113 params->redirects = std::vector<GURL>();
114 }
109 115
110 params->can_load_local_resources = entry.GetCanLoadLocalResources(); 116 params->can_load_local_resources = entry.GetCanLoadLocalResources();
111 params->frame_to_navigate = entry.GetFrameToNavigate(); 117 params->frame_to_navigate = entry.GetFrameToNavigate();
112 } 118 }
113 119
114 } // namespace 120 } // namespace
115 121
116 122
117 NavigatorImpl::NavigatorImpl( 123 NavigatorImpl::NavigatorImpl(
118 NavigationControllerImpl* navigation_controller, 124 NavigationControllerImpl* navigation_controller,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 controller_->GetBrowserContext())); 167 controller_->GetBrowserContext()));
162 entry->set_site_instance( 168 entry->set_site_instance(
163 static_cast<SiteInstanceImpl*>( 169 static_cast<SiteInstanceImpl*>(
164 render_frame_host->render_view_host()->GetSiteInstance())); 170 render_frame_host->render_view_host()->GetSiteInstance()));
165 // TODO(creis): If there's a pending entry already, find a safe way to 171 // 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. 172 // update it instead of replacing it and copying over things like this.
167 if (pending_entry) { 173 if (pending_entry) {
168 entry->set_transferred_global_request_id( 174 entry->set_transferred_global_request_id(
169 pending_entry->transferred_global_request_id()); 175 pending_entry->transferred_global_request_id());
170 entry->set_should_replace_entry(pending_entry->should_replace_entry()); 176 entry->set_should_replace_entry(pending_entry->should_replace_entry());
171 entry->set_redirect_chain(pending_entry->redirect_chain()); 177 entry->SetRedirectChain(pending_entry->GetRedirectChain());
172 } 178 }
173 controller_->SetPendingEntry(entry); 179 controller_->SetPendingEntry(entry);
174 if (delegate_) 180 if (delegate_)
175 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 181 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
176 } 182 }
177 } 183 }
178 184
179 if (delegate_) { 185 if (delegate_) {
180 // Notify the observer about the start of the provisional load. 186 // Notify the observer about the start of the provisional load.
181 delegate_->DidStartProvisionalLoad( 187 delegate_->DidStartProvisionalLoad(
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 // still be used for a normal web site. 533 // still be used for a normal web site.
528 if (url == GURL(kAboutBlankURL)) 534 if (url == GURL(kAboutBlankURL))
529 return false; 535 return false;
530 536
531 // The embedder will then have the opportunity to determine if the URL 537 // The embedder will then have the opportunity to determine if the URL
532 // should "use up" the SiteInstance. 538 // should "use up" the SiteInstance.
533 return GetContentClient()->browser()->ShouldAssignSiteForURL(url); 539 return GetContentClient()->browser()->ShouldAssignSiteForURL(url);
534 } 540 }
535 541
536 } // namespace content 542 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698