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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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