summaryrefslogtreecommitdiffstats
path: root/content/browser/ppapi_plugin_process_host.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 22:31:09 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 22:31:09 +0000
commitd259a8ecab95cd657b9c7d413e8bfa3c86d0d4cb (patch)
tree83805324a9ffeeb10b334d544b13155c8c52b069 /content/browser/ppapi_plugin_process_host.h
parent772b57ab0dcd7843157b961f10999e48088e8973 (diff)
downloadchromium_src-d259a8ecab95cd657b9c7d413e8bfa3c86d0d4cb.zip
chromium_src-d259a8ecab95cd657b9c7d413e8bfa3c86d0d4cb.tar.gz
chromium_src-d259a8ecab95cd657b9c7d413e8bfa3c86d0d4cb.tar.bz2
Support getting the font list in Pepper. This currently only works out of
process. This adds a function to the font interface to get the font list. Since we don't have arrays or dictionaries in Pepper yet, I used a string with nulls separating the names. A previous attempt to make a "font list resource" proved excessively complicated and not actually much easier for clients to deal with. This refactors the existing font list getting that used to be in the options for the browser. I moved it to content and split it into two pieces, the synchronous version, and then an asynchronous wrapper around that which both the prefs code and the pepper code use. This cleaned up some of the preferences code, and also fixes the leak of the entire font list in the code. I used the new callback/bind system for the async font loading. I had to add BrowserThread support for the new system. This uses the PepperMessageFilter to listen for font load requests from the plugin in the browser process. This is nice because we can add stuff here and have messages serviced for both in-process and out-of-process plugins. This proved to be complicated due to the HostResolver used in some of the existing code, and thread restrictions for how to deal with it. This is why there are two modes for the filter object. I changed the delegates around for the Dispatcher. Now the PluginDispatcher has the delegate interface since the HostDispatcher didn't actually need any of them and we were accumulating a lot of empty functions in the PepperPluginRegistry. It's possible for the fonts to be loaded on Windows and Mac without IPC, since enumerating fonts should be possible inside the sandbox. I didn't implement this since it adds extra complexity and probably doesn't give that much benefit. TEST=manual BUG=none Review URL: http://codereview.chromium.org/7044012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/ppapi_plugin_process_host.h')
-rw-r--r--content/browser/ppapi_plugin_process_host.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h
index 0412c25..15667d4 100644
--- a/content/browser/ppapi_plugin_process_host.h
+++ b/content/browser/ppapi_plugin_process_host.h
@@ -10,10 +10,20 @@
#include "base/basictypes.h"
#include "base/file_path.h"
+#include "base/memory/ref_counted.h"
#include "content/browser/browser_child_process_host.h"
+#include "content/browser/renderer_host/pepper_message_filter.h"
struct PepperPluginInfo;
+namespace content {
+class ResourceContext;
+}
+
+namespace net {
+class HostResolver;
+}
+
class PpapiPluginProcessHost : public BrowserChildProcessHost {
public:
class Client {
@@ -28,10 +38,13 @@ class PpapiPluginProcessHost : public BrowserChildProcessHost {
// IPC::ChannelHandle()
virtual void OnChannelOpened(base::ProcessHandle plugin_process_handle,
const IPC::ChannelHandle& channel_handle) = 0;
+
+ // Returns the resource context for the renderer requesting the channel.
+ virtual const content::ResourceContext* GetResourceContext() = 0;
};
// You must call Init before doing anything else.
- PpapiPluginProcessHost();
+ PpapiPluginProcessHost(net::HostResolver* host_resolver);
virtual ~PpapiPluginProcessHost();
// Actually launches the process with the given plugin info. Returns true
@@ -47,7 +60,6 @@ class PpapiPluginProcessHost : public BrowserChildProcessHost {
// The client pointer must remain valid until its callback is issued.
private:
-
void RequestPluginChannel(Client* client);
virtual bool CanShutdown();
@@ -62,6 +74,9 @@ class PpapiPluginProcessHost : public BrowserChildProcessHost {
// IPC message handlers.
void OnRendererPluginChannelCreated(const IPC::ChannelHandle& handle);
+ // Handles most requests from the plugin.
+ scoped_refptr<PepperMessageFilter> filter_;
+
// Channel requests that we are waiting to send to the plugin process once
// the channel is opened.
std::vector<Client*> pending_requests_;