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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 RequestNavigationParams request_params(entry.GetHasPostData(), | 876 RequestNavigationParams request_params(entry.GetHasPostData(), |
877 entry.extra_headers(), | 877 entry.extra_headers(), |
878 entry.GetBrowserInitiatedPostData()); | 878 entry.GetBrowserInitiatedPostData()); |
879 // TODO(clamy): Check if navigations are blocked and if so store the | 879 // TODO(clamy): Check if navigations are blocked and if so store the |
880 // parameters. | 880 // parameters. |
881 | 881 |
882 // If there is an ongoing request, replace it. | 882 // If there is an ongoing request, replace it. |
883 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); | 883 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); |
884 | 884 |
885 if (frame_tree_node->current_frame_host()->IsRenderFrameLive()) { | 885 if (frame_tree_node->current_frame_host()->IsRenderFrameLive()) { |
| 886 NavigationRequest* request_to_send = |
| 887 navigation_request_map_.get(frame_tree_node_id); |
886 frame_tree_node->current_frame_host()->Send(new FrameMsg_RequestNavigation( | 888 frame_tree_node->current_frame_host()->Send(new FrameMsg_RequestNavigation( |
887 frame_tree_node->current_frame_host()->GetRoutingID(), | 889 frame_tree_node->current_frame_host()->GetRoutingID(), |
888 navigation_request_map_.get(frame_tree_node_id)->common_params(), | 890 request_to_send->common_params(), request_params)); |
889 request_params)); | 891 request_to_send->SetWaitingForRendererResponse(); |
890 return true; | 892 return true; |
891 } | 893 } |
892 | 894 |
893 // The navigation request is sent directly to the IO thread. | 895 // The navigation request is sent directly to the IO thread. |
894 OnBeginNavigation( | 896 OnBeginNavigation( |
895 frame_tree_node, | 897 frame_tree_node, |
896 MakeDefaultBeginNavigation(request_params, navigation_type), | 898 MakeDefaultBeginNavigation(request_params, navigation_type), |
897 navigation_request_map_.get(frame_tree_node_id)->common_params()); | 899 navigation_request_map_.get(frame_tree_node_id)->common_params()); |
898 return true; | 900 return true; |
899 } | 901 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 947 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
946 time_to_commit); | 948 time_to_commit); |
947 UMA_HISTOGRAM_TIMES( | 949 UMA_HISTOGRAM_TIMES( |
948 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 950 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
949 time_to_network); | 951 time_to_network); |
950 } | 952 } |
951 navigation_data_.reset(); | 953 navigation_data_.reset(); |
952 } | 954 } |
953 | 955 |
954 } // namespace content | 956 } // namespace content |
OLD | NEW |