ipc/chromium/src/chrome/common/process_watcher.h

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.

     1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
     2 // Use of this source code is governed by a BSD-style license that can be
     3 // found in the LICENSE file.
     5 #ifndef CHROME_COMMON_PROCESS_WATCHER_H_
     6 #define CHROME_COMMON_PROCESS_WATCHER_H_
     8 #include "base/basictypes.h"
     9 #include "base/process_util.h"
    11 class ProcessWatcher {
    12  public:
    13   // This method ensures that the specified process eventually terminates, and
    14   // then it closes the given process handle.
    15   //
    16   // It assumes that the process has already been signalled to exit, and it
    17   // begins by waiting a small amount of time for it to exit.  If the process
    18   // does not appear to have exited, then this function starts to become
    19   // aggressive about ensuring that the process terminates.
    20   //
    21   // This method does not block the calling thread.
    22   //
    23   // NOTE: The process handle must have been opened with the PROCESS_TERMINATE
    24   // and SYNCHRONIZE permissions.
    25   //
    26   static void EnsureProcessTerminated(base::ProcessHandle process_handle
    27                                       , bool force=true
    28   );
    30  private:
    31   // Do not instantiate this class.
    32   ProcessWatcher();
    34   DISALLOW_COPY_AND_ASSIGN(ProcessWatcher);
    35 };
    37 #endif  // CHROME_COMMON_PROCESS_WATCHER_H_

mercurial