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

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

Issue 2331343005: PlzNavigate: Get StreamPrivate API to work. (Closed)
Patch Set: Pass the frame_tree_node_id, render_frame_id and render_process_id parameters to the MimeHandlerStr… 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..41faa3280ea9835755f7d4127d5c58f3a839a02d 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,
+ 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)
@@ -719,12 +721,21 @@ void ChromeResourceDispatcherHostDelegate::OnStreamCreated(
stream_target_info_.find(request);
CHECK(ix != stream_target_info_.end());
bool embedded = info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME;
+ // TODO(ananta)
+ // We are passing in the frame_tree_node_id which only makes sense in the
+ // PlzNavigate case and the render_frame_id and render_process_id which makes
+ // sense in the non PlzNavigate case.
+ // We need to remove the render_frame_id and render_process_id parameters
+ // when PlzNavigate is enabled by default.
jam 2016/09/17 00:10:07 ditto: even with plznavigate, i believe the RFIDs
ananta 2016/09/17 00:23:27 Thanks. Removed the comment.
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