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..1cd6d98c1ce03272ffc83158ea37c753633873c0 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 SetOnIdleChangeCallback( |
+ const BrowserPpapiHost::OnIdleChangeCallback callback) OVERRIDE; |
dmichael (off chromium)
2013/11/15 18:26:22
could be const&
scheib
2013/12/11 21:35:40
Done.
|
+ |
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) {} |
+ typedef base::Callback<void (bool idle)> OnIdleChangeCallback; |
+ |
+ HostMessageFilter(ppapi::host::PpapiHost* ppapi_host, |
+ const OnIdleChangeCallback on_idle_change_callback); |
+ |
// IPC::ChannelProxy::MessageFilter. |
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
void OnHostDestroyed(); |
private: |
- virtual ~HostMessageFilter() {} |
+ virtual ~HostMessageFilter(); |
+ |
+ void OnIdleStateChange(bool idle); |
ppapi::host::PpapiHost* ppapi_host_; |
+ OnIdleChangeCallback on_idle_change_callback_; |
}; |
+ void OnIdleChange(bool idle); |
+ |
scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
base::ProcessHandle plugin_process_handle_; |
std::string plugin_name_; |
@@ -118,6 +130,11 @@ class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
scoped_refptr<HostMessageFilter> message_filter_; |
+ BrowserPpapiHost::OnIdleChangeCallback on_idle_change_callback_; |
+ |
+ // Member variables should appear before the WeakPtrFactory, see weak_ptr.h. |
+ base::WeakPtrFactory<BrowserPpapiHostImpl> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl); |
}; |