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

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

Issue 2100683002: Mojo C++ Bindings: Extract AssociatedGroupController from MultiplexRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops more gyp ugh Created 4 years, 6 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
Index: mojo/public/cpp/bindings/lib/multiplex_router.cc
diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.cc b/mojo/public/cpp/bindings/lib/multiplex_router.cc
index f076c13e11a956a2dcc54366811fa0109570b544..f0e4e1b52e411cb8bc2abdecda0aef26cf26888c 100644
--- a/mojo/public/cpp/bindings/lib/multiplex_router.cc
+++ b/mojo/public/cpp/bindings/lib/multiplex_router.cc
@@ -16,8 +16,8 @@
#include "base/stl_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "mojo/public/cpp/bindings/associated_group.h"
-#include "mojo/public/cpp/bindings/lib/interface_endpoint_client.h"
-#include "mojo/public/cpp/bindings/lib/interface_endpoint_controller.h"
+#include "mojo/public/cpp/bindings/interface_endpoint_client.h"
+#include "mojo/public/cpp/bindings/interface_endpoint_controller.h"
#include "mojo/public/cpp/bindings/lib/sync_handle_watcher.h"
namespace mojo {
@@ -285,7 +285,7 @@ MultiplexRouter::MultiplexRouter(
bool set_interface_id_namesapce_bit,
ScopedMessagePipeHandle message_pipe,
scoped_refptr<base::SingleThreadTaskRunner> runner)
- : RefCountedDeleteOnMessageLoop(base::ThreadTaskRunnerHandle::Get()),
+ : AssociatedGroupController(base::ThreadTaskRunnerHandle::Get()),
set_interface_id_namespace_bit_(set_interface_id_namesapce_bit),
header_validator_(this),
connector_(std::move(message_pipe),
@@ -351,8 +351,8 @@ void MultiplexRouter::CreateEndpointHandlePair(
if (encountered_error_)
UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED);
- *local_endpoint = ScopedInterfaceEndpointHandle(id, true, this);
- *remote_endpoint = ScopedInterfaceEndpointHandle(id, false, this);
+ *local_endpoint = CreateScopedInterfaceEndpointHandle(id, true);
+ *remote_endpoint = CreateScopedInterfaceEndpointHandle(id, false);
}
ScopedInterfaceEndpointHandle MultiplexRouter::CreateLocalEndpointHandle(
@@ -372,7 +372,7 @@ ScopedInterfaceEndpointHandle MultiplexRouter::CreateLocalEndpointHandle(
CHECK(!endpoint->closed());
CHECK(endpoint->peer_closed());
}
- return ScopedInterfaceEndpointHandle(id, true, this);
+ return CreateScopedInterfaceEndpointHandle(id, true);
}
void MultiplexRouter::CloseEndpointHandle(InterfaceId id, bool is_local) {
@@ -447,17 +447,6 @@ void MultiplexRouter::RaiseError() {
}
}
-std::unique_ptr<AssociatedGroup> MultiplexRouter::CreateAssociatedGroup() {
- std::unique_ptr<AssociatedGroup> group(new AssociatedGroup);
- group->router_ = this;
- return group;
-}
-
-// static
-MultiplexRouter* MultiplexRouter::GetRouter(AssociatedGroup* associated_group) {
- return associated_group->router_.get();
-}
-
void MultiplexRouter::CloseMessagePipe() {
DCHECK(thread_checker_.CalledOnValidThread());
connector_.CloseMessagePipe();
« no previous file with comments | « mojo/public/cpp/bindings/lib/multiplex_router.h ('k') | mojo/public/cpp/bindings/lib/pipe_control_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698