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

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

Issue 1432583002: Move browser_navigation_start to CommonNavigationParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify changed tests Created 5 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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 // done here either. 1762 // done here either.
1763 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) 1763 if (!common_params.url.SchemeIs(url::kJavaScriptScheme))
1764 frame_tree_node_->DidStartLoading(true); 1764 frame_tree_node_->DidStartLoading(true);
1765 } 1765 }
1766 1766
1767 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { 1767 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) {
1768 DCHECK(data_url.SchemeIs(url::kDataScheme)); 1768 DCHECK(data_url.SchemeIs(url::kDataScheme));
1769 CommonNavigationParams common_params( 1769 CommonNavigationParams common_params(
1770 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, 1770 data_url, Referrer(), ui::PAGE_TRANSITION_LINK,
1771 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), 1771 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(),
1772 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 1772 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF,
1773 LOFI_OFF); 1773 base::TimeTicks::Now());
1774 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1774 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1775 switches::kEnableBrowserSideNavigation)) { 1775 switches::kEnableBrowserSideNavigation)) {
1776 CommitNavigation(nullptr, nullptr, common_params, 1776 CommitNavigation(nullptr, nullptr, common_params,
1777 RequestNavigationParams()); 1777 RequestNavigationParams());
1778 } else { 1778 } else {
1779 Navigate(common_params, StartNavigationParams(), RequestNavigationParams()); 1779 Navigate(common_params, StartNavigationParams(), RequestNavigationParams());
1780 } 1780 }
1781 } 1781 }
1782 1782
1783 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params, 1783 void RenderFrameHostImpl::OpenURL(const FrameHostMsg_OpenURL_Params& params,
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2145 "RenderFrameHostImpl navigation suspended", this); 2145 "RenderFrameHostImpl navigation suspended", this);
2146 } 2146 }
2147 2147
2148 if (!suspend && suspended_nav_params_) { 2148 if (!suspend && suspended_nav_params_) {
2149 // There's navigation message params waiting to be sent. Now that we're not 2149 // There's navigation message params waiting to be sent. Now that we're not
2150 // suspended anymore, resume navigation by sending them. If we were swapped 2150 // suspended anymore, resume navigation by sending them. If we were swapped
2151 // out, we should also stop filtering out the IPC messages now. 2151 // out, we should also stop filtering out the IPC messages now.
2152 SetState(RenderFrameHostImpl::STATE_DEFAULT); 2152 SetState(RenderFrameHostImpl::STATE_DEFAULT);
2153 2153
2154 DCHECK(!proceed_time.is_null()); 2154 DCHECK(!proceed_time.is_null());
2155 suspended_nav_params_->request_params.browser_navigation_start = 2155 // TODO(csharrison) make sure that PlzNavigate and the current architecture
nasko 2015/11/04 18:39:47 nit: Missing ":" after todo.
Charlie Harrison 2015/11/04 21:27:43 Done.
2156 proceed_time; 2156 // measure navigation start in the same way in the presence of the
2157 // BeforeUnload event.
2158 suspended_nav_params_->common_params.navigation_start = proceed_time;
2157 SendNavigateMessage(suspended_nav_params_->common_params, 2159 SendNavigateMessage(suspended_nav_params_->common_params,
2158 suspended_nav_params_->start_params, 2160 suspended_nav_params_->start_params,
2159 suspended_nav_params_->request_params); 2161 suspended_nav_params_->request_params);
2160 suspended_nav_params_.reset(); 2162 suspended_nav_params_.reset();
2161 } 2163 }
2162 } 2164 }
2163 2165
2164 void RenderFrameHostImpl::CancelSuspendedNavigations() { 2166 void RenderFrameHostImpl::CancelSuspendedNavigations() {
2165 // Clear any state if a pending navigation is canceled or preempted. 2167 // Clear any state if a pending navigation is canceled or preempted.
2166 if (suspended_nav_params_) 2168 if (suspended_nav_params_)
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 *dst = src; 2308 *dst = src;
2307 2309
2308 if (src.routing_id != -1) 2310 if (src.routing_id != -1)
2309 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2311 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2310 2312
2311 if (src.parent_routing_id != -1) 2313 if (src.parent_routing_id != -1)
2312 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2314 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2313 } 2315 }
2314 2316
2315 } // namespace content 2317 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698