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

Unified Diff: ppapi/nacl_irt/irt_start.cc

Issue 2148633002: Pass around IPC::ChannelHandles instead of raw fds in the NaCl IRT. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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 | « ppapi/nacl_irt/irt_ppapi.cc ('k') | ppapi/nacl_irt/plugin_startup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/nacl_irt/irt_start.cc
diff --git a/ppapi/nacl_irt/irt_start.cc b/ppapi/nacl_irt/irt_start.cc
index b0f09df701bb493bef0437d8703864e2637ce057..9390acecf5719ec37871ec92ad0baf7b0cb1f9d6 100644
--- a/ppapi/nacl_irt/irt_start.cc
+++ b/ppapi/nacl_irt/irt_start.cc
@@ -16,6 +16,13 @@
#include "ppapi/nacl_irt/irt_interfaces.h"
#include "ppapi/nacl_irt/plugin_startup.h"
+namespace {
+IPC::ChannelHandle MakeIPCHandle(const char* name, int fd) {
+ return IPC::ChannelHandle(name,
+ base::FileDescriptor(fd, false /* auto_close */));
+}
+} // namespace
+
void nacl_irt_start(uint32_t* info) {
nacl_irt_init(info);
@@ -24,10 +31,10 @@ void nacl_irt_start(uint32_t* info) {
// In SFI mode, the FDs of IPC channels are NACL_CHROME_DESC_BASE and its
// successor, which is set in nacl_listener.cc.
- ppapi::SetIPCFileDescriptors(
- NACL_CHROME_DESC_BASE,
- NACL_CHROME_DESC_BASE + 1,
- NACL_CHROME_DESC_BASE + 2);
+ ppapi::SetIPCChannelHandles(
+ MakeIPCHandle("NaCl Browser", NACL_CHROME_DESC_BASE),
+ MakeIPCHandle("NaCl Renderer", NACL_CHROME_DESC_BASE + 1),
+ MakeIPCHandle("NaCl Manifest", NACL_CHROME_DESC_BASE + 2));
ppapi::StartUpPlugin();
nacl_irt_enter_user_code(info, chrome_irt_query);
« no previous file with comments | « ppapi/nacl_irt/irt_ppapi.cc ('k') | ppapi/nacl_irt/plugin_startup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698