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 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 RequestNavigationParams request_params(entry.GetHasPostData(), | 891 RequestNavigationParams request_params(entry.GetHasPostData(), |
892 entry.extra_headers(), | 892 entry.extra_headers(), |
893 entry.GetBrowserInitiatedPostData()); | 893 entry.GetBrowserInitiatedPostData()); |
894 // TODO(clamy): Check if navigations are blocked and if so store the | 894 // TODO(clamy): Check if navigations are blocked and if so store the |
895 // parameters. | 895 // parameters. |
896 | 896 |
897 // If there is an ongoing request, replace it. | 897 // If there is an ongoing request, replace it. |
898 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); | 898 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); |
899 | 899 |
900 if (frame_tree_node->current_frame_host()->IsRenderFrameLive()) { | 900 if (frame_tree_node->current_frame_host()->IsRenderFrameLive()) { |
| 901 NavigationRequest* request_to_send = |
| 902 navigation_request_map_.get(frame_tree_node_id); |
901 frame_tree_node->current_frame_host()->Send(new FrameMsg_RequestNavigation( | 903 frame_tree_node->current_frame_host()->Send(new FrameMsg_RequestNavigation( |
902 frame_tree_node->current_frame_host()->GetRoutingID(), | 904 frame_tree_node->current_frame_host()->GetRoutingID(), |
903 navigation_request_map_.get(frame_tree_node_id)->common_params(), | 905 request_to_send->common_params(), request_params)); |
904 request_params)); | 906 request_to_send->SetWaitingForRendererResponse(); |
905 return true; | 907 return true; |
906 } | 908 } |
907 | 909 |
908 // The navigation request is sent directly to the IO thread. | 910 // The navigation request is sent directly to the IO thread. |
909 OnBeginNavigation( | 911 OnBeginNavigation( |
910 frame_tree_node, | 912 frame_tree_node, |
911 MakeDefaultBeginNavigation(request_params, navigation_type), | 913 MakeDefaultBeginNavigation(request_params, navigation_type), |
912 navigation_request_map_.get(frame_tree_node_id)->common_params()); | 914 navigation_request_map_.get(frame_tree_node_id)->common_params()); |
913 return true; | 915 return true; |
914 } | 916 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 962 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
961 time_to_commit); | 963 time_to_commit); |
962 UMA_HISTOGRAM_TIMES( | 964 UMA_HISTOGRAM_TIMES( |
963 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 965 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
964 time_to_network); | 966 time_to_network); |
965 } | 967 } |
966 navigation_data_.reset(); | 968 navigation_data_.reset(); |
967 } | 969 } |
968 | 970 |
969 } // namespace content | 971 } // namespace content |
OLD | NEW |