Linux: don't try and read shmmax in the sandbox.

In the sandbox, reading shmmax from proc always fails. Thus, we move
the function into base and call it before starting the sandbox. The
value is then cached.

http://codereview.chromium.org/159843


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22393 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc
index 01eb837..6752a068 100644
--- a/chrome/browser/zygote_main_linux.cc
+++ b/chrome/browser/zygote_main_linux.cc
@@ -17,6 +17,7 @@
 #include "base/path_service.h"
 #include "base/pickle.h"
 #include "base/rand_util.h"
+#include "base/sys_info.h"
 #include "base/unix_domain_socket_posix.h"
 
 #include "chrome/browser/zygote_host_linux.h"
@@ -313,6 +314,8 @@
     // files and cache the results or the descriptors.
     base::RandUint64();
 
+    base::SysInfo::MaxSharedMemorySize();
+
     // To make wcstombs/mbstowcs work in a renderer, setlocale() has to be
     // called before the sandbox is triggered. It's possible to avoid calling
     // setlocale() by pulling out the conversion between FilePath and