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

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

Issue 2418963002: Don't abort the MimeHandlerStreamManager stream if we receive a RenderProcessHostChanged notificati… (Closed)
Patch Set: Add a check for whether the routing id and the pid of the old host is the same as the pair in Embed… Created 4 years, 2 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 | « content/browser/web_contents/web_contents_impl.cc ('k') | 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 14be1c7762699760fae7bfabe71af93be7601945..f281e21d232a4503bf523343859d0eb646cd6042 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
@@ -232,6 +232,17 @@ void MimeHandlerStreamManager::EmbedderObserver::DidStartNavigation(
void MimeHandlerStreamManager::EmbedderObserver::RenderFrameHostChanged(
content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) {
+ // If the old_host is null, then it means that a subframe is being created.
+ // Don't treat this like a host change.
+ if (!old_host)
+ return;
+
+ // If this is an unrelated host, ignore.
+ if ((old_host->GetRoutingID() != render_frame_id_) ||
+ (old_host->GetProcess()->GetID() != render_process_id_)) {
+ return;
+ }
+
new_host_ = new_host;
// Update the RFID, RPIDs to those of the new RFH. This ensures
// that if the new RFH gets deleted before loading the stream, we will
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698