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

Unified Diff: content/browser/loader/loader_io_thread_notifier.cc

Issue 2197763002: Move LoaderIOThreadNotifier out of resource_dispatcher_host_impl.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move definition Created 4 years, 5 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/loader/loader_io_thread_notifier.cc
diff --git a/content/browser/loader/loader_io_thread_notifier.cc b/content/browser/loader/loader_io_thread_notifier.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a10537c9d3d342714e9245ce6628915cf3343176
--- /dev/null
+++ b/content/browser/loader/loader_io_thread_notifier.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/loader/loader_io_thread_notifier.h"
+
+#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/loader/global_routing_id.h"
+#include "content/browser/loader/resource_dispatcher_host_impl.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace content {
+
+namespace {
+
+void NotifyRenderFrameDeletedOnIO(const GlobalFrameRoutingId& id) {
+ ResourceDispatcherHostImpl* rdhi = ResourceDispatcherHostImpl::Get();
+ if (rdhi)
+ rdhi->OnRenderFrameDeleted(id);
+}
+
+} // namespace
+
+LoaderIOThreadNotifier::LoaderIOThreadNotifier(WebContents* web_contents)
+ : WebContentsObserver(web_contents) {}
+
+LoaderIOThreadNotifier::~LoaderIOThreadNotifier() {}
+
+void LoaderIOThreadNotifier::RenderFrameDeleted(
+ RenderFrameHost* render_frame_host) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&NotifyRenderFrameDeletedOnIO,
+ static_cast<RenderFrameHostImpl*>(render_frame_host)
+ ->GetGlobalFrameRoutingId()));
+}
+
+} // namespace content
« no previous file with comments | « content/browser/loader/loader_io_thread_notifier.h ('k') | content/browser/loader/resource_dispatcher_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698