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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 583043005: Pending tasks in a message loop should be deleted before shutting down Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gpu_channel_host.cc
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index 77ef8752afc9ffdf8411da6f78b178de32bc3838..83bbad180c0f8a69a7ce558370610748526b6ef8 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -232,6 +232,13 @@ void GpuChannelHost::DestroyCommandBuffer(
delete command_buffer;
}
+void GpuChannelHost::DestroyChannel() {
+ // channel_ must be destroyed on the main thread.
+ if (channel_.get() && !factory_->IsMainThread())
+ factory_->GetMainLoop()->DeleteSoon(FROM_HERE, channel_.release());
+ channel_.reset();
+}
+
void GpuChannelHost::AddRoute(
int route_id, base::WeakPtr<IPC::Listener> listener) {
DCHECK(MessageLoopProxy::current().get());
@@ -311,12 +318,9 @@ int32 GpuChannelHost::GenerateRouteID() {
}
GpuChannelHost::~GpuChannelHost() {
- // channel_ must be destroyed on the main thread.
- if (!factory_->IsMainThread())
- factory_->GetMainLoop()->DeleteSoon(FROM_HERE, channel_.release());
+ DestroyChannel();
}
-
GpuChannelHost::MessageFilter::MessageFilter()
: lost_(false) {
}
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698