Chromium Code Reviews| Index: extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc |
| diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc |
| index aa2a7f87c3fb39f89c36ced3af0f55ae848d7e0f..2e223a2aded72a4f07f4f39e9dfe893caf2ab3b2 100644 |
| --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc |
| +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc |
| @@ -84,13 +84,11 @@ class MimeHandlerStreamManager::EmbedderObserver |
| // WebContentsObserver overrides. |
| void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; |
| void RenderProcessGone(base::TerminationStatus status) override; |
| - void DidStartProvisionalLoadForFrame( |
| - content::RenderFrameHost* render_frame_host, |
| - const GURL& validated_url, |
| - bool is_error_page) override; |
| void WebContentsDestroyed() override; |
| void DidStartNavigation( |
| content::NavigationHandle* navigation_handle) override; |
| + void ReadyToCommitNavigation( |
| + content::NavigationHandle* navigation_handle) override; |
| void RenderFrameHostChanged(content::RenderFrameHost* old_host, |
| content::RenderFrameHost* new_host) override; |
| @@ -103,10 +101,9 @@ class MimeHandlerStreamManager::EmbedderObserver |
| int frame_tree_node_id_; |
| int render_process_id_; |
| int render_frame_id_; |
| - // With PlzNavigate we get an initial provisional load notification for the |
| - // URL the mime handler is serving. We don't want to clean up the stream |
| - // here. This field helps us track the first load notification. Defaults |
| - // to true. |
| + // We get an initial load notification for the URL the mime handler is |
| + // serving. We don't want to clean up the stream here. This field helps us |
| + // track the first load notification. Defaults to true. |
| bool initial_load_for_frame_; |
| // If a RFH is swapped with another RFH, this is set to the new RFH. This |
| // ensures that we don't inadvarently clean up the stream when the old RFH |
| @@ -205,15 +202,14 @@ void MimeHandlerStreamManager::EmbedderObserver::RenderProcessGone( |
| AbortStream(); |
| } |
| -void MimeHandlerStreamManager::EmbedderObserver:: |
| - DidStartProvisionalLoadForFrame(content::RenderFrameHost* render_frame_host, |
| - const GURL& validated_url, |
| - bool is_error_page) { |
| - if (!IsTrackedRenderFrameHost(render_frame_host)) |
| +void MimeHandlerStreamManager::EmbedderObserver::ReadyToCommitNavigation( |
| + content::NavigationHandle* navigation_handle) { |
| + if (navigation_handle->IsSamePage() || |
| + !IsTrackedRenderFrameHost(navigation_handle->GetRenderFrameHost())) |
|
lazyboy
2017/01/24 23:22:14
nit: {}
jam
2017/01/24 23:38:39
Done.
|
| return; |
| - // With PlzNavigate we get a provisional load notification for the URL we are |
| - // serving. We don't want to clean up the stream here. |
| - if (initial_load_for_frame_ && content::IsBrowserSideNavigationEnabled()) { |
| + // We get an initial load notification for the URL we are serving. We don't |
| + // want to clean up the stream here. |
| + if (initial_load_for_frame_) { |
| initial_load_for_frame_ = false; |
| return; |
| } |