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

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

Issue 761013003: PlzNavigate: add support in several navigation controller unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the functions to the TestRenderFrameHost Created 6 years 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 RequestNavigationParams request_params(entry.GetHasPostData(), 879 RequestNavigationParams request_params(entry.GetHasPostData(),
880 entry.extra_headers(), 880 entry.extra_headers(),
881 entry.GetBrowserInitiatedPostData()); 881 entry.GetBrowserInitiatedPostData());
882 // TODO(clamy): Check if navigations are blocked and if so store the 882 // TODO(clamy): Check if navigations are blocked and if so store the
883 // parameters. 883 // parameters.
884 884
885 // If there is an ongoing request, replace it. 885 // If there is an ongoing request, replace it.
886 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); 886 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass());
887 887
888 if (frame_tree_node->current_frame_host()->IsRenderFrameLive()) { 888 if (frame_tree_node->current_frame_host()->IsRenderFrameLive()) {
889 NavigationRequest* request_to_send =
890 navigation_request_map_.get(frame_tree_node_id);
889 frame_tree_node->current_frame_host()->Send(new FrameMsg_RequestNavigation( 891 frame_tree_node->current_frame_host()->Send(new FrameMsg_RequestNavigation(
890 frame_tree_node->current_frame_host()->GetRoutingID(), 892 frame_tree_node->current_frame_host()->GetRoutingID(),
891 navigation_request_map_.get(frame_tree_node_id)->common_params(), 893 request_to_send->common_params(), request_params));
892 request_params)); 894 request_to_send->SetWaitingForRendererResponse();
893 return true; 895 return true;
894 } 896 }
895 897
896 // The navigation request is sent directly to the IO thread. 898 // The navigation request is sent directly to the IO thread.
897 OnBeginNavigation( 899 OnBeginNavigation(
898 frame_tree_node, 900 frame_tree_node,
899 MakeDefaultBeginNavigation(request_params, navigation_type), 901 MakeDefaultBeginNavigation(request_params, navigation_type),
900 navigation_request_map_.get(frame_tree_node_id)->common_params()); 902 navigation_request_map_.get(frame_tree_node_id)->common_params());
901 return true; 903 return true;
902 } 904 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", 950 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted",
949 time_to_commit); 951 time_to_commit);
950 UMA_HISTOGRAM_TIMES( 952 UMA_HISTOGRAM_TIMES(
951 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", 953 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted",
952 time_to_network); 954 time_to_network);
953 } 955 }
954 navigation_data_.reset(); 956 navigation_data_.reset();
955 } 957 }
956 958
957 } // namespace content 959 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698