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

Unified Diff: remoting/protocol/channel_multiplexer.cc

Issue 2911893003: Deprecate NonThreadSafe in remoting in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 7 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 | « remoting/host/win/wts_session_process_delegate.cc ('k') | remoting/protocol/ice_connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_multiplexer.cc
diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc
index 97233d23c1150edaa03179b084b3211fc71a3572..5331bc4e0614aeeffd7fabe42ef04bc055a77e37 100644
--- a/remoting/protocol/channel_multiplexer.cc
+++ b/remoting/protocol/channel_multiplexer.cc
@@ -15,6 +15,7 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/sequence_checker.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/base/net_errors.h"
@@ -97,7 +98,6 @@ class ChannelMultiplexer::MuxChannel {
};
class ChannelMultiplexer::MuxSocket : public P2PStreamSocket,
- public base::NonThreadSafe,
public base::SupportsWeakPtr<MuxSocket> {
public:
MuxSocket(MuxChannel* channel);
@@ -126,6 +126,8 @@ class ChannelMultiplexer::MuxSocket : public P2PStreamSocket,
int write_result_;
net::CompletionCallback write_callback_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(MuxSocket);
};
@@ -220,7 +222,7 @@ ChannelMultiplexer::MuxSocket::~MuxSocket() {
int ChannelMultiplexer::MuxSocket::Read(
const scoped_refptr<net::IOBuffer>& buffer, int buffer_len,
const net::CompletionCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(read_callback_.is_null());
if (base_channel_error_ != net::OK)
@@ -239,7 +241,7 @@ int ChannelMultiplexer::MuxSocket::Read(
int ChannelMultiplexer::MuxSocket::Write(
const scoped_refptr<net::IOBuffer>& buffer, int buffer_len,
const net::CompletionCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(write_callback_.is_null());
if (base_channel_error_ != net::OK)
@@ -307,6 +309,7 @@ ChannelMultiplexer::ChannelMultiplexer(StreamChannelFactory* factory,
weak_factory_(this) {}
ChannelMultiplexer::~ChannelMultiplexer() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(pending_channels_.empty());
// Cancel creation of the base channel if it hasn't finished.
« no previous file with comments | « remoting/host/win/wts_session_process_delegate.cc ('k') | remoting/protocol/ice_connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698