| 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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoad, | 559 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoad, |
| 560 OnDidStartProvisionalLoad) | 560 OnDidStartProvisionalLoad) |
| 561 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, | 561 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, |
| 562 OnDidFailProvisionalLoadWithError) | 562 OnDidFailProvisionalLoadWithError) |
| 563 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, | 563 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, |
| 564 OnDidFailLoadWithError) | 564 OnDidFailLoadWithError) |
| 565 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, | 565 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, |
| 566 OnDidCommitProvisionalLoad(msg)) | 566 OnDidCommitProvisionalLoad(msg)) |
| 567 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateState, OnUpdateState) | 567 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateState, OnUpdateState) |
| 568 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) | 568 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) |
| 569 IPC_MESSAGE_HANDLER(FrameHostMsg_CancelInitialHistoryLoad, |
| 570 OnCancelInitialHistoryLoad) |
| 569 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, | 571 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, |
| 570 OnDocumentOnLoadCompleted) | 572 OnDocumentOnLoadCompleted) |
| 571 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) | 573 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) |
| 572 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) | 574 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) |
| 573 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) | 575 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) |
| 574 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, | 576 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, |
| 575 OnJavaScriptExecuteResponse) | 577 OnJavaScriptExecuteResponse) |
| 576 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, | 578 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, |
| 577 OnVisualStateResponse) | 579 OnVisualStateResponse) |
| 578 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, | 580 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 // on the frame's unique name. If this can't be found, fall back to the | 967 // on the frame's unique name. If this can't be found, fall back to the |
| 966 // default params using OpenURL below. | 968 // default params using OpenURL below. |
| 967 if (frame_tree_node_->navigator()->NavigateNewChildFrame( | 969 if (frame_tree_node_->navigator()->NavigateNewChildFrame( |
| 968 this, params.frame_unique_name)) | 970 this, params.frame_unique_name)) |
| 969 return; | 971 return; |
| 970 } | 972 } |
| 971 | 973 |
| 972 OpenURL(params, GetSiteInstance()); | 974 OpenURL(params, GetSiteInstance()); |
| 973 } | 975 } |
| 974 | 976 |
| 977 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() { |
| 978 // A Javascript navigation interrupted the initial history load. Check if an |
| 979 // initial subframe cross-process navigation needs to be canceled as a result. |
| 980 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate. |
| 981 if (GetParent() && !frame_tree_node_->has_committed_real_load() && |
| 982 frame_tree_node_->render_manager()->pending_frame_host()) { |
| 983 frame_tree_node_->render_manager()->CancelPending(); |
| 984 } |
| 985 } |
| 986 |
| 975 void RenderFrameHostImpl::OnDocumentOnLoadCompleted( | 987 void RenderFrameHostImpl::OnDocumentOnLoadCompleted( |
| 976 FrameMsg_UILoadMetricsReportType::Value report_type, | 988 FrameMsg_UILoadMetricsReportType::Value report_type, |
| 977 base::TimeTicks ui_timestamp) { | 989 base::TimeTicks ui_timestamp) { |
| 978 if (report_type == FrameMsg_UILoadMetricsReportType::REPORT_LINK) { | 990 if (report_type == FrameMsg_UILoadMetricsReportType::REPORT_LINK) { |
| 979 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Link", | 991 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Link", |
| 980 base::TimeTicks::Now() - ui_timestamp, | 992 base::TimeTicks::Now() - ui_timestamp, |
| 981 base::TimeDelta::FromMilliseconds(10), | 993 base::TimeDelta::FromMilliseconds(10), |
| 982 base::TimeDelta::FromMinutes(10), 100); | 994 base::TimeDelta::FromMinutes(10), 100); |
| 983 } else if (report_type == FrameMsg_UILoadMetricsReportType::REPORT_INTENT) { | 995 } else if (report_type == FrameMsg_UILoadMetricsReportType::REPORT_INTENT) { |
| 984 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", | 996 UMA_HISTOGRAM_CUSTOM_TIMES("Navigation.UI_OnLoadComplete.Intent", |
| (...skipping 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3024 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 3036 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 3025 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 3037 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 3026 return web_bluetooth_service_.get(); | 3038 return web_bluetooth_service_.get(); |
| 3027 } | 3039 } |
| 3028 | 3040 |
| 3029 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 3041 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 3030 web_bluetooth_service_.reset(); | 3042 web_bluetooth_service_.reset(); |
| 3031 } | 3043 } |
| 3032 | 3044 |
| 3033 } // namespace content | 3045 } // namespace content |
| OLD | NEW |