Chromium Code Reviews| 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_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> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 // InterfaceProxy <---------------------- InterfaceProxy | 43 // InterfaceProxy <---------------------- InterfaceProxy |
| 44 // | | 44 // | |
| 45 class PPAPI_PROXY_EXPORT Dispatcher : public ProxyChannel { | 45 class PPAPI_PROXY_EXPORT Dispatcher : public ProxyChannel { |
| 46 public: | 46 public: |
| 47 virtual ~Dispatcher(); | 47 virtual ~Dispatcher(); |
| 48 | 48 |
| 49 // Returns true if the dispatcher is on the plugin side, or false if it's the | 49 // Returns true if the dispatcher is on the plugin side, or false if it's the |
| 50 // browser side. | 50 // browser side. |
| 51 virtual bool IsPlugin() const = 0; | 51 virtual bool IsPlugin() const = 0; |
| 52 | 52 |
| 53 void AddFilter(IPC::Channel::Listener* listener); | |
| 54 | |
| 53 VarSerializationRules* serialization_rules() const { | 55 VarSerializationRules* serialization_rules() const { |
| 54 return serialization_rules_.get(); | 56 return serialization_rules_.get(); |
| 55 } | 57 } |
| 56 | 58 |
| 57 // Returns a non-owning pointer to the interface proxy for the given ID, or | 59 // Returns a non-owning pointer to the interface proxy for the given ID, or |
| 58 // NULL if the ID isn't found. This will create the proxy if it hasn't been | 60 // NULL if the ID isn't found. This will create the proxy if it hasn't been |
| 59 // created so far. | 61 // created so far. |
| 60 InterfaceProxy* GetInterfaceProxy(ApiID id); | 62 InterfaceProxy* GetInterfaceProxy(ApiID id); |
| 61 | 63 |
| 62 // Returns the pointer to the IO thread for processing IPC messages. | 64 // Returns the pointer to the IO thread for processing IPC messages. |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 88 void SetSerializationRules(VarSerializationRules* var_serialization_rules); | 90 void SetSerializationRules(VarSerializationRules* var_serialization_rules); |
| 89 | 91 |
| 90 // Called when an invalid message is received from the remote site. The | 92 // Called when an invalid message is received from the remote site. The |
| 91 // default implementation does nothing, derived classes can override. | 93 // default implementation does nothing, derived classes can override. |
| 92 virtual void OnInvalidMessageReceived(); | 94 virtual void OnInvalidMessageReceived(); |
| 93 | 95 |
| 94 bool disallow_trusted_interfaces() const { | 96 bool disallow_trusted_interfaces() const { |
| 95 return disallow_trusted_interfaces_; | 97 return disallow_trusted_interfaces_; |
| 96 } | 98 } |
| 97 | 99 |
| 100 protected: | |
| 101 std::vector<IPC::Channel::Listener*> filters_; | |
|
dmichael (off chromium)
2012/06/22 16:56:49
I don't think you're using this in this CL. Did it
brettw
2012/06/24 04:42:08
Actually, I'm not using anything in this CL yet :)
| |
| 102 | |
| 98 private: | 103 private: |
| 99 friend class HostDispatcherTest; | 104 friend class HostDispatcherTest; |
| 100 friend class PluginDispatcherTest; | 105 friend class PluginDispatcherTest; |
| 101 | 106 |
| 102 // Lists all lazily-created interface proxies. | 107 // Lists all lazily-created interface proxies. |
| 103 scoped_ptr<InterfaceProxy> proxies_[API_ID_COUNT]; | 108 scoped_ptr<InterfaceProxy> proxies_[API_ID_COUNT]; |
| 104 | 109 |
| 105 bool disallow_trusted_interfaces_; | 110 bool disallow_trusted_interfaces_; |
| 106 | 111 |
| 107 PP_GetInterface_Func local_get_interface_; | 112 PP_GetInterface_Func local_get_interface_; |
| 108 | 113 |
| 109 scoped_refptr<VarSerializationRules> serialization_rules_; | 114 scoped_refptr<VarSerializationRules> serialization_rules_; |
| 110 | 115 |
| 111 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 116 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
| 112 }; | 117 }; |
| 113 | 118 |
| 114 } // namespace proxy | 119 } // namespace proxy |
| 115 } // namespace ppapi | 120 } // namespace ppapi |
| 116 | 121 |
| 117 #endif // PPAPI_PROXY_DISPATCHER_H_ | 122 #endif // PPAPI_PROXY_DISPATCHER_H_ |
| OLD | NEW |