OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 5 #ifndef PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
6 #define PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 6 #define PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "ipc/ipc_sync_channel.h" | 18 #include "ipc/ipc_sync_channel.h" |
19 #include "ppapi/c/pp_instance.h" | 19 #include "ppapi/c/pp_instance.h" |
20 #include "ppapi/c/pp_rect.h" | 20 #include "ppapi/c/pp_rect.h" |
21 #include "ppapi/c/ppb_console.h" | 21 #include "ppapi/c/ppb_console.h" |
22 #include "ppapi/proxy/dispatcher.h" | 22 #include "ppapi/proxy/dispatcher.h" |
| 23 #include "ppapi/proxy/message_handler.h" |
23 #include "ppapi/shared_impl/ppapi_preferences.h" | 24 #include "ppapi/shared_impl/ppapi_preferences.h" |
24 #include "ppapi/shared_impl/ppb_view_shared.h" | 25 #include "ppapi/shared_impl/ppb_view_shared.h" |
25 #include "ppapi/shared_impl/singleton_resource_id.h" | 26 #include "ppapi/shared_impl/singleton_resource_id.h" |
26 #include "ppapi/shared_impl/tracked_callback.h" | 27 #include "ppapi/shared_impl/tracked_callback.h" |
27 | 28 |
28 namespace IPC { | 29 namespace IPC { |
29 class SyncMessageFilter; | 30 class SyncMessageFilter; |
30 } | 31 } |
31 | 32 |
32 namespace ppapi { | 33 namespace ppapi { |
(...skipping 22 matching lines...) Expand all Loading... |
55 typedef std::map<SingletonResourceID, scoped_refptr<Resource> > | 56 typedef std::map<SingletonResourceID, scoped_refptr<Resource> > |
56 SingletonResourceMap; | 57 SingletonResourceMap; |
57 SingletonResourceMap singleton_resources; | 58 SingletonResourceMap singleton_resources; |
58 | 59 |
59 // Calls to |RequestSurroundingText()| are done by posted tasks. Track whether | 60 // Calls to |RequestSurroundingText()| are done by posted tasks. Track whether |
60 // a) a task is pending, to avoid redundant calls, and b) whether we should | 61 // a) a task is pending, to avoid redundant calls, and b) whether we should |
61 // actually call |RequestSurroundingText()|, to avoid stale calls (i.e., | 62 // actually call |RequestSurroundingText()|, to avoid stale calls (i.e., |
62 // calling when we shouldn't). | 63 // calling when we shouldn't). |
63 bool is_request_surrounding_text_pending; | 64 bool is_request_surrounding_text_pending; |
64 bool should_do_request_surrounding_text; | 65 bool should_do_request_surrounding_text; |
| 66 |
| 67 // The message handler which should handle JavaScript->Plugin messages, if |
| 68 // one has been registered, otherwise NULL. |
| 69 scoped_ptr<MessageHandler> message_handler; |
65 }; | 70 }; |
66 | 71 |
67 class PPAPI_PROXY_EXPORT PluginDispatcher | 72 class PPAPI_PROXY_EXPORT PluginDispatcher |
68 : public Dispatcher, | 73 : public Dispatcher, |
69 public base::SupportsWeakPtr<PluginDispatcher> { | 74 public base::SupportsWeakPtr<PluginDispatcher> { |
70 public: | 75 public: |
71 class PPAPI_PROXY_EXPORT PluginDelegate : public ProxyChannel::Delegate { | 76 class PPAPI_PROXY_EXPORT PluginDelegate : public ProxyChannel::Delegate { |
72 public: | 77 public: |
73 // Returns the set used for globally uniquifying PP_Instances. This same | 78 // Returns the set used for globally uniquifying PP_Instances. This same |
74 // set must be returned for all channels. | 79 // set must be returned for all channels. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // A filter for sending messages from threads other than the main thread. | 206 // A filter for sending messages from threads other than the main thread. |
202 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 207 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
203 | 208 |
204 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); | 209 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); |
205 }; | 210 }; |
206 | 211 |
207 } // namespace proxy | 212 } // namespace proxy |
208 } // namespace ppapi | 213 } // namespace ppapi |
209 | 214 |
210 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 215 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
OLD | NEW |