OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_MESSAGE_ROUTER_H__ | 5 #ifndef CHROME_COMMON_MESSAGE_ROUTER_H__ |
6 #define CHROME_COMMON_MESSAGE_ROUTER_H__ | 6 #define CHROME_COMMON_MESSAGE_ROUTER_H__ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "chrome/common/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
10 | 10 |
11 // The MessageRouter handles all incoming messages sent to it by routing them | 11 // The MessageRouter handles all incoming messages sent to it by routing them |
12 // to the correct listener. Routing is based on the Message's routing ID. | 12 // to the correct listener. Routing is based on the Message's routing ID. |
13 // Since routing IDs are typically assigned asynchronously by the browser | 13 // Since routing IDs are typically assigned asynchronously by the browser |
14 // process, the MessageRouter has the notion of pending IDs for listeners that | 14 // process, the MessageRouter has the notion of pending IDs for listeners that |
15 // have not yet been assigned a routing ID. | 15 // have not yet been assigned a routing ID. |
16 // | 16 // |
17 // When a message arrives, the routing ID is used to index the set of routes to | 17 // When a message arrives, the routing ID is used to index the set of routes to |
18 // find a listener. If a listener is found, then the message is passed to it. | 18 // find a listener. If a listener is found, then the message is passed to it. |
19 // Otherwise, the message is ignored if its routing ID is not equal to | 19 // Otherwise, the message is ignored if its routing ID is not equal to |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void RemoveRoute(int32 routing_id); | 51 void RemoveRoute(int32 routing_id); |
52 | 52 |
53 private: | 53 private: |
54 // A list of all listeners with assigned routing IDs. | 54 // A list of all listeners with assigned routing IDs. |
55 IDMap<IPC::Channel::Listener> routes_; | 55 IDMap<IPC::Channel::Listener> routes_; |
56 | 56 |
57 DISALLOW_EVIL_CONSTRUCTORS(MessageRouter); | 57 DISALLOW_EVIL_CONSTRUCTORS(MessageRouter); |
58 }; | 58 }; |
59 | 59 |
60 #endif // CHROME_COMMON_MESSAGE_ROUTER_H__ | 60 #endif // CHROME_COMMON_MESSAGE_ROUTER_H__ |
OLD | NEW |