| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ |
| 6 #define CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ | 6 #define CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 void PostMessageTo(int message_port_id, | 61 void PostMessageTo(int message_port_id, |
| 62 const string16& message, | 62 const string16& message, |
| 63 const std::vector<int>& sent_message_port_ids); | 63 const std::vector<int>& sent_message_port_ids); |
| 64 | 64 |
| 65 // NotificationObserver interface. | 65 // NotificationObserver interface. |
| 66 void Observe(NotificationType type, | 66 void Observe(NotificationType type, |
| 67 const NotificationSource& source, | 67 const NotificationSource& source, |
| 68 const NotificationDetails& details); | 68 const NotificationDetails& details); |
| 69 | 69 |
| 70 // Handles the details of removing a message port id. Before calling this, |
| 71 // verify that the message port id exists. |
| 72 void Erase(int message_port_id); |
| 73 |
| 74 #ifdef NDEBUG |
| 75 bool CheckMessagePortMap(bool check_entanglements) { } |
| 76 #else |
| 77 bool CheckMessagePortMap(bool check_entanglements); |
| 78 #endif |
| 79 |
| 70 struct MessagePort { | 80 struct MessagePort { |
| 71 // sender and route_id are what we need to send messages to the port. | 81 // sender and route_id are what we need to send messages to the port. |
| 72 IPC::Message::Sender* sender; | 82 IPC::Message::Sender* sender; |
| 73 int route_id; | 83 int route_id; |
| 74 // A function pointer to generate a new route id for the sender above. | 84 // A function pointer to generate a new route id for the sender above. |
| 75 // Owned by "sender" above, so don't delete. | 85 // Owned by "sender" above, so don't delete. |
| 76 CallbackWithReturnValue<int>::Type* next_routing_id; | 86 CallbackWithReturnValue<int>::Type* next_routing_id; |
| 77 // A globally unique id for this message port. | 87 // A globally unique id for this message port. |
| 78 int message_port_id; | 88 int message_port_id; |
| 79 // The globally unique id of the entangled message port. | 89 // The globally unique id of the entangled message port. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 92 // Valid only during IPC message dispatching. | 102 // Valid only during IPC message dispatching. |
| 93 IPC::Message::Sender* sender_; | 103 IPC::Message::Sender* sender_; |
| 94 CallbackWithReturnValue<int>::Type* next_routing_id_; | 104 CallbackWithReturnValue<int>::Type* next_routing_id_; |
| 95 | 105 |
| 96 NotificationRegistrar registrar_; | 106 NotificationRegistrar registrar_; |
| 97 | 107 |
| 98 DISALLOW_COPY_AND_ASSIGN(MessagePortDispatcher); | 108 DISALLOW_COPY_AND_ASSIGN(MessagePortDispatcher); |
| 99 }; | 109 }; |
| 100 | 110 |
| 101 #endif // CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ | 111 #endif // CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ |
| OLD | NEW |