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

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

Issue 2331343005: PlzNavigate: Get StreamPrivate API to work. (Closed)
Patch Set: 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..499fdbe46c0f18c87d22d237e32b871357e15e19 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -64,6 +64,7 @@
#include "content/public/browser/service_worker_context.h"
#include "content/public/browser/stream_info.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/resource_response.h"
#include "net/base/load_flags.h"
#include "net/base/load_timing_info.h"
@@ -185,11 +186,17 @@ void SendExecuteMimeTypeHandlerEvent(
int render_frame_id,
const std::string& extension_id,
const std::string& view_id,
- bool embedded) {
+ bool embedded,
+ const ResourceRequestInfo::WebContentsGetter& web_contents_getter) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- content::WebContents* web_contents =
- tab_util::GetWebContentsByFrameID(render_process_id, render_frame_id);
+ content::WebContents* web_contents = nullptr;
+ if (content::IsBrowserSideNavigationEnabled()) {
+ web_contents = web_contents_getter.Run();
+ } else {
+ web_contents =
+ tab_util::GetWebContentsByFrameID(render_process_id, render_frame_id);
+ }
if (!web_contents)
return;
@@ -724,7 +731,8 @@ void ChromeResourceDispatcherHostDelegate::OnStreamCreated(
base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream),
request->GetExpectedContentSize(), info->GetChildID(),
info->GetRenderFrameID(), ix->second.extension_id,
- ix->second.view_id, embedded));
+ ix->second.view_id, embedded,
+ info->GetWebContentsGetterForRequest()));
jam 2016/09/14 22:49:52 ditto: let's just pass only the WC getter
ananta 2016/09/15 01:49:16 Done.
stream_target_info_.erase(request);
#endif
}

Powered by Google App Engine
This is Rietveld 408576698