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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 2331343005: PlzNavigate: Get StreamPrivate API to work. (Closed)
Patch Set: Use WCO::RenderFrameHostChanged to detect the case when a RFH is swapped out for another in the Emb… Created 4 years, 3 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
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index bc8d974c05a46b49907bab0b74e34a4ce9f95984..8a6b269c38ab13514f0ff4347fed17715c05a18c 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -181,15 +181,16 @@ void UpdatePrerenderNetworkBytesCallback(content::WebContents* web_contents,
void SendExecuteMimeTypeHandlerEvent(
std::unique_ptr<content::StreamInfo> stream,
int64_t expected_content_size,
- int render_process_id,
- int render_frame_id,
const std::string& extension_id,
const std::string& view_id,
- bool embedded) {
+ bool embedded,
+ const ResourceRequestInfo::WebContentsGetter& web_contents_getter,
jam 2016/09/20 21:29:35 it seems redundant passing both this and FTNID and
ananta 2016/09/21 05:26:32 Added a static getter to get the WebContents assoc
+ int frame_tree_node_id,
+ int render_process_id,
+ int render_frame_id) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- content::WebContents* web_contents =
- tab_util::GetWebContentsByFrameID(render_process_id, render_frame_id);
+ content::WebContents* web_contents = web_contents_getter.Run();
if (!web_contents)
return;
@@ -210,7 +211,8 @@ void SendExecuteMimeTypeHandlerEvent(
return;
streams_private->ExecuteMimeTypeHandler(
extension_id, web_contents, std::move(stream), view_id,
- expected_content_size, embedded, render_process_id, render_frame_id);
+ expected_content_size, embedded, frame_tree_node_id, render_process_id,
+ render_frame_id);
}
#endif // !defined(ENABLE_EXTENSIONS)
@@ -722,9 +724,11 @@ void ChromeResourceDispatcherHostDelegate::OnStreamCreated(
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
- request->GetExpectedContentSize(), info->GetChildID(),
- info->GetRenderFrameID(), ix->second.extension_id,
- ix->second.view_id, embedded));
+ request->GetExpectedContentSize(), ix->second.extension_id,
+ ix->second.view_id, embedded,
+ info->GetWebContentsGetterForRequest(),
+ info->GetFrameTreeNodeId(), info->GetChildID(),
+ info->GetRenderFrameID()));
stream_target_info_.erase(request);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698