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 CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 5 #ifndef CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
6 #define CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 6 #define CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 class PpapiThread : public ChildThread, | 40 class PpapiThread : public ChildThread, |
41 public ppapi::proxy::PluginDispatcher::PluginDelegate, | 41 public ppapi::proxy::PluginDispatcher::PluginDelegate, |
42 public ppapi::proxy::PluginProxyDelegate { | 42 public ppapi::proxy::PluginProxyDelegate { |
43 public: | 43 public: |
44 PpapiThread(const CommandLine& command_line, bool is_broker); | 44 PpapiThread(const CommandLine& command_line, bool is_broker); |
45 virtual ~PpapiThread(); | 45 virtual ~PpapiThread(); |
46 | 46 |
47 private: | 47 private: |
48 // ChildThread overrides. | 48 // ChildThread overrides. |
| 49 virtual bool Send(IPC::Message* msg) OVERRIDE; |
49 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 50 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
50 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 51 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
51 | 52 |
52 // PluginDispatcher::PluginDelegate implementation. | 53 // PluginDispatcher::PluginDelegate implementation. |
53 virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE; | 54 virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() OVERRIDE; |
54 virtual base::MessageLoopProxy* GetIPCMessageLoop() OVERRIDE; | 55 virtual base::MessageLoopProxy* GetIPCMessageLoop() OVERRIDE; |
55 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE; | 56 virtual base::WaitableEvent* GetShutdownEvent() OVERRIDE; |
56 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( | 57 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
57 base::PlatformFile handle, | 58 base::PlatformFile handle, |
58 const IPC::SyncChannel& channel, | 59 const IPC::SyncChannel& channel, |
59 bool should_close_source) OVERRIDE; | 60 bool should_close_source) OVERRIDE; |
60 virtual uint32 Register( | 61 virtual uint32 Register( |
61 ppapi::proxy::PluginDispatcher* plugin_dispatcher) OVERRIDE; | 62 ppapi::proxy::PluginDispatcher* plugin_dispatcher) OVERRIDE; |
62 virtual void Unregister(uint32 plugin_dispatcher_id) OVERRIDE; | 63 virtual void Unregister(uint32 plugin_dispatcher_id) OVERRIDE; |
63 | 64 |
64 // PluginProxyDelegate. | 65 // PluginProxyDelegate. |
65 // SendToBrowser() is intended to be safe to use on another thread so | 66 // SendToBrowser() is intended to be safe to use on another thread so |
66 // long as the main PpapiThread outlives it. | 67 // long as the main PpapiThread outlives it. |
67 virtual bool SendToBrowser(IPC::Message* msg) OVERRIDE; | |
68 virtual IPC::Sender* GetBrowserSender() OVERRIDE; | 68 virtual IPC::Sender* GetBrowserSender() OVERRIDE; |
69 virtual std::string GetUILanguage() OVERRIDE; | 69 virtual std::string GetUILanguage() OVERRIDE; |
70 virtual void PreCacheFont(const void* logfontw) OVERRIDE; | 70 virtual void PreCacheFont(const void* logfontw) OVERRIDE; |
71 virtual void SetActiveURL(const std::string& url) OVERRIDE; | 71 virtual void SetActiveURL(const std::string& url) OVERRIDE; |
72 | 72 |
73 // Message handlers. | 73 // Message handlers. |
74 void OnMsgLoadPlugin(const FilePath& path, | 74 void OnMsgLoadPlugin(const FilePath& path, |
75 const ppapi::PpapiPermissions& permissions); | 75 const ppapi::PpapiPermissions& permissions); |
76 void OnMsgCreateChannel(int renderer_id, | 76 void OnMsgCreateChannel(int renderer_id, |
77 bool incognito); | 77 bool incognito); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Caches the handle to the peer process if this is a broker. | 129 // Caches the handle to the peer process if this is a broker. |
130 base::win::ScopedHandle peer_handle_; | 130 base::win::ScopedHandle peer_handle_; |
131 #endif | 131 #endif |
132 | 132 |
133 DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); | 133 DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace content | 136 } // namespace content |
137 | 137 |
138 #endif // CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 138 #endif // CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
OLD | NEW |