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..de23161a98697ce87173ce53a702e165fa9ddd76 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; |
@@ -75,6 +79,9 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
return ssl_context_helper_; |
} |
+ // Reports plugin activity to the callback set with SetOnKeepaliveCallback. |
+ void OnKeepalive(); |
yzshen1
2013/12/13 21:23:15
it doesn't need to be a public method.
scheib
2013/12/14 00:07:41
Done.
|
+ |
private: |
friend class BrowserPpapiHostTest; |
@@ -83,17 +90,22 @@ 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_; |
}; |
scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
@@ -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); |
}; |