ipc/chromium/src/base/process_posix.cc

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/chromium/src/base/process_posix.cc	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +// Copyright (c) 2008 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +#include "base/process.h"
     1.9 +#include "base/process_util.h"
    1.10 +
    1.11 +namespace base {
    1.12 +
    1.13 +void Process::Close() {
    1.14 +  process_ = 0;
    1.15 +  // if the process wasn't termiated (so we waited) or the state
    1.16 +  // wasn't already collected w/ a wait from process_utils, we're gonna
    1.17 +  // end up w/ a zombie when it does finally exit.
    1.18 +}
    1.19 +
    1.20 +void Process::Terminate(int result_code) {
    1.21 +  // result_code isn't supportable.
    1.22 +  if (!process_)
    1.23 +    return;
    1.24 +  // We don't wait here. It's the responsibility of other code to reap the
    1.25 +  // child.
    1.26 +  KillProcess(process_, result_code, false);
    1.27 +}
    1.28 +
    1.29 +bool Process::IsProcessBackgrounded() const {
    1.30 +  // http://code.google.com/p/chromium/issues/detail?id=8083
    1.31 +  return false;
    1.32 +}
    1.33 +
    1.34 +bool Process::SetProcessBackgrounded(bool value) {
    1.35 +  // http://code.google.com/p/chromium/issues/detail?id=8083
    1.36 +  // Just say we did it to keep renderer happy at the moment.  Need to finish
    1.37 +  // cleaning this up w/in higher layers since windows is probably the only
    1.38 +  // one that can raise priorities w/o privileges.
    1.39 +  return true;
    1.40 +}
    1.41 +
    1.42 +bool Process::EmptyWorkingSet() {
    1.43 +  // http://code.google.com/p/chromium/issues/detail?id=8083
    1.44 +  return false;
    1.45 +}
    1.46 +
    1.47 +ProcessId Process::pid() const {
    1.48 +  if (process_ == 0)
    1.49 +    return 0;
    1.50 +
    1.51 +  return GetProcId(process_);
    1.52 +}
    1.53 +
    1.54 +bool Process::is_current() const {
    1.55 +  return process_ == GetCurrentProcessHandle();
    1.56 +}
    1.57 +
    1.58 +// static
    1.59 +Process Process::Current() {
    1.60 +  return Process(GetCurrentProcessHandle());
    1.61 +}
    1.62 +
    1.63 +}  // namspace base

mercurial