[go: nahoru, domu]

Connect PPAPI IPC channels for non-SFI mode.

By this CL, plugin starts to talk with hosts via IPC.
For that purpose, ppapi_proxy is linked to nacl_helper (temporarily). This increase the size of nacl_helper, but when we split nacl_helper for non-sfi mode, it'll be resolved.

In SFI mode, this CL shouldn't affect the concept of IPC
channel connection between the plugin and the hosts. We
still use NaClIPCAdapter to wrap the IPC channel, and
NaClDesc for the plugin-side IPC file descriptors.

In non-SFI mode, we neither intercept nor rewrite the
message using NaClIPCAdapter, and the channels are
connected between the plugin and the hosts directly.

Note: plugin_main_nacl.cc is renamed to plugin_main.cc, because files with _nacl.cc suffix are automatically excluded from the sources of non-untrusted libs.

This increases the size of nacl_helper (temporarily) intentionally.

GYP_DEFINES="target_arch=ia32 remove_webcore_debug_symbols=1 linux_strip_symbols=1" GYP_GENERATORS="ninja" gclient runhooks
Before:
   text	   data	    bss	    dec	    hex	filename
1469882	  15576	 108644	1594102	 1852f6	out/Release/nacl_helper

After:
   text	   data	    bss	    dec	    hex	filename
5641443	 124636	 126980	5893059	 59ebc3	out/Release/nacl_helper

GYP_DEFINES="target_arch=x64 remove_webcore_debug_symbols=1 linux_strip_symbols=1" GYP_GENERATORS="ninja" gclient runhooks
Before:
   text	   data	    bss	    dec	    hex	filename
2063530	  27910	 213872	2305312	 232d20	out/Release/nacl_helper

After:
   text	   data	    bss	    dec	    hex	filename
6304467	 234424	 247984	6786875	 678f3b	out/Release/nacl_helper


BUG=https://code.google.com/p/nativeclient/issues/detail?id=3734
TEST=Ran trybot.

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252503

Review URL: https://codereview.chromium.org/140573003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252556 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index 7e09a80..bfa5ec6 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -217,6 +217,12 @@
   ChannelImpl *channel_impl_;
 };
 
+#if defined(OS_POSIX)
+// SocketPair() creates a pair of socket FDs suitable for using with
+// IPC::Channel.
+IPC_EXPORT bool SocketPair(int* fd1, int* fd2);
+#endif
+
 }  // namespace IPC
 
 #endif  // IPC_IPC_CHANNEL_H_