| 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_HOST_DISPATCHER_H_ | 5 #ifndef PPAPI_PROXY_HOST_DISPATCHER_H_ |
| 6 #define PPAPI_PROXY_HOST_DISPATCHER_H_ | 6 #define PPAPI_PROXY_HOST_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/process.h" | 14 #include "base/process.h" |
| 14 #include "ipc/ipc_channel_proxy.h" | 15 #include "ipc/ipc_channel_proxy.h" |
| 15 #include "ppapi/c/pp_instance.h" | 16 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/proxy/dispatcher.h" | 17 #include "ppapi/proxy/dispatcher.h" |
| 17 | 18 |
| 18 struct PPB_Proxy_Private; | 19 struct PPB_Proxy_Private; |
| 19 | 20 |
| 20 namespace ppapi { | 21 namespace ppapi { |
| 21 | 22 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // used by multiple renderer processes. | 72 // used by multiple renderer processes. |
| 72 // | 73 // |
| 73 // Use this value instead of a value from the plugin whenever talking to the | 74 // Use this value instead of a value from the plugin whenever talking to the |
| 74 // host. | 75 // host. |
| 75 PP_Module pp_module() const { return pp_module_; } | 76 PP_Module pp_module() const { return pp_module_; } |
| 76 | 77 |
| 77 // Dispatcher overrides. | 78 // Dispatcher overrides. |
| 78 virtual bool IsPlugin() const; | 79 virtual bool IsPlugin() const; |
| 79 virtual bool Send(IPC::Message* msg); | 80 virtual bool Send(IPC::Message* msg); |
| 80 | 81 |
| 81 // IPC::Channel::Listener. | 82 // IPC::Listener. |
| 82 virtual bool OnMessageReceived(const IPC::Message& msg); | 83 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 83 virtual void OnChannelError(); | 84 virtual void OnChannelError() OVERRIDE; |
| 84 | 85 |
| 85 // Proxied version of calling GetInterface on the plugin. This will check | 86 // Proxied version of calling GetInterface on the plugin. This will check |
| 86 // if the plugin supports the given interface (with caching) and returns the | 87 // if the plugin supports the given interface (with caching) and returns the |
| 87 // pointer to the proxied interface if it is supported. Returns NULL if the | 88 // pointer to the proxied interface if it is supported. Returns NULL if the |
| 88 // given interface isn't supported by the plugin or the proxy. | 89 // given interface isn't supported by the plugin or the proxy. |
| 89 const void* GetProxiedInterface(const std::string& iface_name); | 90 const void* GetProxiedInterface(const std::string& iface_name); |
| 90 | 91 |
| 91 // See the value below. Call this when processing a scripting message from | 92 // See the value below. Call this when processing a scripting message from |
| 92 // the plugin that can be reentered. This is set to false at the beginning | 93 // the plugin that can be reentered. This is set to false at the beginning |
| 93 // of processing of each message from the plugin. | 94 // of processing of each message from the plugin. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 private: | 144 private: |
| 144 HostDispatcher* dispatcher_; | 145 HostDispatcher* dispatcher_; |
| 145 | 146 |
| 146 DISALLOW_COPY_AND_ASSIGN(ScopedModuleReference); | 147 DISALLOW_COPY_AND_ASSIGN(ScopedModuleReference); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 } // namespace proxy | 150 } // namespace proxy |
| 150 } // namespace ppapi | 151 } // namespace ppapi |
| 151 | 152 |
| 152 #endif // PPAPI_PROXY_HOST_DISPATCHER_H_ | 153 #endif // PPAPI_PROXY_HOST_DISPATCHER_H_ |
| OLD | NEW |