ipc/chromium/src/base/process_posix.cc

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
michael@0 2 // Use of this source code is governed by a BSD-style license that can be
michael@0 3 // found in the LICENSE file.
michael@0 4
michael@0 5 #include "base/process.h"
michael@0 6 #include "base/process_util.h"
michael@0 7
michael@0 8 namespace base {
michael@0 9
michael@0 10 void Process::Close() {
michael@0 11 process_ = 0;
michael@0 12 // if the process wasn't termiated (so we waited) or the state
michael@0 13 // wasn't already collected w/ a wait from process_utils, we're gonna
michael@0 14 // end up w/ a zombie when it does finally exit.
michael@0 15 }
michael@0 16
michael@0 17 void Process::Terminate(int result_code) {
michael@0 18 // result_code isn't supportable.
michael@0 19 if (!process_)
michael@0 20 return;
michael@0 21 // We don't wait here. It's the responsibility of other code to reap the
michael@0 22 // child.
michael@0 23 KillProcess(process_, result_code, false);
michael@0 24 }
michael@0 25
michael@0 26 bool Process::IsProcessBackgrounded() const {
michael@0 27 // http://code.google.com/p/chromium/issues/detail?id=8083
michael@0 28 return false;
michael@0 29 }
michael@0 30
michael@0 31 bool Process::SetProcessBackgrounded(bool value) {
michael@0 32 // http://code.google.com/p/chromium/issues/detail?id=8083
michael@0 33 // Just say we did it to keep renderer happy at the moment. Need to finish
michael@0 34 // cleaning this up w/in higher layers since windows is probably the only
michael@0 35 // one that can raise priorities w/o privileges.
michael@0 36 return true;
michael@0 37 }
michael@0 38
michael@0 39 bool Process::EmptyWorkingSet() {
michael@0 40 // http://code.google.com/p/chromium/issues/detail?id=8083
michael@0 41 return false;
michael@0 42 }
michael@0 43
michael@0 44 ProcessId Process::pid() const {
michael@0 45 if (process_ == 0)
michael@0 46 return 0;
michael@0 47
michael@0 48 return GetProcId(process_);
michael@0 49 }
michael@0 50
michael@0 51 bool Process::is_current() const {
michael@0 52 return process_ == GetCurrentProcessHandle();
michael@0 53 }
michael@0 54
michael@0 55 // static
michael@0 56 Process Process::Current() {
michael@0 57 return Process(GetCurrentProcessHandle());
michael@0 58 }
michael@0 59
michael@0 60 } // namspace base

mercurial