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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
500 } | 500 } |
501 | 501 |
502 FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); | 502 FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); |
503 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); | 503 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); |
504 bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( | 504 bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( |
505 switches::kSitePerProcess); | 505 switches::kSitePerProcess); |
506 | 506 |
507 if (use_site_per_process) { | 507 if (use_site_per_process) { |
508 // TODO(creis): Until we mirror the frame tree in the subframe's process, | 508 // TODO(creis): Until we mirror the frame tree in the subframe's process, |
509 // cross-process subframe navigations happen in a renderer's main frame. | 509 // cross-process subframe navigations happen in a renderer's main frame. |
510 // Correct the transition type here if we know it is for a subframe. | 510 // Correct the transition type here if we know it is for a subframe, but it |
511 // doesn't have a subframe transition type. | |
511 NavigationEntryImpl* pending_entry = | 512 NavigationEntryImpl* pending_entry = |
512 NavigationEntryImpl::FromNavigationEntry( | 513 NavigationEntryImpl::FromNavigationEntry( |
513 controller_->GetPendingEntry()); | 514 controller_->GetPendingEntry()); |
514 if (!render_frame_host->frame_tree_node()->IsMainFrame() && | 515 if (!render_frame_host->frame_tree_node()->IsMainFrame() && |
516 params.transition != ui::PAGE_TRANSITION_AUTO_SUBFRAME && | |
517 params.transition != ui::PAGE_TRANSITION_MANUAL_SUBFRAME && | |
515 pending_entry && | 518 pending_entry && |
516 pending_entry->frame_tree_node_id() == | 519 pending_entry->frame_tree_node_id() == |
517 render_frame_host->frame_tree_node()->frame_tree_node_id()) { | 520 render_frame_host->frame_tree_node()->frame_tree_node_id()) { |
518 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; | 521 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; |
519 } | 522 } |
520 } | 523 } |
Avi (use Gerrit)
2015/02/02 20:59:36
My question is whether this block is useful any mo
Avi (use Gerrit)
2015/02/02 21:06:21
What I mean is, in the NavigationControllerBrowser
Charlie Reis
2015/02/02 21:24:29
Yes! I'm pretty sure that your render_frame_impl.
| |
521 | 524 |
522 if (ui::PageTransitionIsMainFrame(params.transition)) { | 525 if (ui::PageTransitionIsMainFrame(params.transition)) { |
523 if (delegate_) { | 526 if (delegate_) { |
524 // When overscroll navigation gesture is enabled, a screenshot of the page | 527 // When overscroll navigation gesture is enabled, a screenshot of the page |
525 // in its current state is taken so that it can be used during the | 528 // in its current state is taken so that it can be used during the |
526 // nav-gesture. It is necessary to take the screenshot here, before | 529 // nav-gesture. It is necessary to take the screenshot here, before |
527 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can | 530 // calling RenderFrameHostManager::DidNavigateMainFrame, because that can |
528 // change WebContents::GetRenderViewHost to return the new host, instead | 531 // change WebContents::GetRenderViewHost to return the new host, instead |
529 // of the one that may have just been swapped out. | 532 // of the one that may have just been swapped out. |
530 if (delegate_->CanOverscrollContent()) { | 533 if (delegate_->CanOverscrollContent()) { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
981 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 984 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
982 time_to_commit); | 985 time_to_commit); |
983 UMA_HISTOGRAM_TIMES( | 986 UMA_HISTOGRAM_TIMES( |
984 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 987 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
985 time_to_network); | 988 time_to_network); |
986 } | 989 } |
987 navigation_data_.reset(); | 990 navigation_data_.reset(); |
988 } | 991 } |
989 | 992 |
990 } // namespace content | 993 } // namespace content |
OLD | NEW |