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

Unified Diff: chrome/browser/nacl_host/nacl_process_host.h

Issue 10912011: Change NaCl IPC PPAPI proxy startup to support a NaCl-Browser process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months 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
« no previous file with comments | « build/common_untrusted.gypi ('k') | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/nacl_host/nacl_process_host.h
===================================================================
--- chrome/browser/nacl_host/nacl_process_host.h (revision 154143)
+++ chrome/browser/nacl_host/nacl_process_host.h (working copy)
@@ -26,6 +26,10 @@
class BrowserChildProcessHost;
}
+namespace IPC {
+class ChannelProxy;
+}
+
// Represents the browser side of the browser <--> NaCl communication
// channel. There will be one NaClProcessHost per NaCl process
// The browser is responsible for starting the NaCl process
@@ -60,12 +64,25 @@
bool Send(IPC::Message* msg);
private:
+ friend class PluginListener;
+
// Internal class that holds the nacl::Handle objecs so that
// nacl_process_host.h doesn't include NaCl headers. Needed since it's
// included by src\content, which can't depend on the NaCl gyp file because it
// depends on chrome.gyp (circular dependency).
struct NaClInternal;
+ // PluginListener that forwards any messages from untrusted code that aren't
+ // handled by the PepperMessageFilter to us.
+ class PluginListener : public IPC::Listener {
+ public:
+ explicit PluginListener(NaClProcessHost* host);
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ private:
+ // Non-owning pointer so we can forward messages to the host.
+ NaClProcessHost* host_;
+ };
+
#if defined(OS_WIN)
// Create command line for launching loader under nacl-gdb.
scoped_ptr<CommandLine> GetCommandForLaunchWithGdb(const FilePath& nacl_gdb,
@@ -113,7 +130,11 @@
IPC::Message* reply_msg);
#endif
+ // Called when a PPAPI IPC channel has been created.
void OnPpapiChannelCreated(const IPC::ChannelHandle& channel_handle);
+ // Called by PluginListener, so messages from the untrusted side of
+ // the IPC proxy can be handled.
+ bool OnUntrustedMessageForwarded(const IPC::Message& msg);
GURL manifest_url_;
@@ -159,6 +180,11 @@
bool enable_ipc_proxy_;
+ // Channel proxy to terminate the NaCl-Browser PPAPI channel.
+ scoped_ptr<IPC::ChannelProxy> ipc_proxy_channel_;
+ // Plugin listener, to forward browser channel messages to us.
+ PluginListener ipc_plugin_listener_;
+
DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
};
« no previous file with comments | « build/common_untrusted.gypi ('k') | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698