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

Side by Side Diff: ipc/message_router.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 unified diff | Download patch
« no previous file with comments | « ipc/message_router.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/message_router.h" 5 #include "ipc/message_router.h"
6 6
7 #include "ipc/ipc_message.h" 7 #include "ipc/ipc_message.h"
8 8
9 namespace IPC { 9 namespace IPC {
10 10
(...skipping 19 matching lines...) Expand all
30 return false; 30 return false;
31 } 31 }
32 routes_.AddWithID(listener, routing_id); 32 routes_.AddWithID(listener, routing_id);
33 return true; 33 return true;
34 } 34 }
35 35
36 void MessageRouter::RemoveRoute(int32_t routing_id) { 36 void MessageRouter::RemoveRoute(int32_t routing_id) {
37 routes_.Remove(routing_id); 37 routes_.Remove(routing_id);
38 } 38 }
39 39
40 Listener* MessageRouter::GetRoute(int32_t routing_id) {
41 return routes_.Lookup(routing_id);
42 }
43
40 bool MessageRouter::OnMessageReceived(const IPC::Message& msg) { 44 bool MessageRouter::OnMessageReceived(const IPC::Message& msg) {
41 if (msg.routing_id() == MSG_ROUTING_CONTROL) 45 if (msg.routing_id() == MSG_ROUTING_CONTROL)
42 return OnControlMessageReceived(msg); 46 return OnControlMessageReceived(msg);
43 47
44 return RouteMessage(msg); 48 return RouteMessage(msg);
45 } 49 }
46 50
47 bool MessageRouter::RouteMessage(const IPC::Message& msg) { 51 bool MessageRouter::RouteMessage(const IPC::Message& msg) {
48 IPC::Listener* listener = routes_.Lookup(msg.routing_id()); 52 IPC::Listener* listener = routes_.Lookup(msg.routing_id());
49 if (!listener) 53 if (!listener)
50 return false; 54 return false;
51 55
52 return listener->OnMessageReceived(msg); 56 return listener->OnMessageReceived(msg);
53 } 57 }
54 58
55 } // namespace IPC 59 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/message_router.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698