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

Unified Diff: extensions/browser/api/cast_channel/cast_transport.cc

Issue 2910073002: Replace deprecated base::NonThreadSafe in extensions/browser/api/cast_channel in favor of SequenceC… (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 | « extensions/browser/api/cast_channel/cast_transport.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/cast_channel/cast_transport.cc
diff --git a/extensions/browser/api/cast_channel/cast_transport.cc b/extensions/browser/api/cast_channel/cast_transport.cc
index 1bfbb33693040ad77d004f4421c862ff4a952ae1..c8805bc5a4ca98c0c731a9bb414097daa3261d0e 100644
--- a/extensions/browser/api/cast_channel/cast_transport.cc
+++ b/extensions/browser/api/cast_channel/cast_transport.cc
@@ -56,7 +56,7 @@ CastTransportImpl::CastTransportImpl(net::Socket* socket,
}
CastTransportImpl::~CastTransportImpl() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
FlushWriteQueue();
}
@@ -146,7 +146,7 @@ proto::ErrorState CastTransportImpl::ErrorStateToProto(ChannelError state) {
}
void CastTransportImpl::SetReadDelegate(std::unique_ptr<Delegate> delegate) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(delegate);
delegate_ = std::move(delegate);
if (started_) {
@@ -165,7 +165,7 @@ void CastTransportImpl::FlushWriteQueue() {
void CastTransportImpl::SendMessage(const CastMessage& message,
const net::CompletionCallback& callback) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
std::string serialized_message;
if (!MessageFramer::Serialize(message, &serialized_message)) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
@@ -214,7 +214,7 @@ void CastTransportImpl::SetErrorState(ChannelError error_state) {
}
void CastTransportImpl::OnWriteResult(int result) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_NE(WRITE_STATE_IDLE, write_state_);
if (write_queue_.empty()) {
SetWriteState(WRITE_STATE_IDLE);
@@ -330,7 +330,7 @@ int CastTransportImpl::DoWriteHandleError(int result) {
}
void CastTransportImpl::Start() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!started_);
DCHECK_EQ(READ_STATE_READ, read_state_);
DCHECK(delegate_) << "Read delegate must be set prior to calling Start()";
@@ -343,7 +343,7 @@ void CastTransportImpl::Start() {
}
void CastTransportImpl::OnReadResult(int result) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Network operations can either finish synchronously or asynchronously.
// This method executes the state machine transitions in a loop so that
// write state transitions happen even when network operations finish
« no previous file with comments | « extensions/browser/api/cast_channel/cast_transport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698