summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorvictorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-04 03:23:53 +0000
committervictorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-04 03:23:53 +0000
commitb42c465e2b436e8eb850d555251e40ae434ff2a0 (patch)
tree68fd1be0c577617355f978f628d2da46a6613138 /base
parent30e56a5d3a36d5f6f6b138a56bf8e40de37e626e (diff)
downloadchromium_src-b42c465e2b436e8eb850d555251e40ae434ff2a0.zip
chromium_src-b42c465e2b436e8eb850d555251e40ae434ff2a0.tar.gz
chromium_src-b42c465e2b436e8eb850d555251e40ae434ff2a0.tar.bz2
Recommit 68258 - 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 TBR=evan@chromium.org Review URL: http://codereview.chromium.org/5625005 TBR=victorw@chromium.org Review URL: http://codereview.chromium.org/5588005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68277 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;