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 "chrome/common/notification_observer.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(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Valid only during IPC message dispatching. | 84 // Valid only during IPC message dispatching. |
84 IPC::Message::Sender* sender_; | 85 IPC::Message::Sender* sender_; |
85 CallbackWithReturnValue<int>::Type* next_routing_id_; | 86 CallbackWithReturnValue<int>::Type* next_routing_id_; |
86 | 87 |
87 NotificationRegistrar registrar_; | 88 NotificationRegistrar registrar_; |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(MessagePortDispatcher); | 90 DISALLOW_COPY_AND_ASSIGN(MessagePortDispatcher); |
90 }; | 91 }; |
91 | 92 |
92 #endif // CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ | 93 #endif // CHROME_BROWSER_WORKER_HOST_MESSAGE_PORT_DISPATCHER_H_ |
OLD | NEW |