summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-04 00:52:56 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-04 00:52:56 +0000
commit5395e9fd0212282f8cf3fe1f0830837c7f703a86 (patch)
tree2c2f139af63b53c80694ca732aa0d8a675d6c16c /base
parent220f50e960b1ee25517e01a24475a9d2964b9d08 (diff)
downloadchromium_src-5395e9fd0212282f8cf3fe1f0830837c7f703a86.zip
chromium_src-5395e9fd0212282f8cf3fe1f0830837c7f703a86.tar.gz
chromium_src-5395e9fd0212282f8cf3fe1f0830837c7f703a86.tar.bz2
Mark some functions that wait on other processes as unsafe for IO/UI.
This might have helped catch an earlier bug, where we were shelling out to lsb_release on Linux. BUG=21782 Review URL: http://codereview.chromium.org/4149006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/process_util_posix.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 8a97dcd..92ef964 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -26,6 +26,7 @@
#include "base/process_util.h"
#include "base/scoped_ptr.h"
#include "base/stringprintf.h"
+#include "base/thread_restrictions.h"
#include "base/time.h"
#include "base/waitable_event.h"
@@ -553,6 +554,9 @@ bool LaunchAppImpl(
} else {
// Parent process
if (wait) {
+ // While this isn't strictly disk IO, waiting for another process to
+ // finish is the sort of thing ThreadRestrictions is trying to prevent.
+ base::ThreadRestrictions::AssertIOAllowed();
pid_t ret = HANDLE_EINTR(waitpid(pid, 0, 0));
DPCHECK(ret > 0);
}
@@ -748,6 +752,9 @@ int64 TimeValToMicroseconds(const struct timeval& tv) {
static bool GetAppOutputInternal(const CommandLine& cl, char* const envp[],
std::string* output, size_t max_output,
bool do_search_path) {
+ // Doing a blocking wait for another command to finish counts as IO.
+ base::ThreadRestrictions::AssertIOAllowed();
+
int pipe_fd[2];
pid_t pid;
InjectiveMultimap fd_shuffle1, fd_shuffle2;