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..d987bd4a1c8d83d369fb134669eae85b1ad38a5a 100644 |
--- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h |
+++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h |
@@ -12,6 +12,7 @@ |
#include "base/compiler_specific.h" |
#include "base/files/file_path.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
#include "content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h" |
#include "content/browser/renderer_host/pepper/ssl_context_helper.h" |
#include "content/common/content_export.h" |
@@ -52,6 +53,9 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
virtual const base::FilePath& GetProfileDataDirectory() OVERRIDE; |
virtual GURL GetDocumentURLForInstance(PP_Instance instance) OVERRIDE; |
virtual GURL GetPluginURLForInstance(PP_Instance instance) OVERRIDE; |
+ virtual void SetOnKeepaliveCallback( |
+ const BrowserPpapiHost::OnKeepaliveCallback& callback) OVERRIDE; |
+ |
void set_plugin_process_handle(base::ProcessHandle handle) { |
plugin_process_handle_ = handle; |
@@ -83,19 +87,27 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
// 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) {} |
+ HostMessageFilter(ppapi::host::PpapiHost* ppapi_host, |
+ BrowserPpapiHostImpl* browser_ppapi_host_impl); |
+ |
// IPC::ChannelProxy::MessageFilter. |
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
void OnHostDestroyed(); |
private: |
- virtual ~HostMessageFilter() {} |
+ virtual ~HostMessageFilter(); |
+ |
+ void OnKeepalive(); |
+ // Non owning pointers cleared in OnHostDestroyed() |
ppapi::host::PpapiHost* ppapi_host_; |
+ BrowserPpapiHostImpl* browser_ppapi_host_impl_; |
}; |
+ // Reports plugin activity to the callback set with SetOnKeepaliveCallback. |
+ void OnKeepalive(); |
+ |
scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
base::ProcessHandle plugin_process_handle_; |
std::string plugin_name_; |
@@ -118,6 +130,8 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
scoped_refptr<HostMessageFilter> message_filter_; |
+ BrowserPpapiHost::OnKeepaliveCallback on_keepalive_callback_; |
+ |
DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl); |
}; |