Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1380)

Unified Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.cc

Issue 2652903002: Convert MimeHandlerStreamManager to use the new navigation callbacks. (Closed)
Patch Set: nit Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f28a9004571bf4b8a963d1515c04d0b09e031ef6 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,16 @@ 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())) {
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698