Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: apps/app_host/operation_launcher.h

Issue 12674028: Report text output and exit code for command-line operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Line endings. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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.
4 //
5 // Operations are command-line invocations. Like a process, they can have output
6 // and an exit code. But an operation does not necessarily correspond to a
7 // single process. For example, the operation can complete while the launched
8 // process continues to perform other tasks, or the launched process might exit
9 // while the operation is completed by other processes.
10 //
11 // An executable implements an operation by accepting three additional arguments
12 // on the command-line:
13 //
14 // switches::kTaskRemoteProcessId
15 // The process ID of the operation client
16 //
17 // switches::kTaskOutputHandle
18 // A writable HANDLE, valid in the client process, which should be used to
19 // write the operation output.
20 //
21 // switches::kTaskResultHandle
22 // A writable HANDLE, valid in the client process, which should be used to
23 // write the operation exit code (as a binary DWORD).
gab 2013/03/28 03:06:06 nit: Indent 2nd line of comment 2 more spaces
gab 2013/03/28 03:06:06 s/(as a binary DWORD)/(as a DWORD) ? How can a DWO
erikwright (departed) 2013/04/18 17:43:04 I guess I meant in binary format as opposed to bei
erikwright (departed) 2013/04/18 17:43:04 Done.
24 //
25 // LaunchOperation (declared below) will add these parameters to the operation
26 // command-line before invoking it to launch the original operation process. The
27 // HANDLEs will only be valid during the lifetime of the original operation
28 // process; therefore the operation implementation MUST be sure to duplicate
29 // them before it exits if it is delegating to a tertiary process.
30
31 #ifndef APPS_APP_HOST_OPERATION_LAUNCHER_H_
32 #define APPS_APP_HOST_OPERATION_LAUNCHER_H_
33
34 #include <windows.h>
35
36 class CommandLine;
37
38 namespace app_host {
39
40 // Runs the provided command, passing anonymous pipes to be used for operation
gab 2013/03/28 03:06:06 s/command/|command_line/
erikwright (departed) 2013/04/18 17:43:04 Done.
41 // output and exit code. To prevent deadlocks, |output_write| must be drained
gab 2013/03/28 03:06:06 Can you add an example of why this could cause a d
erikwright (departed) 2013/04/18 17:43:04 Done.
42 // somehow. In production code it will typically be the terminal of the current
43 // process.
44 // Returns true if the operation is successfully launched and its exit code
45 // received.
46 bool LaunchOperation(const CommandLine& command_line,
47 HANDLE output_write,
48 DWORD* exit_code);
49
50 } // namespace app_host
51
52 #endif // APPS_APP_HOST_OPERATION_LAUNCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698