Chromium Code Reviews| Index: content/browser/renderer_host/pepper/browser_ppapi_host_impl.h |
| diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h |
| index 5d953422c1bedacae428d8adbc7720a0471fff8d..a2d78a5d3145d8ff332b4dcfec278b6112f2f3c7 100644 |
| --- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h |
| +++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h |
| @@ -23,14 +23,18 @@ |
| namespace content { |
| -class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
| +class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost |
| +{ |
|
yzshen1
2013/11/06 22:43:15
Please move { back to the previous line.
scheib
2013/11/15 01:22:17
Done.
|
| public: |
| + // |delegate| will be owned by BrowserPpapiHostImpl, is optional and may be |
| + // NULL, and is used only for OnIdleState for NaCl extensions. |
|
yzshen1
2013/11/06 22:43:15
Please void references to "NaCl" in content/
scheib
2013/11/15 01:22:17
Done.
|
| // The creator is responsible for calling set_plugin_process_handle as soon |
| // as it is known (we start the process asynchronously so it won't be known |
| // when this object is created). |
| // |external_plugin| signfies that this is a proxy created for an embedder's |
| // plugin, i.e. using BrowserPpapiHost::CreateExternalPluginProcess. |
| BrowserPpapiHostImpl( |
| + BrowserPpapiHost::Delegate* delegate, |
| IPC::Sender* sender, |
| const ppapi::PpapiPermissions& permissions, |
| const std::string& plugin_name, |
| @@ -38,7 +42,6 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
| const base::FilePath& profile_data_directory, |
| bool in_process, |
| bool external_plugin); |
| - virtual ~BrowserPpapiHostImpl(); |
| // BrowserPpapiHost. |
| virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; |
| @@ -67,6 +70,9 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
| const PepperRendererInstanceData& instance_data); |
| void DeleteInstance(PP_Instance instance); |
| + // Called to handle the idle state of the plugin changing. |
| + void OnIdleState(bool idle); |
| + |
| scoped_refptr<IPC::ChannelProxy::MessageFilter> message_filter() { |
| return message_filter_; |
| } |
| @@ -78,13 +84,17 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
| private: |
| friend class BrowserPpapiHostTest; |
| + virtual ~BrowserPpapiHostImpl(); |
| + |
| // Implementing MessageFilter on BrowserPpapiHostImpl makes it ref-counted, |
| // preventing us from returning these to embedders without holding a |
| // reference. To avoid that, define a message filter object. |
| class HostMessageFilter : public IPC::ChannelProxy::MessageFilter { |
| public: |
| - explicit HostMessageFilter(ppapi::host::PpapiHost* ppapi_host) |
| - : ppapi_host_(ppapi_host) {} |
| + explicit HostMessageFilter(BrowserPpapiHostImpl* host, |
| + ppapi::host::PpapiHost* ppapi_host) |
| + : browser_ppapi_host_impl_(host), |
| + ppapi_host_(ppapi_host) {} |
| // IPC::ChannelProxy::MessageFilter. |
| virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| @@ -93,9 +103,13 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
| private: |
| virtual ~HostMessageFilter() {} |
| + void OnIdleState(bool idle); |
| + |
| + BrowserPpapiHostImpl* browser_ppapi_host_impl_; // Not owned; |
| ppapi::host::PpapiHost* ppapi_host_; |
| }; |
| + scoped_ptr<BrowserPpapiHost::Delegate> delegate_; |
| scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
| base::ProcessHandle plugin_process_handle_; |
| std::string plugin_name_; |