Index: content/public/browser/browser_ppapi_host.h |
diff --git a/content/public/browser/browser_ppapi_host.h b/content/public/browser/browser_ppapi_host.h |
index 45f997ea06b7705f62594948466ffcecab9cbb83..f0af5b2732364de1425aa2a64596092ec805602f 100644 |
--- a/content/public/browser/browser_ppapi_host.h |
+++ b/content/public/browser/browser_ppapi_host.h |
@@ -27,16 +27,33 @@ class PpapiHost; |
namespace content { |
+struct PepperRendererInstanceData; |
yzshen1
2013/11/06 22:43:15
It is not needed here.
scheib
2013/11/15 01:22:17
Done.
|
+ |
// Interface that allows components in the embedder app to talk to the |
// PpapiHost in the browser process. |
// |
// There will be one of these objects in the browser per plugin process. It |
// lives entirely on the I/O thread. |
-class CONTENT_EXPORT BrowserPpapiHost { |
+class CONTENT_EXPORT BrowserPpapiHost : |
+ public base::RefCountedThreadSafe<BrowserPpapiHost> { |
yzshen1
2013/11/06 22:43:15
If possible, please don't make it a ref-counted ob
scheib
2013/11/15 01:22:17
Done.
|
public: |
+ class Delegate { |
+ public: |
+ virtual ~Delegate() {} |
+ |
+ // Called to handle a plugin instance transitioning in or out of idle state. |
+ virtual void OnIdleState(bool idle, |
+ const base::FilePath& profile_data_directory, |
+ const RenderViewHost* render_view_host, |
+ const GURL& document_url) = 0; |
+ }; |
+ |
// Creates a browser host and sets up an out-of-process proxy for an external |
// pepper plugin process. |
- static BrowserPpapiHost* CreateExternalPluginProcess( |
+ // |delegate| will be owned by the BrowserPpapiHost, is optional and may be |
+ // NULL, and is used only for OnIdleState for NaCl extensions. |
yzshen1
2013/11/06 22:43:15
A general rule is not to mention "NaCl" in content
scheib
2013/11/15 01:22:17
Done.
|
+ static scoped_refptr<BrowserPpapiHost> CreateExternalPluginProcess( |
+ Delegate* delegate, |
IPC::Sender* sender, |
ppapi::PpapiPermissions permissions, |
base::ProcessHandle plugin_child_process, |
@@ -45,8 +62,6 @@ class CONTENT_EXPORT BrowserPpapiHost { |
int render_view_id, |
const base::FilePath& profile_directory); |
- virtual ~BrowserPpapiHost() {} |
- |
// Returns the PpapiHost object. |
virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
@@ -81,6 +96,12 @@ class CONTENT_EXPORT BrowserPpapiHost { |
// Get the Document/Plugin URLs for the given PP_Instance. |
virtual GURL GetDocumentURLForInstance(PP_Instance instance) = 0; |
virtual GURL GetPluginURLForInstance(PP_Instance instance) = 0; |
+ |
+ protected: |
+ virtual ~BrowserPpapiHost() {} |
+ |
+ private: |
+ friend class base::RefCountedThreadSafe<BrowserPpapiHost>; |
}; |
} // namespace content |