diff options
Diffstat (limited to 'base')
-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); } |