summaryrefslogtreecommitdiffstats
path: root/chrome/nacl
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 01:12:24 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 01:12:24 +0000
commit97c652b98f92e060e3ed3a11d2c808d85a7e1c1c (patch)
tree869d2ba677905ea0cba67f4ee311d15846f97790 /chrome/nacl
parent31ad4a24b884526a51f81efa556c019dcc27657d (diff)
downloadchromium_src-97c652b98f92e060e3ed3a11d2c808d85a7e1c1c.zip
chromium_src-97c652b98f92e060e3ed3a11d2c808d85a7e1c1c.tar.gz
chromium_src-97c652b98f92e060e3ed3a11d2c808d85a7e1c1c.tar.bz2
Make GlobalDescriptors::MaybeGet return -1 when the key is not found.
BUG=None TEST=Unit tests should still pass. Review URL: https://chromiumcodereview.appspot.com/10387218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r--chrome/nacl/nacl_helper_linux.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/nacl/nacl_helper_linux.cc b/chrome/nacl/nacl_helper_linux.cc
index 4926e62..7964340 100644
--- a/chrome/nacl/nacl_helper_linux.cc
+++ b/chrome/nacl/nacl_helper_linux.cc
@@ -19,12 +19,14 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/eintr_wrapper.h"
+#include "base/global_descriptors_posix.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/posix/unix_domain_socket.h"
#include "base/rand_util.h"
#include "chrome/nacl/nacl_listener.h"
#include "crypto/nss_util.h"
+#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_switches.h"
namespace {
@@ -39,8 +41,9 @@ void BecomeNaClLoader(const std::vector<int>& child_fds,
// don't need zygote FD any more
if (HANDLE_EINTR(close(kNaClZygoteDescriptor)) != 0)
LOG(ERROR) << "close(kNaClZygoteDescriptor) failed.";
- // Set up browser descriptor as expected by Chrome on fd 3
- // The zygote takes care of putting the sandbox IPC channel on fd 5
+ // Set up browser descriptor on fd 3 and IPC as expected by Chrome.
+ base::GlobalDescriptors::GetInstance()->Set(kPrimaryIPCChannel,
+ kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
int zfd = dup2(child_fds[kNaClBrowserFDIndex], kNaClBrowserDescriptor);
if (zfd != kNaClBrowserDescriptor) {
LOG(ERROR) << "Could not initialize kNaClBrowserDescriptor";