diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 01:16:11 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 01:16:11 +0000 |
commit | 709a847ee12e1380df59db8cd3c972ec4f9c674e (patch) | |
tree | 48217fd87c7e1fe15afdd90db26a925f7db28a1b /chrome/browser/ppapi_plugin_process_host.h | |
parent | f30e74751217091c0b6050080f46cd6eb4914226 (diff) | |
download | chromium_src-709a847ee12e1380df59db8cd3c972ec4f9c674e.zip chromium_src-709a847ee12e1380df59db8cd3c972ec4f9c674e.tar.gz chromium_src-709a847ee12e1380df59db8cd3c972ec4f9c674e.tar.bz2 |
Implement a new process type for running PPAPI plugins. The process itself is
quite simple and just sets up the PPAPI dispatcher and loads the library.
There is a new command line switch --ppapi-out-of-process which runs PPAPI
plugins out of process using the new code path. There is some logic in
RenderView and PepperPluginModule for setting up this connection, but it should
be straightforward.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3915002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ppapi_plugin_process_host.h')
-rw-r--r-- | chrome/browser/ppapi_plugin_process_host.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/chrome/browser/ppapi_plugin_process_host.h b/chrome/browser/ppapi_plugin_process_host.h new file mode 100644 index 0000000..956148c --- /dev/null +++ b/chrome/browser/ppapi_plugin_process_host.h @@ -0,0 +1,57 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ +#define CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ +#pragma once + +#include "base/basictypes.h" +#include "base/file_path.h" +#include "chrome/browser/browser_child_process_host.h" + +class ResourceMessageFilter; + +namespace IPC { +struct ChannelHandle; +class Message; +} + +class PpapiPluginProcessHost : public BrowserChildProcessHost { + public: + explicit PpapiPluginProcessHost(ResourceMessageFilter* filter); + virtual ~PpapiPluginProcessHost(); + + void Init(const FilePath& path, IPC::Message* reply_msg); + + private: + virtual bool CanShutdown() { return true; } + virtual void OnProcessLaunched(); + virtual URLRequestContext* GetRequestContext( + uint32 request_id, + const ViewHostMsg_Resource_Request& request_data); + + virtual void OnMessageReceived(const IPC::Message& msg); + virtual void OnChannelConnected(int32 peer_pid); + virtual void OnChannelError(); + + // IPC message handlers. + void OnPluginLoaded(const IPC::ChannelHandle& handle); + + // Sends the reply_msg_ to the renderer with the given channel info. + void ReplyToRenderer(const IPC::ChannelHandle& handle); + + ResourceMessageFilter* filter_; + + // Path to the plugin library. + FilePath plugin_path_; + + // When we're waiting for initialization of the plugin, this contains the + // reply message for the renderer to tell it that it can continue. + scoped_ptr<IPC::Message> reply_msg_; + + DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); +}; + +#endif // CHROME_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ + |