diff options
-rw-r--r-- | components/nacl/browser/nacl_host_message_filter.cc | 6 | ||||
-rw-r--r-- | ipc/ipc_message_attachment_set.h | 2 | ||||
-rw-r--r-- | ipc/ipc_send_fds_test.cc | 4 | ||||
-rw-r--r-- | ppapi/tests/extensions/packaged_app/test_packaged_app.cc | 5 |
4 files changed, 10 insertions, 7 deletions
diff --git a/components/nacl/browser/nacl_host_message_filter.cc b/components/nacl/browser/nacl_host_message_filter.cc index b55eddcf..2090e10 100644 --- a/components/nacl/browser/nacl_host_message_filter.cc +++ b/components/nacl/browser/nacl_host_message_filter.cc @@ -27,8 +27,10 @@ namespace { // The maximum number of resource file handles NaClProcessMsg_Start message // can have. Currently IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage -// is 128 and NaCl sends 5 handles for other purposes, hence 123. -const size_t kMaxPreOpenResourceFiles = 123; +// is 7 and NaCl sends 5 handles for other purposes, hence 2. +// TODO(yusukes): Remove |kMaxPreOpenResourceFiles|. Instead, send an arbitrary +// number of FDs to the NaCl loader process with separate IPC messages. +const size_t kMaxPreOpenResourceFiles = 2; #if defined(OS_POSIX) static_assert(kMaxPreOpenResourceFiles == diff --git a/ipc/ipc_message_attachment_set.h b/ipc/ipc_message_attachment_set.h index b3cc607..7e848bd 100644 --- a/ipc/ipc_message_attachment_set.h +++ b/ipc/ipc_message_attachment_set.h @@ -65,7 +65,7 @@ class IPC_EXPORT MessageAttachmentSet // // In debugging mode, it's a fatal error to try and add more than this number // of descriptors to a MessageAttachmentSet. - static const size_t kMaxDescriptorsPerMessage = 128; + static const size_t kMaxDescriptorsPerMessage = 7; // --------------------------------------------------------------------------- // Interfaces for transmission... diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc index c681672..2e05e03 100644 --- a/ipc/ipc_send_fds_test.cc +++ b/ipc/ipc_send_fds_test.cc @@ -33,8 +33,8 @@ extern "C" { namespace { -const unsigned kNumFDsToSend = 128; // per message -const unsigned kNumMessages = 3; +const unsigned kNumFDsToSend = 7; // per message +const unsigned kNumMessages = 20; const char* kDevZeroPath = "/dev/zero"; #if defined(OS_POSIX) diff --git a/ppapi/tests/extensions/packaged_app/test_packaged_app.cc b/ppapi/tests/extensions/packaged_app/test_packaged_app.cc index 0f47205..5062b5a 100644 --- a/ppapi/tests/extensions/packaged_app/test_packaged_app.cc +++ b/ppapi/tests/extensions/packaged_app/test_packaged_app.cc @@ -28,12 +28,13 @@ namespace { std::string g_last_error; pp::Instance* g_instance = NULL; -// This should be the same as MessageAttachmentSet::kMaxDescriptorsPerMessage in +// This should be larger than or equal to +// MessageAttachmentSet::kMaxDescriptorsPerMessage in // ipc/ipc_message_attachment_set.h. const size_t kMaxDescriptorsPerMessage = 128; #if defined(__clang__) -static_assert(kMaxDescriptorsPerMessage == +static_assert(kMaxDescriptorsPerMessage >= IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage, "kMaxDescriptorsPerMessage is not up to date"); #endif |