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

Unified Diff: content/child/child_thread_impl.cc

Issue 2159123002: Shutdown renderer main message loop before blink::shutdown() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 4 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
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread_impl.cc
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc
index f0b739ca5daecae7b3ce2c3d4c2d7b2ae77233a2..1fe1254f7d5e72f94bf34034811cd8b9d19052b6 100644
--- a/content/child/child_thread_impl.cc
+++ b/content/child/child_thread_impl.cc
@@ -404,6 +404,7 @@ void ChildThreadImpl::Init(const Options& options) {
g_lazy_tls.Pointer()->Set(this);
on_channel_error_called_ = false;
message_loop_ = base::MessageLoop::current();
+ main_task_runner_ = message_loop_->task_runner();
#ifdef IPC_MESSAGE_LOG_ENABLED
// We must make sure to instantiate the IPC Logger *before* we create the
// channel, otherwise we can get a callback on the IO thread which creates
@@ -466,7 +467,7 @@ void ChildThreadImpl::Init(const Options& options) {
sync_message_filter_ = channel_->CreateSyncMessageFilter();
thread_safe_sender_ = new ThreadSafeSender(
- message_loop_->task_runner(), sync_message_filter_.get());
+ main_task_runner_, sync_message_filter_.get());
resource_dispatcher_.reset(new ResourceDispatcher(
this, message_loop()->task_runner()));
@@ -544,7 +545,7 @@ void ChildThreadImpl::Init(const Options& options) {
connection_timeout = temp;
}
- message_loop_->task_runner()->PostDelayedTask(
+ main_task_runner_->PostDelayedTask(
FROM_HERE, base::Bind(&ChildThreadImpl::EnsureConnected,
channel_connected_factory_->GetWeakPtr()),
base::TimeDelta::FromSeconds(connection_timeout));
@@ -593,6 +594,7 @@ void ChildThreadImpl::Shutdown() {
file_system_dispatcher_.reset();
quota_dispatcher_.reset();
WebFileSystemImpl::DeleteThreadSpecificInstance();
+ message_loop_ = nullptr;
}
void ChildThreadImpl::ShutdownDiscardableSharedMemoryManager() {
@@ -609,7 +611,7 @@ void ChildThreadImpl::OnChannelError() {
}
bool ChildThreadImpl::Send(IPC::Message* msg) {
- DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
if (!channel_) {
delete msg;
return false;
@@ -656,13 +658,13 @@ shell::InterfaceProvider* ChildThreadImpl::GetRemoteInterfaces() {
}
IPC::MessageRouter* ChildThreadImpl::GetRouter() {
- DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
return &router_;
}
std::unique_ptr<base::SharedMemory> ChildThreadImpl::AllocateSharedMemory(
size_t buf_size) {
- DCHECK(message_loop_->task_runner()->BelongsToCurrentThread());
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
return AllocateSharedMemory(buf_size, this, nullptr);
}
« no previous file with comments | « content/child/child_thread_impl.h ('k') | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698