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

Unified Diff: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc

Issue 2608163003: Change single-interface mojo bindings to use SequencedTaskRunner. (Closed)
Patch Set: Created 3 years, 11 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/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
index a9eee86b6aa27ec93664b1937875287e68996ef2..1f04c26c869e89653f2cf826a99b486600e16621 100644
--- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
+++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
@@ -12,7 +12,7 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "base/single_thread_task_runner.h"
+#include "base/sequenced_task_runner.h"
#include "base/stl_util.h"
#include "mojo/public/cpp/bindings/associated_group.h"
#include "mojo/public/cpp/bindings/associated_group_controller.h"
@@ -40,7 +40,7 @@ class ResponderThunk : public MessageReceiverWithStatus {
public:
explicit ResponderThunk(
const base::WeakPtr<InterfaceEndpointClient>& endpoint_client,
- scoped_refptr<base::SingleThreadTaskRunner> runner)
+ scoped_refptr<base::SequencedTaskRunner> runner)
: endpoint_client_(endpoint_client),
accept_was_invoked_(false),
task_runner_(std::move(runner)) {}
@@ -99,7 +99,7 @@ class ResponderThunk : public MessageReceiverWithStatus {
private:
base::WeakPtr<InterfaceEndpointClient> endpoint_client_;
bool accept_was_invoked_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(ResponderThunk);
};
@@ -135,7 +135,7 @@ InterfaceEndpointClient::InterfaceEndpointClient(
MessageReceiverWithResponderStatus* receiver,
std::unique_ptr<MessageReceiver> payload_validator,
bool expect_sync_requests,
- scoped_refptr<base::SingleThreadTaskRunner> runner,
+ scoped_refptr<base::SequencedTaskRunner> runner,
uint32_t interface_version)
: handle_(std::move(handle)),
incoming_receiver_(receiver),
@@ -162,7 +162,7 @@ InterfaceEndpointClient::InterfaceEndpointClient(
}
InterfaceEndpointClient::~InterfaceEndpointClient() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
if (handle_.is_valid())
handle_.group_controller()->DetachEndpointClient(handle_);
@@ -175,12 +175,12 @@ AssociatedGroup* InterfaceEndpointClient::associated_group() {
}
uint32_t InterfaceEndpointClient::interface_id() const {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
return handle_.id();
}
ScopedInterfaceEndpointHandle InterfaceEndpointClient::PassHandle() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
DCHECK(!has_pending_responders());
if (!handle_.is_valid())
@@ -198,21 +198,21 @@ void InterfaceEndpointClient::AddFilter(
}
void InterfaceEndpointClient::RaiseError() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
handle_.group_controller()->RaiseError();
}
void InterfaceEndpointClient::CloseWithReason(uint32_t custom_reason,
const std::string& description) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
auto handle = PassHandle();
handle.ResetWithReason(custom_reason, description);
}
bool InterfaceEndpointClient::Accept(Message* message) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
DCHECK(controller_);
DCHECK(!message->has_flag(Message::kFlagExpectsResponse));
@@ -224,7 +224,7 @@ bool InterfaceEndpointClient::Accept(Message* message) {
bool InterfaceEndpointClient::AcceptWithResponder(Message* message,
MessageReceiver* responder) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
DCHECK(controller_);
DCHECK(message->has_flag(Message::kFlagExpectsResponse));
@@ -273,13 +273,13 @@ bool InterfaceEndpointClient::AcceptWithResponder(Message* message,
}
bool InterfaceEndpointClient::HandleIncomingMessage(Message* message) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
return filters_.Accept(message);
}
void InterfaceEndpointClient::NotifyError(
const base::Optional<DisconnectReason>& reason) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(sequence_checker_.CalledOnValidSequence());
if (encountered_error_)
return;
« no previous file with comments | « mojo/public/cpp/bindings/lib/connector.cc ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698