diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 00:03:23 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 00:03:23 +0000 |
commit | fdb7ee3dc832589e4ee911a598d4f7fd1054e551 (patch) | |
tree | 1f436470c99e3d4f861252de87f686d8048e841b /chrome/browser/child_process_launcher.h | |
parent | 7d8dc6258b7c9dd771eaf509f5403b602a838388 (diff) | |
download | chromium_src-fdb7ee3dc832589e4ee911a598d4f7fd1054e551.zip chromium_src-fdb7ee3dc832589e4ee911a598d4f7fd1054e551.tar.gz chromium_src-fdb7ee3dc832589e4ee911a598d4f7fd1054e551.tar.bz2 |
Revert 32203,32204,32205 - Launch processes asynchronously so as not to block the UI thread. For now, renderer only, I'll take care of plugin/worker/utility processes in a followup change.
BUG=6844
Review URL: http://codereview.chromium.org/397002
Review URL: http://codereview.chromium.org/402033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/child_process_launcher.h')
-rw-r--r-- | chrome/browser/child_process_launcher.h | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/chrome/browser/child_process_launcher.h b/chrome/browser/child_process_launcher.h deleted file mode 100644 index a2c02f3..0000000 --- a/chrome/browser/child_process_launcher.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_COMMON_CHILD_PROCESS_LAUNCHER_H_ -#define CHROME_COMMON_CHILD_PROCESS_LAUNCHER_H_ - -#include "base/basictypes.h" -#include "base/process.h" -#include "base/ref_counted.h" - -class CommandLine; - -namespace IPC { -class SyncChannel; -} - -// Launches a process asynchronously and notifies the client of the process -// handle when it's available. It's used to avoid blocking the calling thread -// on the OS since often it can take > 100 ms to create the process. -class ChildProcessLauncher { - public: - class Client { - public: - // Will be called on the thread that the ChildProcessLauncher was - // constructed on. - virtual void OnProcessLaunched() = 0; - }; - - // Launches the process asynchronously, calling the client when the result is - // ready. Deleting this object before the process is created is safe, since - // the callback won't be called. If the process is still running by the time - // this object destructs, it will be terminated. - // Takes ownership of cmd_line. - ChildProcessLauncher(CommandLine* cmd_line, - IPC::SyncChannel* channel, - Client* client); - ~ChildProcessLauncher(); - - // True if the process is being launched and so the handle isn't available. - bool IsStarting(); - - // Getter for the process handle. Only call after the process has started. - base::ProcessHandle GetHandle(); - - // Call this when the process exits to know if a process crashed or not. - bool DidProcessCrash(); - - // Changes whether the process runs in the background or not. Only call - // this after the process has started. - void SetProcessBackgrounded(bool background); - - private: - class Context; - - scoped_refptr<Context> context_; - - DISALLOW_COPY_AND_ASSIGN(ChildProcessLauncher); -}; - -#endif // CHROME_COMMON_CHILD_PROCESS_LAUNCHER_H_ |