summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-09 21:55:08 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-09 21:55:08 +0000
commit698415277ea798691a713c39c43af91a3d7a0dfc (patch)
tree3e45d9ea9f756d718c229af4c8f16c6f8dd41f54 /base
parent9dc212b2b1a811ea05765878a736b68b34003f79 (diff)
downloadchromium_src-698415277ea798691a713c39c43af91a3d7a0dfc.zip
chromium_src-698415277ea798691a713c39c43af91a3d7a0dfc.tar.gz
chromium_src-698415277ea798691a713c39c43af91a3d7a0dfc.tar.bz2
Remove the remaining exit time destructors from base for linux and chromeos.
BUG=101600 TEST=none Review URL: http://codereview.chromium.org/8507022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/linux_util.cc6
-rw-r--r--base/process_linux.cc20
2 files changed, 10 insertions, 16 deletions
diff --git a/base/linux_util.cc b/base/linux_util.cc
index 6751469..143d919 100644
--- a/base/linux_util.cc
+++ b/base/linux_util.cc
@@ -154,9 +154,9 @@ std::string GetLinuxDistro() {
base::GetAppOutput(CommandLine(argv), &output);
if (output.length() > 0) {
// lsb_release -d should return: Description:<tab>Distro Info
- static const std::string field = "Description:\t";
- if (output.compare(0, field.length(), field) == 0) {
- SetLinuxDistro(output.substr(field.length()));
+ const char field[] = "Description:\t";
+ if (output.compare(0, strlen(field), field) == 0) {
+ SetLinuxDistro(output.substr(strlen(field)));
}
}
distro_state_singleton->CheckFinished();
diff --git a/base/process_linux.cc b/base/process_linux.cc
index 3f78a31..bfa1e4a 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 =