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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // PluginProxyDelegate. | 60 // PluginProxyDelegate. |
61 // SendToBrowser() is intended to be safe to use on another thread so | 61 // SendToBrowser() is intended to be safe to use on another thread so |
62 // long as the main PpapiThread outlives it. | 62 // long as the main PpapiThread outlives it. |
63 virtual bool SendToBrowser(IPC::Message* msg) OVERRIDE; | 63 virtual bool SendToBrowser(IPC::Message* msg) OVERRIDE; |
64 virtual IPC::Sender* GetBrowserSender() OVERRIDE; | 64 virtual IPC::Sender* GetBrowserSender() OVERRIDE; |
65 virtual std::string GetUILanguage() OVERRIDE; | 65 virtual std::string GetUILanguage() OVERRIDE; |
66 virtual void PreCacheFont(const void* logfontw) OVERRIDE; | 66 virtual void PreCacheFont(const void* logfontw) OVERRIDE; |
67 virtual void SetActiveURL(const std::string& url) OVERRIDE; | 67 virtual void SetActiveURL(const std::string& url) OVERRIDE; |
68 | 68 |
69 // Message handlers. | 69 // Message handlers. |
70 void OnMsgLoadPlugin(const FilePath& path); | 70 void OnMsgLoadPlugin(const FilePath& path, |
| 71 const ppapi::PpapiPermissions& permissions); |
71 void OnMsgCreateChannel(int renderer_id, | 72 void OnMsgCreateChannel(int renderer_id, |
72 bool incognito); | 73 bool incognito); |
73 void OnMsgResourceReply( | 74 void OnMsgResourceReply( |
74 const ppapi::proxy::ResourceMessageReplyParams& reply_params, | 75 const ppapi::proxy::ResourceMessageReplyParams& reply_params, |
75 const IPC::Message& nested_msg); | 76 const IPC::Message& nested_msg); |
76 void OnMsgSetNetworkState(bool online); | 77 void OnMsgSetNetworkState(bool online); |
77 void OnPluginDispatcherMessageReceived(const IPC::Message& msg); | 78 void OnPluginDispatcherMessageReceived(const IPC::Message& msg); |
78 | 79 |
79 // Sets up the channel to the given renderer. On success, returns true and | 80 // Sets up the channel to the given renderer. On success, returns true and |
80 // fills the given ChannelHandle with the information from the new channel. | 81 // fills the given ChannelHandle with the information from the new channel. |
81 bool SetupRendererChannel(int renderer_id, | 82 bool SetupRendererChannel(int renderer_id, |
82 bool incognito, | 83 bool incognito, |
83 IPC::ChannelHandle* handle); | 84 IPC::ChannelHandle* handle); |
84 | 85 |
85 // Sets up the name of the plugin for logging using the given path. | 86 // Sets up the name of the plugin for logging using the given path. |
86 void SavePluginName(const FilePath& path); | 87 void SavePluginName(const FilePath& path); |
87 | 88 |
88 // True if running in a broker process rather than a normal plugin process. | 89 // True if running in a broker process rather than a normal plugin process. |
89 bool is_broker_; | 90 bool is_broker_; |
90 | 91 |
91 base::ScopedNativeLibrary library_; | 92 base::ScopedNativeLibrary library_; |
92 | 93 |
| 94 ppapi::PpapiPermissions permissions_; |
| 95 |
93 // Global state tracking for the proxy. | 96 // Global state tracking for the proxy. |
94 ppapi::proxy::PluginGlobals plugin_globals_; | 97 ppapi::proxy::PluginGlobals plugin_globals_; |
95 | 98 |
96 PP_GetInterface_Func get_plugin_interface_; | 99 PP_GetInterface_Func get_plugin_interface_; |
97 | 100 |
98 // Callback to call when a new instance connects to the broker. | 101 // Callback to call when a new instance connects to the broker. |
99 // Used only when is_broker_. | 102 // Used only when is_broker_. |
100 PP_ConnectInstance_Func connect_instance_func_; | 103 PP_ConnectInstance_Func connect_instance_func_; |
101 | 104 |
102 // Local concept of the module ID. Some functions take this. It's necessary | 105 // Local concept of the module ID. Some functions take this. It's necessary |
(...skipping 16 matching lines...) Expand all Loading... |
119 | 122 |
120 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
121 // Caches the handle to the peer process if this is a broker. | 124 // Caches the handle to the peer process if this is a broker. |
122 base::win::ScopedHandle peer_handle_; | 125 base::win::ScopedHandle peer_handle_; |
123 #endif | 126 #endif |
124 | 127 |
125 DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); | 128 DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); |
126 }; | 129 }; |
127 | 130 |
128 #endif // CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 131 #endif // CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
OLD | NEW |