| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DISPATCHER_H_ | 5 #ifndef PPAPI_PROXY_DISPATCHER_H_ |
| 6 #define PPAPI_PROXY_DISPATCHER_H_ | 6 #define PPAPI_PROXY_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/tracked_objects.h" | 13 #include "base/tracked_objects.h" |
| 14 #include "ipc/ipc_channel_proxy.h" | 14 #include "ipc/ipc_channel_proxy.h" |
| 15 #include "ppapi/c/pp_instance.h" | 15 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/c/pp_module.h" | 16 #include "ppapi/c/pp_module.h" |
| 17 #include "ppapi/proxy/callback_tracker.h" | 17 #include "ppapi/proxy/callback_tracker.h" |
| 18 #include "ppapi/proxy/proxy_channel.h" | 18 #include "ppapi/proxy/proxy_channel.h" |
| 19 #include "ppapi/proxy/interface_id.h" | |
| 20 #include "ppapi/proxy/interface_list.h" | 19 #include "ppapi/proxy/interface_list.h" |
| 21 #include "ppapi/proxy/interface_proxy.h" | 20 #include "ppapi/proxy/interface_proxy.h" |
| 22 #include "ppapi/proxy/plugin_var_tracker.h" | 21 #include "ppapi/proxy/plugin_var_tracker.h" |
| 22 #include "ppapi/shared_impl/api_id.h" |
| 23 | 23 |
| 24 namespace ppapi { | 24 namespace ppapi { |
| 25 | 25 |
| 26 class WebKitForwarding; | 26 class WebKitForwarding; |
| 27 | 27 |
| 28 namespace proxy { | 28 namespace proxy { |
| 29 | 29 |
| 30 class VarSerializationRules; | 30 class VarSerializationRules; |
| 31 | 31 |
| 32 // An interface proxy can represent either end of a cross-process interface | 32 // An interface proxy can represent either end of a cross-process interface |
| (...skipping 21 matching lines...) Expand all Loading... |
| 54 // browser side. | 54 // browser side. |
| 55 virtual bool IsPlugin() const = 0; | 55 virtual bool IsPlugin() const = 0; |
| 56 | 56 |
| 57 VarSerializationRules* serialization_rules() const { | 57 VarSerializationRules* serialization_rules() const { |
| 58 return serialization_rules_.get(); | 58 return serialization_rules_.get(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Returns a non-owning pointer to the interface proxy for the given ID, or | 61 // Returns a non-owning pointer to the interface proxy for the given ID, or |
| 62 // NULL if the ID isn't found. This will create the proxy if it hasn't been | 62 // NULL if the ID isn't found. This will create the proxy if it hasn't been |
| 63 // created so far. | 63 // created so far. |
| 64 InterfaceProxy* GetInterfaceProxy(InterfaceID id); | 64 InterfaceProxy* GetInterfaceProxy(ApiID id); |
| 65 | 65 |
| 66 // Returns the pointer to the IO thread for processing IPC messages. | 66 // Returns the pointer to the IO thread for processing IPC messages. |
| 67 // TODO(brettw) remove this. It's a hack to support the Flash | 67 // TODO(brettw) remove this. It's a hack to support the Flash |
| 68 // ModuleLocalThreadAdapter. When the thread stuff is sorted out, this | 68 // ModuleLocalThreadAdapter. When the thread stuff is sorted out, this |
| 69 // implementation detail should be hidden. | 69 // implementation detail should be hidden. |
| 70 base::MessageLoopProxy* GetIPCMessageLoop(); | 70 base::MessageLoopProxy* GetIPCMessageLoop(); |
| 71 | 71 |
| 72 // Adds the given filter to the IO thread. Takes ownership of the pointer. | 72 // Adds the given filter to the IO thread. Takes ownership of the pointer. |
| 73 // TODO(brettw) remove this. It's a hack to support the Flash | 73 // TODO(brettw) remove this. It's a hack to support the Flash |
| 74 // ModuleLocalThreadAdapter. When the thread stuff is sorted out, this | 74 // ModuleLocalThreadAdapter. When the thread stuff is sorted out, this |
| (...skipping 28 matching lines...) Expand all Loading... |
| 103 | 103 |
| 104 bool disallow_trusted_interfaces() const { | 104 bool disallow_trusted_interfaces() const { |
| 105 return disallow_trusted_interfaces_; | 105 return disallow_trusted_interfaces_; |
| 106 } | 106 } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 friend class HostDispatcherTest; | 109 friend class HostDispatcherTest; |
| 110 friend class PluginDispatcherTest; | 110 friend class PluginDispatcherTest; |
| 111 | 111 |
| 112 // Lists all lazily-created interface proxies. | 112 // Lists all lazily-created interface proxies. |
| 113 scoped_ptr<InterfaceProxy> proxies_[INTERFACE_ID_COUNT]; | 113 scoped_ptr<InterfaceProxy> proxies_[API_ID_COUNT]; |
| 114 | 114 |
| 115 bool disallow_trusted_interfaces_; | 115 bool disallow_trusted_interfaces_; |
| 116 | 116 |
| 117 GetInterfaceFunc local_get_interface_; | 117 GetInterfaceFunc local_get_interface_; |
| 118 | 118 |
| 119 CallbackTracker callback_tracker_; | 119 CallbackTracker callback_tracker_; |
| 120 | 120 |
| 121 scoped_ptr<VarSerializationRules> serialization_rules_; | 121 scoped_ptr<VarSerializationRules> serialization_rules_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 123 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace proxy | 126 } // namespace proxy |
| 127 } // namespace ppapi | 127 } // namespace ppapi |
| 128 | 128 |
| 129 #endif // PPAPI_PROXY_DISPATCHER_H_ | 129 #endif // PPAPI_PROXY_DISPATCHER_H_ |
| OLD | NEW |