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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/singleton.h" | 15 #include "base/singleton.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "base/task.h" | 17 #include "base/task.h" |
| 18 #include "chrome/common/notification_observer.h" |
18 #include "chrome/common/notification_registrar.h" | 19 #include "chrome/common/notification_registrar.h" |
19 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
20 | 21 |
21 class MessagePortDispatcher : public NotificationObserver { | 22 class MessagePortDispatcher : public NotificationObserver { |
22 public: | 23 public: |
23 typedef std::vector<std::pair<string16, std::vector<int> > > QueuedMessages; | 24 typedef std::vector<std::pair<string16, std::vector<int> > > QueuedMessages; |
24 | 25 |
25 // Returns the MessagePortDispatcher singleton. | 26 // Returns the MessagePortDispatcher singleton. |
26 static MessagePortDispatcher* GetInstance(); | 27 static MessagePortDispatcher* GetInstance(); |
27 | 28 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Valid only during IPC message dispatching. | 105 // Valid only during IPC message dispatching. |
105 IPC::Message::Sender* sender_; | 106 IPC::Message::Sender* sender_; |
106 CallbackWithReturnValue<int>::Type* next_routing_id_; | 107 CallbackWithReturnValue<int>::Type* next_routing_id_; |
107 | 108 |
108 NotificationRegistrar registrar_; | 109 NotificationRegistrar registrar_; |
109 | 110 |
110 DISALLOW_COPY_AND_ASSIGN(MessagePortDispatcher); | 111 DISALLOW_COPY_AND_ASSIGN(MessagePortDispatcher); |
111 }; | 112 }; |
112 | 113 |
113 #endif // CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ | 114 #endif // CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ |
OLD | NEW |