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

Side by Side Diff: content/public/browser/loader_io_thread_notifier.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: cleanup 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/callback.h"
6 #include "content/browser/frame_host/render_frame_host_impl.h"
7 #include "content/browser/loader/global_routing_id.h"
8 #include "content/browser/loader/resource_dispatcher_host_impl.h"
9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/loader_io_thread_notifier.h"
11
12 namespace content {
13
14 namespace {
15
16 void NotifyForFrameOnIO(
17 base::Callback<void(ResourceDispatcherHostImpl*,
18 const GlobalFrameRoutingId&)> frame_callback,
19 const GlobalFrameRoutingId& routing_id) {
20 DCHECK_CURRENTLY_ON(BrowserThread::IO);
21 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
22 if (rdh)
23 frame_callback.Run(rdh, routing_id);
24 }
25
26 } // namespace
27
28 // static
29 void LoaderIOThreadNotifier::BlockRequestsForFrame(
30 RenderFrameHost* frame_host) {
31 BrowserThread::PostTask(
32 BrowserThread::IO, FROM_HERE,
33 base::Bind(&NotifyForFrameOnIO,
34 base::Bind(&ResourceDispatcherHostImpl::BlockRequestsForFrame),
35 static_cast<RenderFrameHostImpl*>(frame_host)
36 ->GetGlobalFrameRoutingId()));
37 }
38
39 void LoaderIOThreadNotifier::ResumeBlockedRequestsForFrame(
40 RenderFrameHost* frame_host) {
41 BrowserThread::PostTask(
42 BrowserThread::IO, FROM_HERE,
43 base::Bind(
44 &NotifyForFrameOnIO,
45 base::Bind(
46 &ResourceDispatcherHostImpl::ResumeBlockedRequestsForFrame),
47 static_cast<RenderFrameHostImpl*>(frame_host)
48 ->GetGlobalFrameRoutingId()));
49 }
50
51 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698