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

Unified Diff: components/nacl/browser/nacl_host_message_filter.cc

Issue 998833002: Increase MessageAttachmentSet::kMaxDescriptorsPerMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 9 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 | « no previous file | ipc/ipc_channel_nacl.cc » ('j') | ipc/ipc_channel_nacl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_host_message_filter.cc
diff --git a/components/nacl/browser/nacl_host_message_filter.cc b/components/nacl/browser/nacl_host_message_filter.cc
index 18a695e7c54af6c46b4678c0b283a1aab49f9fc5..9da3fe51726b73a3082b190a47e3cf2ddb617f2f 100644
--- a/components/nacl/browser/nacl_host_message_filter.cc
+++ b/components/nacl/browser/nacl_host_message_filter.cc
@@ -14,6 +14,7 @@
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
+#include "ipc/ipc_message_attachment_set.h"
#include "ipc/ipc_platform_file.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -25,9 +26,15 @@ namespace nacl {
namespace {
// The maximum number of resource file handles NaClProcessMsg_Start message
-// can have.
-// TODO(yusukes): Increase the number.
-const size_t kMaxPreOpenResourceFiles = 2;
+// can have. Currently IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage
+// is 128 and NaCl sends 5 handles for other purposes, hence 123.
+const size_t kMaxPreOpenResourceFiles = 123;
+
+#if defined(OS_POSIX)
+static_assert(kMaxPreOpenResourceFiles ==
+ IPC::MessageAttachmentSet::kMaxDescriptorsPerMessage - 5,
+ "kMaxPreOpenResourceFiles is not up to date");
+#endif
ppapi::PpapiPermissions GetNaClPermissions(
uint32 permission_bits,
« no previous file with comments | « no previous file | ipc/ipc_channel_nacl.cc » ('j') | ipc/ipc_channel_nacl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698