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

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

Issue 1009993002: PlzNavigate: destroy the speculative RFH on renderer-initiated navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 "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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 // ongoing request b) which is browser or user-initiated and c) the renderer 643 // ongoing request b) which is browser or user-initiated and c) the renderer
644 // request is not user-initiated. 644 // request is not user-initiated.
645 if (ongoing_navigation_request && 645 if (ongoing_navigation_request &&
646 (ongoing_navigation_request->browser_initiated() || 646 (ongoing_navigation_request->browser_initiated() ||
647 ongoing_navigation_request->begin_params().has_user_gesture) && 647 ongoing_navigation_request->begin_params().has_user_gesture) &&
648 !begin_params.has_user_gesture) { 648 !begin_params.has_user_gesture) {
649 return; 649 return;
650 } 650 }
651 651
652 // In all other cases the current navigation, if any, is canceled and a new 652 // In all other cases the current navigation, if any, is canceled and a new
653 // NavigationRequest is created and stored in the map. Actual cancellation 653 // NavigationRequest is created and stored in the map.
654 // happens when the existing request map entry is replaced and destroyed. 654 if (ongoing_navigation_request)
655 CancelNavigation(frame_tree_node);
nasko 2015/03/16 18:48:37 nit: Blank line after this new CancelNavigation ca
carlosk 2015/03/17 14:42:59 Don't we need to do the same in NavigatorImpl::Req
clamy 2015/03/18 13:55:55 Done.
clamy 2015/03/18 13:55:55 Done.
655 scoped_ptr<NavigationRequest> navigation_request = 656 scoped_ptr<NavigationRequest> navigation_request =
656 NavigationRequest::CreateRendererInitiated( 657 NavigationRequest::CreateRendererInitiated(
657 frame_tree_node, common_params, begin_params, body, 658 frame_tree_node, common_params, begin_params, body,
658 controller_->GetLastCommittedEntryIndex(), 659 controller_->GetLastCommittedEntryIndex(),
659 controller_->GetEntryCount()); 660 controller_->GetEntryCount());
660 navigation_request_map_.set( 661 navigation_request_map_.set(
661 frame_tree_node->frame_tree_node_id(), navigation_request.Pass()); 662 frame_tree_node->frame_tree_node_id(), navigation_request.Pass());
662 663
663 if (frame_tree_node->IsMainFrame()) 664 if (frame_tree_node->IsMainFrame())
664 navigation_data_.reset(); 665 navigation_data_.reset();
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", 867 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted",
867 time_to_commit); 868 time_to_commit);
868 UMA_HISTOGRAM_TIMES( 869 UMA_HISTOGRAM_TIMES(
869 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", 870 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted",
870 time_to_network); 871 time_to_network);
871 } 872 }
872 navigation_data_.reset(); 873 navigation_data_.reset();
873 } 874 }
874 875
875 } // namespace content 876 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698