diff options
author | tyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 03:49:28 +0000 |
---|---|---|
committer | tyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 03:49:28 +0000 |
commit | b195ea8977609c6f04c0ba1c7922b596a224e126 (patch) | |
tree | e682884935f84c9c649444378ed51aba9a5148a7 | |
parent | ecce175d8414948b0a38f301f32b17a33993de16 (diff) | |
download | chromium_src-b195ea8977609c6f04c0ba1c7922b596a224e126.zip chromium_src-b195ea8977609c6f04c0ba1c7922b596a224e126.tar.gz chromium_src-b195ea8977609c6f04c0ba1c7922b596a224e126.tar.bz2 |
Don't call SetPriorityClass when process_ is 0.
BUG=15606
TEST=none
Original review: http://codereview.chromium.org/149202
Patch by tyoshino@google.com
(Myself. Got code reviewed before becoming committer)
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20851 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/process_win.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/process_win.cc b/base/process_win.cc index 98a7f46..263e577 100644 --- a/base/process_win.cc +++ b/base/process_win.cc @@ -23,7 +23,8 @@ void Process::Terminate(int result_code) { } bool Process::IsProcessBackgrounded() const { - DCHECK(process_); + if (!process_) + return false; // Failure case. DWORD priority = GetPriorityClass(process_); if (priority == 0) return false; // Failure case. @@ -31,7 +32,8 @@ bool Process::IsProcessBackgrounded() const { } bool Process::SetProcessBackgrounded(bool value) { - DCHECK(process_); + if (!process_) + return false; DWORD priority = value ? BELOW_NORMAL_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS; return (SetPriorityClass(process_, priority) != 0); } |