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

Unified Diff: content/browser/frame_host/interstitial_page_impl.cc

Issue 1542743002: [RDHI] Refactored blocked_loaders_map_ to key by render frame route id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko nit Created 4 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
Index: content/browser/frame_host/interstitial_page_impl.cc
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc
index 251e3bc642fd0178581478cb5dd30f2144fd38f0..1ad4907bda546a2f637cfe9f7be0ad4eddbcecfc 100644
--- a/content/browser/frame_host/interstitial_page_impl.cc
+++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -53,28 +53,6 @@ using blink::WebDragOperation;
using blink::WebDragOperationsMask;
namespace content {
-namespace {
-
-void ResourceRequestHelper(ResourceDispatcherHostImpl* rdh,
- int process_id,
- int render_view_host_id,
- ResourceRequestAction action) {
- switch (action) {
- case BLOCK:
- rdh->BlockRequestsForRoute(process_id, render_view_host_id);
- break;
- case RESUME:
- rdh->ResumeBlockedRequestsForRoute(process_id, render_view_host_id);
- break;
- case CANCEL:
- rdh->CancelBlockedRequestsForRoute(process_id, render_view_host_id);
- break;
- default:
- NOTREACHED();
- }
-}
-
-} // namespace
class InterstitialPageImpl::InterstitialPageRVHDelegateView
: public RenderViewHostDelegateView {
@@ -855,22 +833,25 @@ void InterstitialPageImpl::TakeActionOnResourceDispatcher(
// The tab might not have a render_view_host if it was closed (in which case,
// we have taken care of the blocked requests when processing
// NOTIFY_RENDER_WIDGET_HOST_DESTROYED.
- // Also we need to test there is a ResourceDispatcherHostImpl, as when unit-
- // tests we don't have one.
RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(original_child_id_,
original_rvh_id_);
- if (!rvh || !ResourceDispatcherHostImpl::Get())
+ if (!rvh)
return;
- BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- base::Bind(
- &ResourceRequestHelper,
- ResourceDispatcherHostImpl::Get(),
- original_child_id_,
- original_rvh_id_,
- action));
+ RenderFrameHostImpl* rfh =
+ static_cast<RenderFrameHostImpl*>(rvh->GetMainFrame());
+ switch (action) {
+ case BLOCK:
+ ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh);
+ break;
+ case RESUME:
+ ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI(rfh);
+ break;
+ default:
+ DCHECK_EQ(action, CANCEL);
+ ResourceDispatcherHostImpl::CancelBlockedRequestsForFrameFromUI(rfh);
+ break;
+ }
}
void InterstitialPageImpl::OnDomOperationResponse(

Powered by Google App Engine
This is Rietveld 408576698