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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Calls to |RequestSurroundingText()| are done by posted tasks. Track whether | 62 // Calls to |RequestSurroundingText()| are done by posted tasks. Track whether |
63 // a) a task is pending, to avoid redundant calls, and b) whether we should | 63 // a) a task is pending, to avoid redundant calls, and b) whether we should |
64 // actually call |RequestSurroundingText()|, to avoid stale calls (i.e., | 64 // actually call |RequestSurroundingText()|, to avoid stale calls (i.e., |
65 // calling when we shouldn't). | 65 // calling when we shouldn't). |
66 bool is_request_surrounding_text_pending; | 66 bool is_request_surrounding_text_pending; |
67 bool should_do_request_surrounding_text; | 67 bool should_do_request_surrounding_text; |
68 | 68 |
69 // The message handler which should handle JavaScript->Plugin messages, if | 69 // The message handler which should handle JavaScript->Plugin messages, if |
70 // one has been registered, otherwise NULL. | 70 // one has been registered, otherwise NULL. |
71 scoped_ptr<MessageHandler> message_handler; | 71 std::unique_ptr<MessageHandler> message_handler; |
72 | 72 |
73 // Flush info for PpapiCommandBufferProxy::OrderingBarrier(). | 73 // Flush info for PpapiCommandBufferProxy::OrderingBarrier(). |
74 struct FlushInfo { | 74 struct FlushInfo { |
75 FlushInfo(); | 75 FlushInfo(); |
76 ~FlushInfo(); | 76 ~FlushInfo(); |
77 bool flush_pending; | 77 bool flush_pending; |
78 HostResource resource; | 78 HostResource resource; |
79 int32_t put_offset; | 79 int32_t put_offset; |
80 }; | 80 }; |
81 FlushInfo flush_info_; | 81 FlushInfo flush_info_; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 PluginDelegate* plugin_delegate_; | 202 PluginDelegate* plugin_delegate_; |
203 | 203 |
204 // Contains all the plugin interfaces we've queried. The mapped value will | 204 // Contains all the plugin interfaces we've queried. The mapped value will |
205 // be the pointer to the interface pointer supplied by the plugin if it's | 205 // be the pointer to the interface pointer supplied by the plugin if it's |
206 // supported, or NULL if it's not supported. This allows us to cache failures | 206 // supported, or NULL if it's not supported. This allows us to cache failures |
207 // and not req-query if a plugin doesn't support the interface. | 207 // and not req-query if a plugin doesn't support the interface. |
208 typedef base::hash_map<std::string, const void*> InterfaceMap; | 208 typedef base::hash_map<std::string, const void*> InterfaceMap; |
209 InterfaceMap plugin_interfaces_; | 209 InterfaceMap plugin_interfaces_; |
210 | 210 |
211 typedef base::ScopedPtrHashMap<PP_Instance, scoped_ptr<InstanceData>> | 211 typedef base::ScopedPtrHashMap<PP_Instance, std::unique_ptr<InstanceData>> |
212 InstanceDataMap; | 212 InstanceDataMap; |
213 InstanceDataMap instance_map_; | 213 InstanceDataMap instance_map_; |
214 | 214 |
215 // The preferences sent from the host. We only want to set this once, which | 215 // The preferences sent from the host. We only want to set this once, which |
216 // is what the received_preferences_ indicates. See OnMsgSetPreferences. | 216 // is what the received_preferences_ indicates. See OnMsgSetPreferences. |
217 bool received_preferences_; | 217 bool received_preferences_; |
218 Preferences preferences_; | 218 Preferences preferences_; |
219 | 219 |
220 uint32_t plugin_dispatcher_id_; | 220 uint32_t plugin_dispatcher_id_; |
221 | 221 |
222 // Set to true when the instances associated with this dispatcher are | 222 // Set to true when the instances associated with this dispatcher are |
223 // incognito mode. | 223 // incognito mode. |
224 bool incognito_; | 224 bool incognito_; |
225 | 225 |
226 // A filter for sending messages from threads other than the main thread. | 226 // A filter for sending messages from threads other than the main thread. |
227 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 227 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
228 | 228 |
229 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); | 229 DISALLOW_COPY_AND_ASSIGN(PluginDispatcher); |
230 }; | 230 }; |
231 | 231 |
232 } // namespace proxy | 232 } // namespace proxy |
233 } // namespace ppapi | 233 } // namespace ppapi |
234 | 234 |
235 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ | 235 #endif // PPAPI_PROXY_PLUGIN_DISPATCHER_H_ |
OLD | NEW |