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

Unified Diff: base/process_linux.cc

Issue 8507022: Remove the remaining exit time destructors from base for linux and chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 1 month 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 | « base/linux_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_linux.cc
diff --git a/base/process_linux.cc b/base/process_linux.cc
index 3f78a31c193039a1dee54d7ff7be007c33c41a04..bfa1e4a03cc4b2caf6f741c554e701dbe6062804 100644
--- a/base/process_linux.cc
+++ b/base/process_linux.cc
@@ -11,17 +11,6 @@
#include "base/logging.h"
#include "base/stringprintf.h"
-#if defined(OS_CHROMEOS)
-static bool use_cgroups = false;
-static bool cgroups_inited = false;
-static const char kForegroundTasks[] =
- "/tmp/cgroup/cpu/chrome_renderers/foreground/tasks";
-static const char kBackgroundTasks[] =
- "/tmp/cgroup/cpu/chrome_renderers/background/tasks";
-static FilePath foreground_tasks;
-static FilePath background_tasks;
-#endif
-
namespace base {
#if defined(OS_CHROMEOS)
@@ -42,15 +31,20 @@ bool Process::SetProcessBackgrounded(bool background) {
DCHECK(process_);
#if defined(OS_CHROMEOS)
+ static bool cgroups_inited = false;
+ static bool use_cgroups = false;
+
// Check for cgroups files. ChromeOS supports these by default. It creates
// a cgroup mount in /tmp/cgroup and then configures two cpu task groups,
// one contains at most a single foreground renderer and the other contains
// all background renderers. This allows us to limit the impact of background
// renderers on foreground ones to a greater level than simple renicing.
+ FilePath foreground_tasks(
+ "/tmp/cgroup/cpu/chrome_renderers/foreground/tasks");
+ FilePath background_tasks(
+ "/tmp/cgroup/cpu/chrome_renderers/background/tasks");
if (!cgroups_inited) {
cgroups_inited = true;
- foreground_tasks = FilePath(kForegroundTasks);
- background_tasks = FilePath(kBackgroundTasks);
file_util::FileSystemType foreground_type;
file_util::FileSystemType background_type;
use_cgroups =
« no previous file with comments | « base/linux_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698