Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Unified Diff: content/browser/renderer_host/pepper/browser_ppapi_host_impl.h

Issue 105873003: Superset of Nacl Keepalive patch & tests - NOT FOR LANDING DIRECTLY. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « components/nacl/browser/test_nacl_browser_delegate.cc ('k') | content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698