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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
846 // If there is an ongoing request, replace it. | 846 // If there is an ongoing request, replace it. |
847 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); | 847 navigation_request_map_.set(frame_tree_node_id, navigation_request.Pass()); |
848 | 848 |
849 // Have the current renderer execute its beforeUnload event if needed. If it | 849 // Have the current renderer execute its beforeUnload event if needed. If it |
850 // is not needed (eg. the renderer is not live), BeginNavigation should get | 850 // is not needed (eg. the renderer is not live), BeginNavigation should get |
851 // called. | 851 // called. |
852 NavigationRequest* request_to_send = | 852 NavigationRequest* request_to_send = |
853 navigation_request_map_.get(frame_tree_node_id); | 853 navigation_request_map_.get(frame_tree_node_id); |
854 request_to_send->SetWaitingForRendererResponse(); | 854 request_to_send->SetWaitingForRendererResponse(); |
855 frame_tree_node->current_frame_host()->DispatchBeforeUnload(true); | 855 frame_tree_node->current_frame_host()->DispatchBeforeUnload(true); |
856 | |
857 if (delegate_) | |
858 delegate_->DidStartNavigationToPendingEntry(entry.GetURL(), reload_type); | |
clamy
2015/03/06 13:43:09
Don't forget to remove this :).
carlosk
2015/03/06 15:44:15
Sorry about that. *Really* done now.
| |
856 } | 859 } |
857 | 860 |
858 void NavigatorImpl::BeginNavigation(FrameTreeNode* frame_tree_node) { | 861 void NavigatorImpl::BeginNavigation(FrameTreeNode* frame_tree_node) { |
859 NavigationRequest* navigation_request = | 862 NavigationRequest* navigation_request = |
860 navigation_request_map_.get(frame_tree_node->frame_tree_node_id()); | 863 navigation_request_map_.get(frame_tree_node->frame_tree_node_id()); |
861 | 864 |
862 // A browser-initiated navigation could have been cancelled while it was | 865 // A browser-initiated navigation could have been cancelled while it was |
863 // waiting for the BeforeUnload event to execute. | 866 // waiting for the BeforeUnload event to execute. |
864 if (!navigation_request) | 867 if (!navigation_request) |
865 return; | 868 return; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
921 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 924 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
922 time_to_commit); | 925 time_to_commit); |
923 UMA_HISTOGRAM_TIMES( | 926 UMA_HISTOGRAM_TIMES( |
924 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 927 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
925 time_to_network); | 928 time_to_network); |
926 } | 929 } |
927 navigation_data_.reset(); | 930 navigation_data_.reset(); |
928 } | 931 } |
929 | 932 |
930 } // namespace content | 933 } // namespace content |
OLD | NEW |