Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/loader/loader_io_thread_notifier.h" | 5 #include "content/browser/loader/loader_io_thread_notifier.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/render_frame_host_impl.h" | 7 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 8 #include "content/browser/loader/global_routing_id.h" | 8 #include "content/browser/loader/global_routing_id.h" |
| 9 #include "content/browser/loader/loader_globals.h" | |
| 9 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 10 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 10 #include "content/public/browser/browser_thread.h" | |
|
jam
2017/03/29 15:44:32
this file isn't going to move, since it's using Re
ananta
2017/03/29 19:41:04
Thanks. done
| |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 void NotifyRenderFrameDeletedOnIO(const GlobalFrameRoutingId& id) { | 16 void NotifyRenderFrameDeletedOnIO(const GlobalFrameRoutingId& id) { |
| 17 ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get(); | 17 ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get(); |
| 18 if (rdhi) | 18 if (rdhi) |
| 19 rdhi->OnRenderFrameDeleted(id); | 19 rdhi->OnRenderFrameDeleted(id); |
| 20 } | 20 } |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 LoaderIOThreadNotifier::LoaderIOThreadNotifier(WebContents* web_contents) | 24 LoaderIOThreadNotifier::LoaderIOThreadNotifier(WebContents* web_contents) |
| 25 : WebContentsObserver(web_contents) {} | 25 : WebContentsObserver(web_contents) {} |
| 26 | 26 |
| 27 LoaderIOThreadNotifier::~LoaderIOThreadNotifier() {} | 27 LoaderIOThreadNotifier::~LoaderIOThreadNotifier() {} |
| 28 | 28 |
| 29 void LoaderIOThreadNotifier::RenderFrameDeleted( | 29 void LoaderIOThreadNotifier::RenderFrameDeleted( |
| 30 RenderFrameHost* render_frame_host) { | 30 RenderFrameHost* render_frame_host) { |
| 31 BrowserThread::PostTask( | 31 LoaderGlobals::Get()->io_thread_task_runner()->PostTask( |
| 32 BrowserThread::IO, FROM_HERE, | 32 FROM_HERE, base::Bind(&NotifyRenderFrameDeletedOnIO, |
| 33 base::Bind(&NotifyRenderFrameDeletedOnIO, | 33 static_cast<RenderFrameHostImpl*>(render_frame_host) |
| 34 static_cast<RenderFrameHostImpl*>(render_frame_host) | 34 ->GetGlobalFrameRoutingId())); |
| 35 ->GetGlobalFrameRoutingId())); | |
| 36 } | 35 } |
| 37 | 36 |
| 38 } // namespace content | 37 } // namespace content |
| OLD | NEW |