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

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

Issue 61063003: Keep NaCl plugins used in app background pages alive when active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ref counted compile warning Created 7 years, 1 month 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..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_;

Powered by Google App Engine
This is Rietveld 408576698