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

Unified Diff: ipc/ipc_mojo_bootstrap.cc

Issue 2310563002: Adds routed interface support between RenderFrameHost and RenderFrame (Closed)
Patch Set: nit Created 4 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 | « ipc/ipc_listener.h ('k') | ipc/message_router.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_mojo_bootstrap.cc
diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc
index 1552f315d136cc90fea4f030355306749fbb048f..5a60ead81ad30b348cc3958b09e204bb60e23146 100644
--- a/ipc/ipc_mojo_bootstrap.cc
+++ b/ipc/ipc_mojo_bootstrap.cc
@@ -602,8 +602,7 @@ class ChannelAssociatedGroupController
DCHECK(mojo::IsValidInterfaceId(id));
base::AutoLock locker(lock_);
- Endpoint* endpoint =
- GetEndpointForDispatch(id, false /* close_on_insert */);
+ Endpoint* endpoint = GetEndpointForDispatch(id, true /* create */);
mojo::InterfaceEndpointClient* client =
endpoint ? endpoint->client() : nullptr;
if (!client || !endpoint->task_runner()->BelongsToCurrentThread()) {
@@ -652,7 +651,7 @@ class ChannelAssociatedGroupController
DCHECK(mojo::IsValidInterfaceId(id) && !mojo::IsMasterInterfaceId(id));
base::AutoLock locker(lock_);
- Endpoint* endpoint = GetEndpointForDispatch(id, true /* close_on_insert */);
+ Endpoint* endpoint = GetEndpointForDispatch(id, false /* create */);
if (!endpoint)
return;
@@ -680,7 +679,7 @@ class ChannelAssociatedGroupController
base::AutoLock locker(lock_);
Endpoint* endpoint =
- GetEndpointForDispatch(interface_id, true /* close_on_insert */);
+ GetEndpointForDispatch(interface_id, false /* create */);
if (!endpoint)
return;
@@ -706,20 +705,16 @@ class ChannelAssociatedGroupController
RaiseError();
}
- Endpoint* GetEndpointForDispatch(mojo::InterfaceId id, bool close_on_insert) {
+ Endpoint* GetEndpointForDispatch(mojo::InterfaceId id, bool create) {
lock_.AssertAcquired();
+ auto iter = endpoints_.find(id);
+ if (iter != endpoints_.end())
+ return iter->second.get();
+ if (!create)
+ return nullptr;
bool inserted = false;
Endpoint* endpoint = FindOrInsertEndpoint(id, &inserted);
- if (inserted && close_on_insert) {
- MarkClosedAndMaybeRemove(endpoint);
- if (!mojo::IsMasterInterfaceId(id))
- control_message_proxy_.NotifyPeerEndpointClosed(id);
- return nullptr;
- }
-
- if (endpoint->closed())
- return nullptr;
-
+ DCHECK(inserted);
return endpoint;
}
« no previous file with comments | « ipc/ipc_listener.h ('k') | ipc/message_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698