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

Unified Diff: chrome/renderer/render_process.cc

Issue 159843: Linux: don't try and read shmmax in the sandbox. (Closed)
Patch Set: Created 11 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 | « chrome/browser/zygote_main_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_process.cc
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc
index 2718d37b526224301deba4987b9b93c58b513909..d670a259617c3a44dd524f2019b4c30edb7fab3b 100644
--- a/chrome/renderer/render_process.cc
+++ b/chrome/renderer/render_process.cc
@@ -32,18 +32,6 @@
#include "media/base/media.h"
#include "webkit/glue/webkit_glue.h"
-static size_t GetMaxSharedMemorySize() {
- static int size = 0;
-#if defined(OS_LINUX)
- if (size == 0) {
- std::string contents;
- file_util::ReadFileToString(FilePath("/proc/sys/kernel/shmmax"), &contents);
- size = strtoul(contents.c_str(), NULL, 0);
- }
-#endif
- return size;
-}
-
//-----------------------------------------------------------------------------
RenderProcess::RenderProcess()
@@ -166,7 +154,7 @@ skia::PlatformCanvas* RenderProcess::GetDrawingCanvas(
int width = rect.width();
int height = rect.height();
const size_t stride = skia::PlatformCanvas::StrideForWidth(rect.width());
- const size_t max_size = GetMaxSharedMemorySize();
+ const size_t max_size = base::SysInfo::MaxSharedMemorySize();
// If the requested size is too big, reduce the height. Ideally we might like
// to reduce the width as well to make the size reduction more "balanced", but
« no previous file with comments | « chrome/browser/zygote_main_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698