OLD | NEW |
---|---|
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 "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 !pending_entry->is_renderer_initiated(); | 258 !pending_entry->is_renderer_initiated(); |
259 if (!has_browser_initiated_pending_entry && !is_error_page) { | 259 if (!has_browser_initiated_pending_entry && !is_error_page) { |
260 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( | 260 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry( |
261 controller_->CreateNavigationEntry(validated_url, | 261 controller_->CreateNavigationEntry(validated_url, |
262 content::Referrer(), | 262 content::Referrer(), |
263 ui::PAGE_TRANSITION_LINK, | 263 ui::PAGE_TRANSITION_LINK, |
264 true /* is_renderer_initiated */, | 264 true /* is_renderer_initiated */, |
265 std::string(), | 265 std::string(), |
266 controller_->GetBrowserContext())); | 266 controller_->GetBrowserContext())); |
267 entry->set_site_instance( | 267 entry->set_site_instance( |
268 static_cast<SiteInstanceImpl*>( | 268 static_cast<SiteInstanceImpl*>(render_frame_host->GetSiteInstance())); |
Charlie Reis
2015/02/04 20:37:14
We can drop the static_cast here. (Co-variant ret
nasko
2015/02/04 20:42:44
Ah, good point!
| |
269 render_frame_host->render_view_host()->GetSiteInstance())); | |
270 // TODO(creis): If there's a pending entry already, find a safe way to | 269 // TODO(creis): If there's a pending entry already, find a safe way to |
271 // update it instead of replacing it and copying over things like this. | 270 // update it instead of replacing it and copying over things like this. |
272 if (pending_entry) { | 271 if (pending_entry) { |
273 entry->set_transferred_global_request_id( | 272 entry->set_transferred_global_request_id( |
274 pending_entry->transferred_global_request_id()); | 273 pending_entry->transferred_global_request_id()); |
275 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 274 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
276 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 275 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
277 } | 276 } |
278 controller_->SetPendingEntry(entry); | 277 controller_->SetPendingEntry(entry); |
279 if (delegate_) | 278 if (delegate_) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
561 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 560 FrameTreeNode* frame = render_frame_host->frame_tree_node(); |
562 frame->render_manager()->DidNavigateFrame( | 561 frame->render_manager()->DidNavigateFrame( |
563 render_frame_host, params.gesture == NavigationGestureUser); | 562 render_frame_host, params.gesture == NavigationGestureUser); |
564 } | 563 } |
565 | 564 |
566 // Update the site of the SiteInstance if it doesn't have one yet, unless | 565 // Update the site of the SiteInstance if it doesn't have one yet, unless |
567 // assigning a site is not necessary for this URL. In that case, the | 566 // assigning a site is not necessary for this URL. In that case, the |
568 // SiteInstance can still be considered unused until a navigation to a real | 567 // SiteInstance can still be considered unused until a navigation to a real |
569 // page. | 568 // page. |
570 SiteInstanceImpl* site_instance = | 569 SiteInstanceImpl* site_instance = |
571 static_cast<SiteInstanceImpl*>(render_frame_host->GetSiteInstance()); | 570 static_cast<SiteInstanceImpl*>(render_frame_host->GetSiteInstance()); |
Charlie Reis
2015/02/04 20:37:14
Let's drop the cast here as well.
nasko
2015/02/04 20:42:44
Done.
| |
572 if (!site_instance->HasSite() && | 571 if (!site_instance->HasSite() && |
573 ShouldAssignSiteForURL(params.url)) { | 572 ShouldAssignSiteForURL(params.url)) { |
574 site_instance->SetSite(params.url); | 573 site_instance->SetSite(params.url); |
575 } | 574 } |
576 | 575 |
577 // Need to update MIME type here because it's referred to in | 576 // Need to update MIME type here because it's referred to in |
578 // UpdateNavigationCommands() called by RendererDidNavigate() to | 577 // UpdateNavigationCommands() called by RendererDidNavigate() to |
579 // determine whether or not to enable the encoding menu. | 578 // determine whether or not to enable the encoding menu. |
580 // It's updated only for the main frame. For a subframe, | 579 // It's updated only for the main frame. For a subframe, |
581 // RenderView::UpdateURL does not set params.contents_mime_type. | 580 // RenderView::UpdateURL does not set params.contents_mime_type. |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
981 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 980 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
982 time_to_commit); | 981 time_to_commit); |
983 UMA_HISTOGRAM_TIMES( | 982 UMA_HISTOGRAM_TIMES( |
984 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 983 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
985 time_to_network); | 984 time_to_network); |
986 } | 985 } |
987 navigation_data_.reset(); | 986 navigation_data_.reset(); |
988 } | 987 } |
989 | 988 |
990 } // namespace content | 989 } // namespace content |
OLD | NEW |