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

Unified Diff: mojo/system/channel.cc

Issue 570773002: Mojo: Add thread assertions to various private Channel methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « mojo/system/channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.cc
diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc
index a4e1dcbf67d35283c7a0cbaa99448eedd8bcea4f..6365a6c51e4bf03a94cdc3eccea01aa33939b708 100644
--- a/mojo/system/channel.cc
+++ b/mojo/system/channel.cc
@@ -275,6 +275,8 @@ Channel::~Channel() {
void Channel::OnReadMessage(
const MessageInTransit::View& message_view,
embedder::ScopedPlatformHandleVectorPtr platform_handles) {
+ DCHECK(creation_thread_checker_.CalledOnValidThread());
+
switch (message_view.type()) {
case MessageInTransit::kTypeMessagePipeEndpoint:
case MessageInTransit::kTypeMessagePipe:
@@ -292,6 +294,8 @@ void Channel::OnReadMessage(
}
void Channel::OnError(Error error) {
+ DCHECK(creation_thread_checker_.CalledOnValidThread());
+
switch (error) {
case ERROR_READ_SHUTDOWN:
// The other side was cleanly closed, so this isn't actually an error.
@@ -323,6 +327,7 @@ void Channel::OnError(Error error) {
void Channel::OnReadMessageForDownstream(
const MessageInTransit::View& message_view,
embedder::ScopedPlatformHandleVectorPtr platform_handles) {
+ DCHECK(creation_thread_checker_.CalledOnValidThread());
DCHECK(message_view.type() == MessageInTransit::kTypeMessagePipeEndpoint ||
message_view.type() == MessageInTransit::kTypeMessagePipe);
@@ -402,6 +407,7 @@ void Channel::OnReadMessageForDownstream(
void Channel::OnReadMessageForChannel(
const MessageInTransit::View& message_view,
embedder::ScopedPlatformHandleVectorPtr platform_handles) {
+ DCHECK(creation_thread_checker_.CalledOnValidThread());
DCHECK_EQ(message_view.type(), MessageInTransit::kTypeChannel);
// Currently, no channel messages take platform handles.
@@ -453,6 +459,8 @@ void Channel::OnReadMessageForChannel(
bool Channel::RemoveMessagePipeEndpoint(
MessageInTransit::EndpointId local_id,
MessageInTransit::EndpointId remote_id) {
+ DCHECK(creation_thread_checker_.CalledOnValidThread());
+
scoped_refptr<MessagePipe> message_pipe;
unsigned port;
{
« no previous file with comments | « mojo/system/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698