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

Unified Diff: mojo/edk/system/raw_channel_win.cc

Issue 1492943005: Remove ShutdownIPCSupportAndWaitForNoChannels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « mojo/edk/system/raw_channel.cc ('k') | mojo/edk/system/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel_win.cc
diff --git a/mojo/edk/system/raw_channel_win.cc b/mojo/edk/system/raw_channel_win.cc
index fa968a4594d396d591e185faf6fd102c1b8cdb41..51a8e684e97d3a5ef6ebfd69d4530be580ec9359 100644
--- a/mojo/edk/system/raw_channel_win.cc
+++ b/mojo/edk/system/raw_channel_win.cc
@@ -124,6 +124,7 @@ class RawChannelWin final : public RawChannel {
RawChannelIOHandler(RawChannelWin* owner,
ScopedPlatformHandle handle)
: handle_(handle.Pass()),
+ io_task_runner_(internal::g_io_thread_task_runner),
owner_(owner),
suppress_self_destruct_(false),
pending_read_(false),
@@ -465,7 +466,7 @@ class RawChannelWin final : public RawChannel {
// that that is always a pointer to a valid RawChannelIOHandler.
RawChannelIOHandler* that = static_cast<RawChannelIOHandler*>(param);
that->read_event_signalled_ = true;
- internal::g_io_thread_task_runner->PostTask(
+ that->io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&RawChannelIOHandler::OnObjectSignaled,
that->this_weakptr_, that->read_event_.Get()));
@@ -477,7 +478,7 @@ class RawChannelWin final : public RawChannel {
// that that is always a pointer to a valid RawChannelIOHandler.
RawChannelIOHandler* that = static_cast<RawChannelIOHandler*>(param);
that->write_event_signalled_ = true;
- internal::g_io_thread_task_runner->PostTask(
+ that->io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&RawChannelIOHandler::OnObjectSignaled,
that->this_weakptr_, that->write_event_.Get()));
@@ -485,6 +486,10 @@ class RawChannelWin final : public RawChannel {
ScopedPlatformHandle handle_;
+ // We cache this because ReadCompleted and WriteCompleted might get fired
+ // after ShutdownIPCSupport is called.
+ scoped_refptr<base::TaskRunner> io_task_runner_;
+
// |owner_| is reset on the I/O thread under |owner_->write_lock()|.
// Therefore, it may be used on any thread under lock; or on the I/O thread
// without locking.
« no previous file with comments | « mojo/edk/system/raw_channel.cc ('k') | mojo/edk/system/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698