| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 "content/browser/loader/loader_io_thread_notifier.h" |
| 6 |
| 7 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 8 #include "content/browser/loader/global_routing_id.h" |
| 9 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 10 #include "content/public/browser/browser_thread.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 namespace { |
| 15 |
| 16 void NotifyRenderFrameDeletedOnIO(const GlobalFrameRoutingId& id) { |
| 17 ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get(); |
| 18 if (rdhi) |
| 19 rdhi->OnRenderFrameDeleted(id); |
| 20 } |
| 21 |
| 22 } // namespace |
| 23 |
| 24 LoaderIOThreadNotifier::LoaderIOThreadNotifier(WebContents* web_contents) |
| 25 : WebContentsObserver(web_contents) {} |
| 26 |
| 27 LoaderIOThreadNotifier::~LoaderIOThreadNotifier() {} |
| 28 |
| 29 void LoaderIOThreadNotifier::RenderFrameDeleted( |
| 30 RenderFrameHost* render_frame_host) { |
| 31 BrowserThread::PostTask( |
| 32 BrowserThread::IO, FROM_HERE, |
| 33 base::Bind(&NotifyRenderFrameDeletedOnIO, |
| 34 static_cast<RenderFrameHostImpl*>(render_frame_host) |
| 35 ->GetGlobalFrameRoutingId())); |
| 36 } |
| 37 |
| 38 } // namespace content |
| OLD | NEW |