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

Side by Side Diff: chrome/browser/operation_output.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: Forgotten review responses. 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
« no previous file with comments | « chrome/browser/chrome_process_singleton_unittest.cc ('k') | chrome/browser/operation_output.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // See apps/app_host/operation_launcher.h for more information about the
6 // definition of an operation.
7
8 #ifndef CHROME_BROWSER_OPERATION_OUTPUT_H_
9 #define CHROME_BROWSER_OPERATION_OUTPUT_H_
10
11 #include "base/memory/scoped_ptr.h"
12
13 class CommandLine;
14
15 // Defines an interface for reporting the output of an operation to its client.
16 // While the operation is ongoing, it may produce output (via |Write()|).
17 // Terminate the operation by passing it to |Complete()| along with an exit
18 // code.
19 class OperationOutput {
20 public:
21 // Instantiates an OperationOutput channel based on the provided command-line.
22 // The required arguments are platform dependent.
23 // This always returns NULL if not on Windows.
24 static scoped_ptr<OperationOutput> Create(const CommandLine& command_line);
25
26 virtual ~OperationOutput() {}
27
28 // Signals the completion of the operation with the specified exit code.
29 // Returns true if the exit code is successfully written.
30 static bool Complete(scoped_ptr<OperationOutput> operation_output,
31 unsigned int exit_code);
32
33 // Sends operation output to the client. Returns true if the output is
34 // successfully written.
35 virtual bool Write(const char* data, unsigned int length) = 0;
36
37 private:
38 // Sends operation exit code to the client. Returns true if the exit code is
39 // successfully written.
40 virtual bool SetExitCode(unsigned int exit_code) = 0;
41 };
42
43 #endif // CHROME_BROWSER_OPERATION_OUTPUT_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_process_singleton_unittest.cc ('k') | chrome/browser/operation_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698